Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Routing bikes on oneway roads in the wrong direction #4943

Closed
chaupow opened this issue Mar 8, 2018 · 5 comments
Closed

Routing bikes on oneway roads in the wrong direction #4943

chaupow opened this issue Mar 8, 2018 · 5 comments

Comments

@chaupow
Copy link
Member

chaupow commented Mar 8, 2018

Sometimes we will route bikes on a oneway street in the wrong direction.

  • Example request is /route/v1/driving/-73.98244857788086,40.755319574776024;-73.999958,40.736072?overview=false&alternatives=true&steps=true where we route down 6th Ave in the wrong direction

screenshot 2018-03-08 17 03 23

  • Looking at debug tiles shows that we use 15km/h speed in both directions on 6th Ave

screenshot 2018-03-08 16 55 28

  • OpenStreetMap tags this road as
    • oneway=yes
    • cycleway:left=track

Problem:

  • the profile will first correctly identify the oneway and tag it as mode.inaccessible here
  • afterwards the profile will check if there are cycleways and if there is a cycleway on the left/right side assume that the road is cyclable backwards/forwards here
  • oneways that have cycleways on the left side to cycle the way in forward direction are now handled as if they are cyclable in backward direction

Problem description in other words:

a -------------------> b
  • When there is a cycleway on the left side of a road (left when looking a -> b), we assume that we can ride the bike when riding from b > a
  • Even if a > b is a oneway we still think we can do that
  • This is not true for 6th in New York: the cycleway is on the left side but it is not for riding b > a but a > b

Solution

  • don't set roads as cyclable regardless of cycleway if they were marked as inaccessible before.
@emiltin
Copy link
Contributor

emiltin commented Mar 9, 2018

This is by design. A cycleway in the left side of the road (ie. in the opposite direction) indicates that you're allowed to cycle against the normal oneway flow. Whereas a track in the right side of the road is in the direction of the oneway, so nothing indicates you're allowed to go against the oneway flow on a bike.
That said it's a question whether we wan't to be strict and require oneway:bicycle=false.

@emiltin
Copy link
Contributor

emiltin commented Mar 9, 2018

@chaupow
Copy link
Member Author

chaupow commented Mar 9, 2018

@emiltin the wiki link you provided says

A contraflow cycle lane on the left side of a one-way street. Tagging: cycleway:left= opposite_lane + oneway=yes (indicates the oneway-motorcar-lane)

In that sentence ^ it is tagged as opposite_lane. The example in New York is only tagged cycleway:left=track not cycleway:left=opposite_track and we still consider it a two-way roads for bikes. So I think it is a bug and not by design 🤔 Do I miss something?

The given example is a one-way, where it is also a one-way for bikes BUT the track for the bikes are on the left side.

Track wiki also says

In the case of a one-way road, cycleway=track can be used when there is:
a one-way cycle track operating in the same direction as the main traffic flow, or
a two-way cycle track (also tag the way with oneway:bicycle=no).

As for implicite indication of cycleway_left:

This is by design. A cycleway in the left side of the road (ie. in the opposite direction) indicates that you're allowed to cycle against the normal oneway flow.

I can't find it in the wiki at least. (I know real-world tagging is not always equal to the wiki 🙈)
Wiki also says:

Consider using cycleway:left=track and/or cycleway:right=track instead, relative to the direction in which the way was drawn in the editor, as these tags further indicate on which side of the road the cycle track is located.

This sounds more like left/right indicate where the track is located, not saying anything about the direction.

If you want to consider both sides,

  • opposite or
  • oneway:bicycle=no

seems to be the correct way to indicate that this is not a one-way for bikes.

Do you know any cases where a change of not considering cycleway_left on one-way roads as a two-way roads for bikes will break correct routing?

Can you either check whether #4944 breaks those cases or provide me with some hints, then I can check the behaviour of the PR 🤗

@chaupow
Copy link
Member Author

chaupow commented Mar 9, 2018

Cycleways confuse me. Is this a summary we can agree on?

  • The example route is not a good route
  • We need to figure out whether this is a data problem or a bike profile bug
  • Question is: Does a cycleway in the left side of the road on a one-way road indicate that the road is a two-way for bikes?
    • If yes: Data problem (what would be the correct tagging?)
    • If no: Profile bug (is the PR the bug fix?)

@chaupow
Copy link
Member Author

chaupow commented Mar 9, 2018

[Investigation] Routing on cycleways with OSRM

The tag cycleway is used to map cycling infrastructure that is an inherent part of the road

source

The bike profile of OSRM supports (source)

'track',
'lane',
'opposite',
'opposite_lane',
'opposite_track',
'share_busway',
'sharrow',
'shared',
'shared_lane'

OSRM sets the forward and backward mode of ways with cycleways to mode.cycling and its speed to profile.bicycle_speeds["cycleway"] if there is a cycleway going forward or backward. (source)

"Normal" Roads that are not a one-way road

  • cycleway=lane indicates there is a cycleway going forward and backward
    • (source)

      cycleway=lane is used to tag two-way streets where there are cycle lanes on both sides of the road

  • cycleway:right=lane indicates there is a cycleway goingforward
  • cycleway:left=lane indicates there is a cycleway going backward

    Consider using the cycleway:left=lane and / or cycleway:right=lane tags instead for a cycle lane which is on the left and / or right side, [...], as this describes on which side the cycle lane is. It should then be assumed that cycle traffic is allowed to flow in the customary direction for traffic on that side of the road

  • cycleway=share* seem to follow the same rules as lane as stated above (source)
  • cycleway=track seem to follow same rules as lane as stated above (source)

One-way Roads

  • cycleway=lane indicates there is a cycleway going forward and not backward
    • (source)

      cycleway=lane is used to tag [...] one-way streets where there is a lane operating in the direction of main traffic flow

  • cycleway:right=lane indicates there is a cycleway goingforward and not backward
  • cycleway:left=lane indicates there is a cycleway going forward and not backward

    Consider using the cycleway:left=lane and / or cycleway:right=lane tags instead for a cycle lane which is on the left and / or right side, [...], as this describes on which side the cycle lane is. It should then be assumed that cycle traffic is allowed to flow in the customary direction for traffic [...] (which, for oneway=yes roads, is the same on both sides and in agreement with the motorised traffic).

  • cycleway=opposite_lane indicates there is a cycleway going backward
    • (source)

      Use cycleway=opposite_lane for a contraflow cycle lane, that is, a cycle lane travelling in the opposite direction to other traffic

  • cycleway=opposite indicates there is a cycleway going forward and backward
    • (source)

      Use cycleway=opposite for situations where cyclists are permitted to travel in both directions on a road

  • cycleway=opposite_track indicates there is a cycleway going backward
    • (source)

      Use cycleway=opposite_track for a contraflow cycle track, that is, a cycle track travelling in the opposite direction

  • cycleway:right=opposite_track indicates there is a cycleway going backward
  • cycleway:left=opposite_track indicates there is a cycleway going backward
    • (source)

      Use cycleway=opposite_track for a contraflow cycle track [...]. Consider using the cycleway:left=opposite_track or cycleway:right=opposite_track tags instead, as this describes on which side the contraflow track is.

❗️

As for this issue, what matters should be

Consider using the cycleway:left=lane and / or cycleway:right=lane tags instead for a cycle lane which is on the left and / or right side, [...], as this describes on which side the cycle lane is. It should then be assumed that cycle traffic is allowed to flow in the customary direction for traffic [...] (which, for oneway=yes roads, is the same on both sides and in agreement with the motorised traffic).

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants