2

Can anyone show me how to get area polygons (just any landmass) with bounding box using Overpass?

I just want to differentiate between water and land - if you think it's better to assume everywhere is dry land and query for polygons of water to specifically render them instead, then please demonstrate this if possible.

EDIT: To clarify, I can't do massive queries (I'm splitting them up into bounding boxes), so I'm really pleased with the relation"type"="boundary"; solution, but I just need to tailor that query to filter out or ignore bodies of water. There must be a query that just returns useful "land only" polygons for a specific bounding box.

6
  • Are you looking for continents/oceans polygons? Aug 11, 2015 at 20:19
  • I'm looking for any water polygons at all within the bounding box, so I can render them as filled polygons to distinguish everything else as solid land.
    – HomerPlata
    Aug 12, 2015 at 8:43
  • Similar to this example: stackoverflow.com/questions/25297811/… I just want the simplest way to distinguish land from water, via an Overpass query. I don't particularly mind whether it's the land or the water polygon(s) that I get.
    – HomerPlata
    Aug 12, 2015 at 16:42
  • In such case, try MDHald's solution with overpass-turbo.eu API. Aug 12, 2015 at 17:09
  • I'm trying, but one solution only gives me a line boundary of the coast (where I actually need a full polygon), and the other gives me polygons that don't care if they encompass water or not.
    – HomerPlata
    Aug 12, 2015 at 17:39

1 Answer 1

3

Using Overpass Turbo

To get Admin Boundaries use the Boundary tag

[out:json];

(
  relation["type"="boundary"]({{bbox}});
);

out body;
>;
out skel qt;

To get the Water use the Water Tag For the water tag add whatever you need in terms of specific water types. The code is below.

[out:json];

(

  way["natural"="water"]({{bbox}});
  way["natural"="water"]({{bbox}});
  way["water"="lake"]({{bbox}});
  way["natural"="coastline"]({{bbox}});
  way["waterway"="riverbank"]({{bbox}});
);

out body;
>;
out skel qt;
4
  • Rivers are also modeled using relations, i.e. you'll have to add them to your query for a complete response. The boundary tag query returns all sorts of boundaries, not only admin boundaries.
    – mmd
    Aug 12, 2015 at 14:24
  • This boundary query seemed perfect at first, but then I noticed it doesn't "rule out" bodies of water (eg. draws a polygon including Birkenhead and Liverpool, encompassing the River Mersey). Can this be tweaked to exclude water? How can I get river data from relations?
    – HomerPlata
    Aug 12, 2015 at 15:32
  • I believe you would need to do a clip of some sort with the data using a GIS. As I understand the Administrative boundaries are deployed based on the Geo-Political Boundaries and thus would not follow any natural features. your best bet is to take the data into a GIS and perform a clip on the Admin boundaries using the River.
    – MDHald
    Aug 12, 2015 at 18:41
  • You can always just download the data from Natural Earth Data where you can download the Cultural Data (Boundaries) and the Physical Vectors(Oceans, Lakes, etc)
    – MDHald
    Aug 12, 2015 at 18:54

Your Answer

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

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