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, 10:37

Ogmios's gravatar image

Ogmios
721192438
accept rate: 25%

1

Have a read up of 'is_in'

(08 Apr, 12:04) DaveF

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;

(08 Apr, 17:47) Ogmios

// All boundaries enclosing an entity (forest)
way(475130161);
out geom;
(._;>;);
is_in;
rel(pivot)[boundary];
out geom;

https://overpass-turbo.eu/s/SAZ

permanent link

answered 08 Apr, 18:05

DaveF's gravatar image

DaveF
1.5k576784
accept rate: 7%

edited 08 Apr, 18:23

Great, thanks.

(08 Apr, 20:01) Ogmios
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×382
×54

question asked: 08 Apr, 10:37

question was seen: 175 times

last updated: 08 Apr, 20:01

powered by OSQA