Overpass-API icon indicating copy to clipboard operation
Overpass-API copied to clipboard

Does Overpass API support importing from planet.pbf?

Open jverkoey opened this issue 9 months ago • 3 comments

Specifically, https://planet.openstreetmap.org provides https://planet.openstreetmap.org/pbf/planet-latest.osm.pbf, which I have downloaded and am attempting to initialize the database with.

When I run:

cat "${PBF_FILE}" | "${OVERPASS_DIR}/bin/update_database" --db-dir="$DB_DIR" --compression-method=no

I get:

Reading XML file ...Parse error at line 1:
not well-formed (invalid token)

Which seems to imply that Overpass might only work with the xml variation of the data?

jverkoey avatar Mar 26 '25 17:03 jverkoey

Overpass only understands XML but you can install osmium-tool and then do:

osmium cat -o - -f xml "${PBF_FILE}" | ....

lonvia avatar Mar 29 '25 11:03 lonvia

I've implemented pbf import in my unofficial fork, see https://www.openstreetmap.org/user/mmd/diary/400113

Directly importing pbf avoids much of the overhead of processing xml data. The libosmium library that I used for the heavy lifting supports this use case quite well. It can also run parts of the processing in parallel.

For the official version, I'd also recommend osmium cat, by the way.

mmd-osm avatar Mar 30 '25 18:03 mmd-osm

The @mmd-osm fork is here https://github.com/mmd-osm/Overpass-API for folks looking for it.

markstos avatar Nov 15 '25 02:11 markstos