1

I am trying to write a query to get all bike lanes to display on a map for my project. I want to display all types of bike lanes(shared ,dedicated,tracks etc)

[out:json][timeout:25];
// gather results
(
  // query part for: “cycleway=*”

  // sharrow
  way["cycleway"="shared_lane"]({{bbox}} ) ;

  // CONVENTIONAL BICYCLE LANE
  // lane on both sides of the street
  way["cycleway"="lane"]({{bbox}});

  // lane on either side
  way["cycleway:left"]({{bbox}});
  way["cycleway:right"]({{bbox}});


  // dedicated bikeways
  way["highway"="cycleway"]({{bbox}});

  way["bicycle"="designated"]({{bbox}});



);
out body;
>;
out skel qt;

Am I missing some parameters because I am not getting the same map as open cycle maps. I understand that the open cycle maps is displaying cycling routes as well. So I added the parameter

relation["route"="bicycle"]({{bbox}});

But I am not very sure about what a relation is. Also it gives a lot of overlapping paths. Are all bile paths covered under a relation? Also from my understanding, this relation also has routes which would not necessarily go through a bike path. Coming back to my original question, are there any other parameters that I can add to my query to get all bike paths?

5

2 Answers 2

1

I would suggest using relation in place of way. It seems to replicate opencyclemap but best to check and modify as required.

[out:json][timeout:25];
// gather results
(
  // query part for: “cycleway=*”

  // sharrow 
  relation["cycleway"="shared_lane"]({{bbox}} ) ;

  // CONVENTIONAL BICYCLE LANE
  // lane on both sides of the street 
  relation["cycleway"="lane"]({{bbox}});  

  // lane on either side 
  relation["cycleway:left"]({{bbox}});
  relation["cycleway:right"]({{bbox}});  


  // dedicated bikeways
  relation["highway"="cycleway"]({{bbox}});
  relation["bicycle"="designated"]({{bbox}});  
  
  // addition *route
  relation["route"="bicycle"]({{bbox}});


);
out body;
>;
out skel qt;
1

You can check https://www.cyclosm.org/ for bicycle lanes. CycleOSM uses https://github.com/cyclosm/cyclosm-cartocss-style/blob/master/taginfo.json as the tags that get included.

For checking how it gets rendered:

You can search for "bicycle" and figure it out ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.