Forrest logo
back to the osmium tool

osmium:tldr:57f0a

osmium: Filter for "way" objects tagged as "highway".
$ osmium tags-filter ${path-to-input-pbf} w/highway -o ${path-to-output-pbf}
try on your machine

The command is using the osmium utility to perform a tags-filter operation on an input PBF file. Here is a breakdown of the command:

  1. osmium: This refers to the osmium utility command-line tool used for working with OpenStreetMap data.

  2. tags-filter: This is the sub-command to specify that you want to filter data based on specific tags.

  3. ${path-to-input-pbf}: This is a placeholder for the path to the input PBF (Protocolbuffer Binary Format) file. You need to replace it with the actual file path.

  4. w/highway: This is the tag filter expression. It instructs osmium to only keep entities (nodes, ways, or relations) that have the tag highway.

  5. -o: This option specifies the output file flag.

  6. ${path-to-output-pbf}: This is a placeholder for the path to the output PBF file. You need to replace it with the actual file path where you want to save the filtered data.

In summary, the command filters an input PBF file to only keep entities with the highway tag, and saves the filtered data to the specified output PBF file.

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