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

How to obtain all members of a relation that lack a specific key?

1

I would like to extract, with Overpass Turbo, all members of a specific route relation that do not have a specific key (in my case, all ways that lack a surface tag).

asked 29 Sep '15, 16:08

voschix's gravatar image

voschix
6344
accept rate: 0%

edited 29 Sep '15, 20:19

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554


One Answer:

7

We had the exact same question in the German forum thread "OverpassTurbo for Dummies" .

Here's how query should look like. Please adjust the relation id selection as needed.

relation(398874);way(r)[surface!~"."];out;>;out skel;

Try it in Overpass Turbo: http://overpass-turbo.eu/s/bJg

answered 29 Sep '15, 17:28

mmd's gravatar image

mmd
5.7k15388
accept rate: 37%

edited 29 Sep '15, 17:31

that's great - I often thought about the same! … And how to get a refinement of this? e.g. only tracks when searching for existence of tracktype? ;-) I tried relation(398874);way(r)["highway"="track"][tracktype!~"."];out;>;out skel; but that runs much much longer (until I cancel).

(29 Sep '15, 20:29) aseerel4c26 ♦
3

That's also possible with QL, but the query needs to be rewritten a bit due to a very expensive evaluation sequence:

relation(398874);way(r);way._["highway"="track"][tracktype!~"."];out;>;out skel;

(29 Sep '15, 20:47) mmd
1

great, thanks! I think this kind of refinement is often useful for those queries. I need to learn this language! :-)

(29 Sep '15, 21:19) aseerel4c26 ♦