1

I'm looking for an overpass turbo query that gives me all (salt) water entities.
Currently, this is my query (using the overpass web interface):


[out:json][timeout:25];
(
  node["place"="sea"]({{bbox}});
  way["place"="sea"]({{bbox}});
  relation["place"="sea"]({{bbox}});
 
  node["natural"="bay"]({{bbox}});
  way["natural"="bay"]({{bbox}});
  relation["natural"="bay"]({{bbox}});

  node["water"]({{bbox}});
  way["water"]({{bbox}});
  relation["water"]({{bbox}});
  
  node["natural"="ocean"]({{bbox}});
  way["natural"="ocean"]({{bbox}});
  relation["natural"="ocean"]({{bbox}});
);

out body;
>;
out skel qt;

Basically, this works fine. But for certain sea elements, I do not get any results.
Is this because some are just not mapped and sea is considered as a base layer?

Take this point for example: https://www.openstreetmap.org/#map=19/36.00849/-5.44347

3
  • 1
    Welcome to GIS StackExchange! What is your desired output? Do you want polygons of all salt water surfaces (then you would not need the nodes of course)? Or nodes with the names of (salt) water entities (no ways and relations needed)? I think that more details are necessary to answer your question. Please have in mind that the oceans/larger seas do not exist as relations in OSM but are rendered based on natural=coastline rings (clockwise and without any gaps). By the way, you can query nodes, ways and relations together using e.g. nwr[natural=bay]({{bbox}});.
    – winnewoerp
    Dec 7, 2023 at 6:15
  • 1
    Are these prepared datasets maybe useful for you? osmdata.openstreetmap.de/data/coastlines.html or osmdata.openstreetmap.de/data/water-polygons.html
    – winnewoerp
    Dec 7, 2023 at 6:17
  • 1
    @winnewoerp Thank you. I'd like to have the polygons of the sea. In the same way as I get them by querying nwr[natural=bay]({{bbox}}); But it is like I already assumed: "larger seas do not exist as relations". So have to find a way using the coastlines. I guess my question is answered, at least for me.
    – Daniel
    Dec 7, 2023 at 13:50

2 Answers 2

1

As @winnewoerp stated: "the oceans/larger seas do not exist as relations in OSM but are rendered based on natural=coastline rings", you have to make use of the coastline

nwr["natural"="coastline"]({{bbox}});

or use the prepared land or water polygon data sets here: https://osmdata.openstreetmap.de/data/. These are split into 1° Lat/Lon tiles, which comes very handy.

0

I am currently working on code which joins coastline segments, repairs gaps and completes polygons for a chosen area. This is for an app I am working on. I am happy to post the relevant code when it’s ready.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.