I have a OSM file (http://download.geofabrik.de/europe/malta-latest.osm.pbf). I am only interested in data that are around ramps (motorway_link,trunk_link,primary_link,secondary_link,tertiary_link) as in the picture. Therefore I want to preprocess the data to keep the OSM file as small as possible. I use the osmium tool.
I want to do it as followed, but I do not know how to implement step 2:
- Filter pbf file by desired tags -> malta-ramps.osm.pbf
osmium tags-filter -v --overwrite -o malta-ramps.osm.pbf malta-latest.osm.pbf w/highway=motorway_link,trunk_link,primary_link,secondary_link,tertiary_link
- Create polygons around the filteres data -> malta-polygons.poly
How to create the buffered polygons around the ramps e.g. with python?
- Cut out the polygons from the original OSM file -> malta-finished.osm.pbf
osmium extract --overwrite -p malta-polygons.poly -o malta-finished.osm.pbf malta-latest.osm.pbf