This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

How to query for adjacent admin boundaries?

0

After hours of internet sleuthing and more-error-than-trials on overpassturbo, I admit defeat and ask for help. Here's the thing: I'd like to..

  1. take a given coordinate as input
  2. get its corresponding administrative boundary (admin_level=6) node
  3. to (2), give me all adjacent (as in: bordering on) admin boundaries

Any idea how this could be accomplished? I found the "around" clause but couldn't get it to work either.

Any help is greatly appreciated!

asked 05 May '21, 15:34

supyall's gravatar image

supyall
11112
accept rate: 0%

1
  1. Check out the 'is_in' command. 3. admin_level boundaries should be all relations so 'recurse' back up from your found boundary to the ways it's attached to & search those ways to see if it has any other associated relations.
(05 May '21, 16:20) DaveF

Thanks for the tip, but I'm a bloody noob on the whole OSM thing. Would you (are anyone else watching) be willing to write some example code (overpass would be best for testing purpose) on this?

(06 May '21, 08:58) supyall

Source code available on GitHub .