You are not logged in.

#1 2015-06-27 16:08:19

PeeWee32
Member
From: Leusden, NL
Registered: 2010-11-28
Posts: 1,156
Website

Overpass question

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

Thanks in advance?

Offline

#2 2015-06-29 19:04:12

drolbr
Member
Registered: 2013-05-12
Posts: 54

Re: Overpass question

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

PeeWee32 wrote:

Is it possible to query "barrier=cycle_barrier" that are nodes

 node[barrier=cycle_barrier]->.n; 
PeeWee32 wrote:

AND part of a highway=cycleway?

 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

Offline

#3 2015-06-30 19:34:22

PeeWee32
Member
From: Leusden, NL
Registered: 2010-11-28
Posts: 1,156
Website

Re: Overpass question

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. smile

Offline

#4 2015-07-11 09:58:48

PeeWee32
Member
From: Leusden, NL
Registered: 2010-11-28
Posts: 1,156
Website

Re: Overpass question

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?

Offline

#5 2015-07-12 18:58:45

PeeWee32
Member
From: Leusden, NL
Registered: 2010-11-28
Posts: 1,156
Website

Re: Overpass question

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.

Offline

#6 2015-07-12 21:51:23

muralito
Member
Registered: 2012-09-04
Posts: 1,848

Re: Overpass question

You just need a pair of parentheses. http://osmlab.github.io/learnoverpass/e … ies/union/

Last edited by muralito (2015-07-12 21:51:38)

Online

#7 2015-07-14 05:58:55

PeeWee32
Member
From: Leusden, NL
Registered: 2010-11-28
Posts: 1,156
Website

Re: Overpass question

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

Offline

#8 2015-07-14 18:35:04

mmd
Member
Registered: 2010-11-06
Posts: 1,771

Re: Overpass question

PeeWee32 wrote:

It seems so easy but I can not get it to work. How do I combine the node[amenity=bench] & node[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"

Last edited by mmd (2015-07-14 18:38:04)

Offline

#9 2015-07-14 19:24:05

PeeWee32
Member
From: Leusden, NL
Registered: 2010-11-28
Posts: 1,156
Website

Re: Overpass question

mmd wrote:
PeeWee32 wrote:

It seems so easy but I can not get it to work. How do I combine the node[amenity=bench] & node[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

Offline

Board footer

Powered by FluxBB