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

Export data wich contains complete ways only

0

Hello, I want to export osm data from open street map. However, the file should only contain complete ways. This means, the file should not contain ways which reference nodes outside the target area.

Does somebody know how I can do this in open street map or maybe there is a tool which can eliminate ways which are not complete in an osm file.

Thanks in advance!

asked 20 Mar '15, 16:16

stteffen's gravatar image

stteffen
11112
accept rate: 0%


One Answer:

2

Exporting data through the web site will always yield complete ways. Extracting data with osmosis from a larger OSM file also offers a completeWays option. If you already have a file with some ways that reference missing nodes, the following trick

osmosis --read-pbf input.osm.pbf --bb left=-180 right=180 top=90 bottom=-90 clipIncompleteEntities=true --write-pbf output.osm.pbf

will remove all dangling references from ways.

answered 20 Mar '15, 22:05

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Source code available on GitHub .