A quick reference to osmconvert.
Created on: 2019-01-22
Tag: cheat_sheet
Converting osm to pbf:
osmconvert test.osm --out-pbf > test.osm.pbf
Converting pbf to osm:
osmconvert test.osm.pbf --out-osm > test.osm
Converting osm to csv:
osmconvert test.osm --all-to-nodes --csv="@id @lon @lat amenity shop name" --csv-headline -o=test.csv
Extracting pbf of a specific geo-bound from a large pbf with poly file:
osmconvert $pbf_file -B=$poly_file -o=$output_pbf_file
Extracting pbf of a specific geo-bound from a large pbf with bbox:
osmconvert bangladesh.osm.pbf -b=90.32908,23.66621,90.51599,23.90121 -o=dhaka.osm.pbf
Getting osm file statistics:
osmconvert $file --out-statistics