From b9db027a0554bb209724018a287f6ce3eb717074 Mon Sep 17 00:00:00 2001 From: Jakob Miksch Date: Thu, 29 Sep 2022 09:23:59 +0200 Subject: [PATCH] osmium: add page (#8535) * osmium: add file * Apply suggestions from code review --- pages/common/osmium.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 pages/common/osmium.md diff --git a/pages/common/osmium.md b/pages/common/osmium.md new file mode 100644 index 000000000..842d07ed0 --- /dev/null +++ b/pages/common/osmium.md @@ -0,0 +1,36 @@ +# osmium + +> Multipurpose tool for handling OpenStreetMap (OSM) files. +> More information: . + +- Show file information: + +`osmium fileinfo {{path/to/input.osm}}` + +- Display contents: + +`osmium show {{path/to/input.osm}}` + +- Convert file format from PBF into XML: + +`osmium cat {{path/to/input.osm.pbf}} -o {{path/to/output.osm}}` + +- Extract a geographic region by the given [b]ounding box: + +`osmium extract -b {{min_longitude}},{{min_latitude}},{{max_longitude}},{{max_latitude}} {{path/to/input.pbf}} -o {{path/to/output.pbf}}` + +- Extract a geographic region by a GeoJSON file: + +`osmium extract -p {{path/to/polygon.geojson}} {{path/to/input.pbf}} -o {{path/to/output.pbf}}` + +- Filter all objects tagged as "restaurant": + +`osmium tags-filter {{path/to/input.pbf}} amenity=restaurant -o {{path/to/output.pbf}}` + +- Filter for "way" objects tagged as "highway": + +`osmium tags-filter {{path/to/input.pbf}} w/highway -o {{path/to/output.pbf}}` + +- Filter "way" and "relation" objects tagged as "building": + +`osmium tags-filter {{path/to/input.pbf}} wr/building -o {{path/to/output.pbf}}`