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

Overpass turbo: extract all relation members with specific tags

0
1

How to extract, from a bicycle route relation, all way-type members that are roads of type unclassified and higher and that do not have maxspeed tags

asked 11 Sep '21, 13:41

voschix's gravatar image

voschix
6344
accept rate: 0%

1

Show us your routine as it is at the moment.

(11 Sep '21, 15:32) DaveF

I have no routine at the moment. I would like to create a new one. I would like to complete the maxspeed information on cycle routes were these run on public roads.

(11 Sep '21, 21:15) voschix

Why not have an attempt? Expecting others to do the /whole/ job for you is a bit selfish.

(13 Sep '21, 14:35) DaveF

2 Answers:

1

Let's assume your bicycle route relation is within a set called "bike". Then, overpass turbo will provide you with all way-type members if you query for "way(r.bike)". Here, you can apply any filters you want, e.g. "way(r.bike)[highway=unclassified][!maxspeed]".

Here, an example which has one additional step to only search in the displayed area ("bbox"): https://overpass-turbo.eu/s/1b88

Good luck!

answered 13 Sep '21, 14:18

G%C3%A5seborg's gravatar image

Gåseborg
31171016
accept rate: 50%

Thanks. This is precisely what I needed.

(16 Sep '21, 16:57) voschix

@voschix: Good! Then, you could mark this question as answered, by "accepting" the answer (https://help.openstreetmap.org/questions/34318/how-to-mark-an-answer-as-accepted-and-mark-my-question-as-answered/34319) in order to avoid other people to check whether it still needs to be answered.

(30 Sep '21, 12:51) Gåseborg

I have marked it as accepted.

(30 Sep '21, 13:26) scai ♦

1

Taking @Gåseborg answer & shrinking it to save on the typing:

rel[route=bicycle]({{bbox}});
way(r)[highway~"unclassified|tertiary|secondary|primary|trunk|motorway"][!maxspeed];
out geom;

answered 30 Sep '21, 16:31

DaveF's gravatar image

DaveF
3.3k8498133
accept rate: 16%

Source code available on GitHub .