Routing up a one way street.
Hello! I encountered an issue with routing, I was routed up a one-way street without contraflow for cyclists.
Please see the attachment:
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!
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.
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.