Shohreh
(Shohreh)
June 23, 2017, 11:53am
#1
Hello,
I’d like to query OSM to find all the bicycle contraflow lanes in one-way streets in a given city.
I used the following, which seems to work but I wanted to double-check that I’m not missing some:
[out:json][timeout:25];
{{geocodeArea:"SomeCity"}}->.a;
(
node["cycleway"="opposite_lane"]["oneway"="yes"](area.a);
way["cycleway"="opposite_lane"]["oneway"="yes"](area.a);
relation["cycleway"="opposite_lane"]["oneway"="yes"](area.a);
);
out body;
>;
out skel qt;
Thank you.
muralito
(Muralito)
June 23, 2017, 1:02pm
#2
I think you should also consider oneway=-1 or make sure that this value does not exist in the area.
PHerison
(P Herison)
June 23, 2017, 1:18pm
#3
You may also want to concider to include “cycleway=opposite ”
Shohreh
(Shohreh)
June 23, 2017, 3:15pm
#4
Thanks. What does “oneway=-1” do, and how could I query “cycleway=opposite_lane”, “cycleway=opposite”, “cycleway:left=opposite_lane”, and “cycleway:left=opposite” in one go?
muralito
(Muralito)
June 23, 2017, 5:41pm
#5
escada
(Escada)
June 24, 2017, 6:02am
#6
way"cycleway"~“opposite|opposite_lane” ;
allows you to search for both opposite and opposite_lane in 1 go
You have to use the union operator “(” “)” for the cycleway:left part
so
[out:json][timeout:25];
// gather results
(
way"cycleway:left"~“opposite|opposite_lane”
;
way"cycleway"~“opposite|opposite_lane” ;
);
// print results
out body;
;
out skel qt;
Shohreh
(Shohreh)
June 25, 2017, 9:16am
#7
Thanks much.
I’ll add “opposite_track” to include contraflows that have a hard separation with incoming traffic.