NOTICE: is being shutdown on 1st March 2024. Please use the OpenStreetMap Community Forum

Can I use Overpass-API to get all administrative entities enclosing (partially or completely) an object. i.e. I have a wood like Sarghai ( 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's gravatar image

accept rate: 25%


Have a read up of 'is_in'

(08 Apr '20, 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 '20, 17:47) Ogmios

// All boundaries enclosing an entity (forest)
out geom;
out geom;

permanent link

answered 08 Apr '20, 18:05

DaveF's gravatar image

accept rate: 16%

edited 08 Apr '20, 18:23

Great, thanks.

(08 Apr '20, 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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 08 Apr '20, 10:37

question was seen: 1,148 times

last updated: 08 Apr '20, 20:01

NOTICE: is being shutdown on 1st March 2024. Please use the OpenStreetMap Community Forum