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

query nodes by attributes of connected ways

0

I'm am trying to extract a set of nodes that represent signalized intersections with bike infrastructure leading into them.

the trouble I have run into is that I don't think there is a way to query nodes according to the attributes of the ways that connect to them.

Is that correct? If it is I can download the data and run the query as a join on the to and from OSM_ID's of the way in postgres. this will be fairly time consuming though so i wanted to first check and see whether anyone had a way to do this in overpass or overpass turbo.

thanks for any and all suggestions.

edit: I can query nodes and ways separately in overpass turbo using:

node [highway=traffic_signals] ({{bbox}}); out; way [bicycle=designated] ({{bbox}}); out;

but my goal is to return the subset of that query that is nodes connected to a line where bicycle=designated.

asked 03 Jun '21, 13:09

hughkelley's gravatar image

hughkelley
16111
accept rate: 0%

edited 03 Jun '21, 14:06

Post a link to an example. What code have you got at the moment?

(03 Jun '21, 13:48) DaveF

edited to include example illustrating what is not useful to me. is the question not clear?

(03 Jun '21, 14:07) hughkelley

One Answer:

1

You need to recurse down from the ways to find the appropriate child nodes.

[bbox:{{bbox}}];
way[bicycle=designated];
node(w)[highway=traffic_signals];
out center;

answered 03 Jun '21, 15:37

DaveF's gravatar image

DaveF
3.3k8498133
accept rate: 16%

Source code available on GitHub .