Can I use Overpass-API to get all administrative entities enclosing (partially or completely) an object. i.e. I have a wood like Sarghai (https://www.openstreetmap.org/way/475130161) and I want to know that it lies at least partially within a national park (Nationalpark Harz) and Harz (LK Goslar) administrative boundaries and lower saxony. Best case would be a Overpass-API script where I can give a Node, Way or Relation and receive all enclosing administrative entities. asked 08 Apr '20, 10:37 Ogmios |
Have a read up of 'is_in'
Thanks DaveF, that was helpful. I just have to figure out how to use a node/way/rel instead of a coordinate but so far it works well:
[out:csv(::id, name)][timeout:25]; ( is_in(51.70785, 10.45692)->.a; / * boundary=national_park = Nationalpark * boundary=protected_area = Naturschutzgebiet * boundary=administrative = Landrkeise, Länder etc. / area.a ["boundary"~"national_park|protected_area"] ->.b;
area.a ["boundary"="administrative"] ["admin_level"!="2"] ->.c;
rel(pivot.b)->.b; rel(pivot.c)->.c; ); .b out geom; .c out geom;