Overpass question

Is it possible to query “barrier=cycle_barrier” that are nodes AND part of a highway=cycleway?

Thanks in advance?

Please have a look at http://overpass-turbo.eu/s/ab5 :

 node[barrier=cycle_barrier]->.n; 
 way(bn.n)[highway=cycleway]; 

This delivers the ways that contain a barrier. Because we want the nodes instead, we need to get back to them:

 node.n(w); 

The “and” happens here between the already before found nodes (in “.n”) and all nodes of the just found ways. In principle, a standard tag condition instead of the set would have done the same here, but reusing the result from above is faster.

The final query is in addition restricted by a bounding box, because the query would run too long all worldwide and produce too much results.

Best regards,
Roland

Thanks Roland

This works great. I’ve now made a query that retrieves :

“barrier=cycle_barrier” that are nodes AND (part of a (“highway=footway” OR “highway=path”) that have a “bicycle=designated”)

This offers a lot more possibilities for this (test) map.

I hope overpass will be fast enough to make it work properly for more complex queries. We’ll see. :slight_smile:

I have another question. I’ve tried several things but nothing seems to work.

I want to retrieve all ways [amenity=parking] that are within the areas (ways) that are in a relation. It is this relation.

I found this example and tried to tweak it to my specific goal. The example with parking places in Overpass turbo is here.

My version does not return any parking lots even though there are some present in the area.
Any Idea what I do wrong?

This seems to do the trick. If I change the word “way” with “node” I get the nodes too. Now my next quest is to combine these 2.

You just need a pair of parentheses. http://osmlab.github.io/learnoverpass/en/docs/block-queries/union/

It seems so easy but I can not get it to work. How do I combine the [amenity=bench] & [tourism=picnic_site] for this area?

Try this one: http://overpass-turbo.eu/s/aqB


area["name"="Den Treek Henschoten"]({{bbox}})->.a;
( node(area.a)[amenity=bench];
  node(area.a)[tourism=picnic_site];
);
out;

You can also use the wizard in overpass turbo:

(amenity=bench or tourism=picnic_site) and type:node in “Den Treek Henschoten”

Thanks a lot. The tip to use the wizard is also helpfull. I was not aware of this handy assistent.

Cheers PeeWee32