osmium
Multipurpose tool for handling OpenStreetMap (OSM) files. tldr-pages
On several platforms
Several platforms
Show file information
osmium fileinfo path/to/input.osmIdentifyDisplay contents
osmium show path/to/input.osmIdentifyConvert file format from PBF into XML
osmium cat path/to/input.osm.pbf --output path/to/output.osmIdentifyExtract a geographic region by the given bounding box
osmium extract --bbox min_longitude,min_latitude,max_longitude,max_latitude path/to/input.pbf --output path/to/output.pbfIdentifyExtract a geographic region by a GeoJSON file
osmium extract --polygon path/to/polygon.geojson path/to/input.pbf --output path/to/output.pbfIdentifyFilter all objects tagged as "restaurant"
osmium tags-filter path/to/input.pbf amenity=restaurant --output path/to/output.pbfIdentifyFilter for "way" objects tagged as "highway"
osmium tags-filter path/to/input.pbf w/highway --output path/to/output.pbfIdentifyFilter "way" and "relation" objects tagged as "building"
osmium tags-filter path/to/input.pbf wr/building --output path/to/output.pbfIdentify