osmosis

Command-line tool for processing and analyzing OpenStreetMap data

brewmacoslinux
Try with needOr install directly
Source

About

Command-line OpenStreetMap data processor

Commands

osmosis

Examples

Convert OSM XML file to PBF (Protocol Buffer) format$ osmosis --read-xml input.osm --write-pbf output.pbf
Extract data within a bounding box from an OSM file$ osmosis --read-pbf input.pbf --bounding-box top=51.5 left=-0.1 bottom=51.4 right=0.0 --write-pbf output.pbf
Filter OSM data to only include specific keys (e.g., highways)$ osmosis --read-pbf input.pbf --tag-filter accept-ways highway=* --write-pbf output.pbf