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

Surrounding place for polygon

0

Hi, considering the following use case, what would be the best way to get the correct result in overpass?

Given a polygon that a user draws on a map, I'm trying to find the places (node[place~"^(city|town|village|hamlet)$"];):

  1. Places (city, town, village, hamlet) inside the polygon
  2. The surrounding place in case the polygon is inside the boundaries of a place
  3. The nearest place in case there are no places inside the polygon and the polygon isn't inside the boundaries of a place

Is there a way to get these results?

Kind regards,

Daniel

asked 09 Jul '20, 18:35

yngwi's gravatar image

yngwi
11112
accept rate: 0%

Source code available on GitHub .