Forrest logo
back to the osmium tool

osmium:tldr:54ea7

osmium: Filter "way" and "relation" objects tagged as "building".
$ osmium tags-filter ${path-to-input-pbf} wr/building -o ${path-to-output-pbf}
try on your machine

The command osmium tags-filter is used to filter and extract specific tags from an OSM (OpenStreetMap) file.

${path-to-input-pbf} is a placeholder representing the path to the input OSM file in PBF (Protocolbuffer Binary Format). PBF is a binary format that efficiently stores OSM data.

wr/building is the filter expression used to extract specific tags related to buildings. The wr prefix specifies that the filter will be applied on ways and relations (the w and r stand for way and relation, respectively). The building tag specifies that you want to extract only those elements that have the building tag.

${path-to-output-pbf} is a placeholder representing the path to the output OSM file in PBF format. This is where the filtered OSM data will be written.

In summary, this command filters an OSM file and extracts only the elements (ways and relations) that are tagged as buildings. The filtered data is then written to a new OSM file at the specified output path.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the osmium tool