openstreetmappostgisosm2pgsql

Conversion of .osm file extension to .osm.pbf


I am trying to use osm2pgsql which requires me have a .pbf file extension. Is it possible to convert .osm file to .osm.pbf file?

Thanks in advance :)


Solution

  • osm2pgsql can read .osm files directly. .osm.pbf is just a compressed .osm file (see PBF Format in the OSM wiki).

    If you still need to convert between those files for whatever reason then take a look at osmium-tool (the fastest and more modern), osmosis or osmconvert.