[GIS] How to get landmass polygons for bounding box in Overpass API

overpass-api

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.

Best Answer

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;
Related Question