2

I want to find all ways in a specified search area that contain a specific Node in overpass turbo.
To give a precise example, I want to find all place=islet ways in the name=Dalsland region that contain a amenity=shelter node.

Selecting all the islets and or shelters is easy:

[out:json][timeout:20];
relation["name"="Dalsland"]; map_to_area -> .searchArea;
// node["amenity"="shelter"](area.searchArea);
way["place"="islet"](area.searchArea);
(._;>;);
out skel qt;

But how would I use these to filter the islets?

1 Answer 1

2

You can use the islet ways as an area filter in a subsequent node query statement:

relation["name"="Dalsland"];
map_to_area -> .searchArea;
way["place"="islet"](area.searchArea);
out geom;
node(area)[amenity=shelter];
out qt;

Or just the islets with shelters on them:

relation["name"="Dalsland"];
map_to_area -> .searchArea;
way["place"="islet"](area.searchArea)->.areas;
foreach .areas -> .area {
  node(area.area)[amenity=shelter];
  if (count(nodes) > 0) {
    (.area;.results;)->.results; 
  }
}
.results out geom;
2
  • I see. Technically, this will give me the shelters on small islands instead of the small islands with shelters, but for my use case this will be just as good. thanks Commented May 23 at 8:33
  • That's also possible, I added a second query to the answer that returns just the islands. Commented May 24 at 17:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.