3

I am trying to get the shape of country in Overpass API without the maritime limit in http://overpass-turbo.eu

And I have this query but it shows the maritime:

relation
  ["boundary"="administrative"]
  ["admin_level"="2"]
  ["name:en"="Spain"];
(._;>;);
out body; 
tres.14159
  • 850
  • 1
  • 16
  • 26

2 Answers2

2

I found it, thanks to OpenStreetmap spanish mailing list and the doc (it is in spanish) https://iceosm2016.readthedocs.io/en/latest/ .

area["name"="España"]->.country;
rel["name"="España"]["type"="boundary"]["admin_level"="2"];
(
way(r)["maritime" != "yes"]({{bbox}});
way(area.country)["natural"="coastline"]({{bbox}});
);
out geom;
tres.14159
  • 850
  • 1
  • 16
  • 26
  • From this one can generate a polygon, however it isn't that trivial for all countries, such as the US or Canada. This CLI tool could help on those cases https://github.com/TimMcCauley/nintynine-boundaries – Timothy Dalton May 21 '22 at 21:17
0

You could try to use a dedicated relation for Península ibérica instead:

relation
  ["wikidata"="Q12837"];
(._;>;);
out body; 
mmd
  • 3,423
  • 1
  • 16
  • 23