[SOLVED] [OverpassTurbo] Right way to query OSM for contraflows?

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.

I think you should also consider oneway=-1 or make sure that this value does not exist in the area.

You may also want to concider to include “cycleway=opposite

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?

https://wiki.openstreetmap.org/wiki/Key:oneway

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;

Thanks much.

I’ll add “opposite_track” to include contraflows that have a hard separation with incoming traffic.