Skip to content

CLI Overview ​

pbfhogg includes a command-line toolkit for common OSM PBF operations. Install it with:

sh
cargo install pbfhogg-cli

The binary is called pbfhogg. Requires the Rust version named by rust-version in the workspace Cargo.toml.

Commands at a Glance ​

CommandDescription
inspectFile inspection: metadata, block breakdown, ordering, tag frequencies
checkValidate IDs and referential integrity
catConcatenate PBFs with optional type filtering
sortSort into standard order (nodes, ways, relations by ID)
repackRe-encode a PBF with a configurable per-blob element cap
degradeProduce a valid-but-adversarial PBF for benchmarking non-optimal paths
extractExtract by bounding box or GeoJSON polygon (simple/complete/smart)
tags-filterFilter elements by tag expressions (PBF or OSC input)
exportStream tagged nodes/ways to GeoJSON or GeoJSONSeq
diffCompare two PBFs; --format osc generates an OSC diff
digestPrint an encoding-independent digest of a PBF: header, elements and metadata (--form full, default), or element content equal for files diff finds identical (--form content)
getidExtract or remove elements by ID
getparentsFind ways/relations referencing given IDs
apply-changesApply OSC diff to a sorted PBF with blob passthrough
add-locations-to-waysEmbed node coordinates in ways
renumberRenumber all element IDs sequentially
time-filterFilter history PBF to a point-in-time snapshot
merge-changesMerge multiple OSC files into one
build-geocode-indexBuild reverse geocoding index (S2 cells, mmap-ready)
geocode-queryAnswer reverse geocoding queries over an index, as JSON lines

Flags ​

pbfhogg <command> --help lists a command's flags. Commands is the full reference: every flag, the flags most write commands share, the exit codes and the output contract.

Released under the Apache License 2.0. | Copyright folk@folk.wtf