This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

how to cut out data within a defined polygon with osmosis

0
1

With the current document, osmosis only support extracting a subset from a large downloaded file by define a polygon.

But whether there’s a solution to cut out data within a defined polygon.

I have file europe.pbf, what I want to do is cutting out 'Russia' data, keep other country, but I can't find a way which can help me.

asked 24 May '17, 08:06

webertao's gravatar image

webertao
11112
accept rate: 0%


One Answer:

1

Check the example on https://wiki.openstreetmap.org/wiki/Osmosis/Polygon_Filter_File_Format - what you want is a file with two polygons, the first being a large rectangle around Europe (or a rectangle that covers the whole planet), the second should be a polygon describing Russia, and it needs to be introduced with an exclamation mark which means it is a "hole" in the polygon before.

answered 24 May '17, 08:44

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Thanks a lot for the rectangle that covers the whole planet, whether it could be '90,180', '90,-180', '-90,-180', '-90, 180'?

(24 May '17, 09:20) webertao

Yep, that'll work.

(24 May '17, 09:26) Frederik Ramm ♦

Source code available on GitHub .