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

How to find nodes within ways in Overpass QL?

0

I have a query which returns a number of ways. I want to find nodes matching certain criteria which appear within those ways. Note that the nodes I'm interested in do not form part of the way itself, but do appear within the bounds of the way. Also, the ways do not all have corresponding areas, so using the area search doesn't work in all cases.

I've got a minimal example which finds way 95677318, and I want to be able to find node 1552949334:

(
  way({{bbox}})["man_made"="lighthouse"];
)->.searchArea;

/*doesn't work:*/
/*node(area.searchArea)["seamark:name"];*/

/*recur down and find node directly, just for the purpose of this question*/
(
  .searchArea;>;
  node({{bbox}})["seamark:name"];
);
out;

(Try it on https://overpass-turbo.eu/s/EpV)

asked 17 Dec '18, 12:27

tstibbs's gravatar image

tstibbs
11112
accept rate: 0%

Source code available on GitHub .