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

Overpass : id-query with has-kv ?

0

Is it possible to combine an id-querywith some sort of has-kv ?

< osm-script>
   < id-query ref="3300434" type="relation" />
   < recurse type="relation-relation" />  
   < recurse type="relation-relation" />  
   < recurse type="relation-node" />  
< print/>
< /osm-script>

I have this code which list each nodes of a transport network. I'd like to get only the ones with < tag k="public_transport" v="stop_position"/> and not the ones with < tag k="public_transport" v="platform"/>

asked 12 Feb '14, 11:49

Kyro's gravatar image

Kyro
1216713
accept rate: 0%


One Answer:

4

Yes, you can wrap a clause with a <query>-tag to do further filtering:

…
<query type="node">
  <recurse type="relation-node" />
  <has-kv k="public_transport" v="platform" />
</query>
…

http://overpass-turbo.eu/s/2uI

answered 12 Feb '14, 12:05

tyr_asd's gravatar image

tyr_asd
1.2k51927
accept rate: 64%

edited 12 Feb '14, 12:05

1

That's it, thanks !

(12 Feb '14, 12:07) Kyro

Source code available on GitHub .