[Tile-serving] [openstreetmap/osm2pgsql] Improve handling of multiple input files (#1339)

Jochen Topf notifications at github.com
Wed Nov 25 13:33:06 UTC 2020


Osm2pgsql can handle any number of input files. The old code will just
read the files one after the other which will not work if there is any
overlap between the files, i.e. if the same object is in two input
files.

The new code will read the files in parallel. We construct a priority
queue feeding in the next objects from all input files, taking off the
"smallest" one by one. If the same object is in multiple files, we
only process it once.

If there is only a single input file a shortcut is taken which basically
behaves like the old code.

Note that the input files have to be from the same point in time. If
there are multiple versions of the same object in the input, this will
still not magically work.

This commit removes support for unsorted input files which were already
deprecated.

See #1167

This commit removes support for negative ids which were already
deprecated.

Fixes #1097
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/osm2pgsql/pull/1339

-- Commit Summary --

  * Improve handling of multiple input files

-- File Changes --

    M src/CMakeLists.txt (1)
    D src/check-order.cpp (80)
    D src/check-order.hpp (40)
    M src/osm2pgsql.cpp (62)
    M src/osmdata.cpp (223)
    M src/osmdata.hpp (27)
    M tests/CMakeLists.txt (2)
    M tests/common-import.hpp (18)
    A tests/test-osmdata.cpp (78)
    A tests/test-output-flex-multi-input.cpp (64)

-- Patch Links --

https://github.com/openstreetmap/osm2pgsql/pull/1339.patch
https://github.com/openstreetmap/osm2pgsql/pull/1339.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/1339
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20201125/bfaddd02/attachment-0001.htm>


More information about the Tile-serving mailing list