Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Routing up a one way street. #743

Open
bartp06 opened this issue Nov 20, 2024 · 2 comments
Open

Routing up a one way street. #743

bartp06 opened this issue Nov 20, 2024 · 2 comments

Comments

@bartp06
Copy link

bartp06 commented Nov 20, 2024

Hello! I encountered an issue with routing, I was routed up a one-way street without contraflow for cyclists.
Please see the attachment:
obraz

I checked the tags in OSM and they seem correctly mapped to me, the affected segment has the oneway=yes tag, while the others up north indeed have a oneway:bicycle=no tag.

Here is the osm tag of the affected way 945735356.

As well as a brouter link with the way in frame for testing. https://brouter.de/brouter-web/#map=19/52.22313/21.00875/standard&lonlats=21.01558,52.212268

Thank you for reading through!

@jakobwalter
Copy link

jakobwalter commented Dec 2, 2024

The routing works correctly as far as I can tell. You will just need to adjust the penalties. For example the trekking profile:

assign onewaypenalty =
       if ( badoneway ) then
       (
         if      ( cycleway=opposite|opposite_lane|opposite_track       ) then 0
         else if ( cycleway:left=opposite|opposite_lane|opposite_track  ) then 0
         else if ( cycleway:right=opposite|opposite_lane|opposite_track ) then 0
         else if ( oneway:bicycle=no                         ) then 0
         else if ( cycleway:left:oneway=no                   ) then 0
         else if ( cycleway:right:oneway=no                  ) then 0
         else if ( junction=roundabout|circular              ) then 60
         else if ( highway=primary|primary_link              ) then 50
         else if ( highway=secondary|secondary_link          ) then 30
         else if ( highway=tertiary|tertiary_link            ) then 20
         else 4.0
       )
       else 0.0

The street in question is residential, so the added one-way penalty is just 4. If you change this to 10 you will not go through the one-way street anymore.

@maciejs
Copy link

maciejs commented Dec 4, 2024

I believe that this is not handled properly. The assumption of such a low penalty is explained by the comment posted above the cited calculation:

#
# handle one-ways. On primary roads, wrong-oneways should
# be close to forbidden, while on other ways we just add
# 4 to the costfactor (making it at least 5 - you are allowed
# to push your bike)
#

BUT, in this case it is not true, because it is not allowed to walk on this segment (because when there is a sidewalk it is obligatory to use it), so it is also not allowed to push a bicycle against traffic. In this case, the penalty should be calculated as for the forbidden segment, to possibly redirect the cyclist to the sidewalk, where it is allowed to push the bike.

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

No branches or pull requests

3 participants