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

How to extract only water using osmosis?

1

Hi all

I'm trying to extract only waterbodies from a .osm file using osmosis. I'm almost there, but my command is returning islands and islets as water and I can't figure out how to get only water!

Here's the command I'm using:

osmosis --read-xml swedencity.osm --tf accept-relations natural=water landuse=basin,reservoir --tf reject-relations intermittent=yes --used-way --used-node --write-pbf swedencity-waterbody-relations.osm.pbf

This returns the water I want, but also returns features with place=island and islet, as well as a ton of smaller islands w/o any place tag. Is there a way to eliminate all of these? My attempts to reject island relations have failed so far...

Any help is much appreciated! Thanks so much.

asked 10 Apr '18, 18:41

kellya's gravatar image

kellya
26112
accept rate: 0%

edited 11 Apr '18, 22:29

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554

1

They are likely inner members of water relations; that's how water is modeled in OSM, with islands as holes in the water.

(11 Apr '18, 01:55) maxerickson

Source code available on GitHub .