abrensch / brouter

configurable OSM offline router with elevation awareness, Java + Android
MIT License
490 stars 118 forks source link

Problem with roundabout on some bike profiles #485

Closed afischerdev closed 1 year ago

afischerdev commented 1 year ago

In the experiments with Dreieich I found an issue on roundabout in some bike profiles. Very short way.

An increase of 'onewaypenalty' could help I think.

Please have a look here and play around with the other profiles.

BTW: do we have something like a notice 'use at your own risk'?

EssBee59 commented 1 year ago

Hello,

Very good issue! (I opened a similar issue in the past about "assign considerTurnRestrictions" that shoul be set to "true")

Using my own profile (fastbike-verylowtraffic) the routing is ok! http://brouter.de/essbee/#map=19/50.00048/8.70227/osm-mapnik-german_style&lonlats=8.700753,50.000704;8.702245,50.000664

The tags in the critical roundabout part are: reversedirection=yes highway=residential maxspeed=30 junction=roundabout route_bicycle_lcn=yes

My profile use the logic below, and the cost ($/km) would be = 7700 in the part of reverse direction, so the right way is calculated !

assign badoneway = if reversedirection=yes then if oneway:bicycle=yes then true else if oneway= then junction=roundabout else oneway=yes|true|1 else oneway=-1

assign onewaypenalty = if ( badoneway ) then ( if ( cycleway=opposite|opposite_lane|opposite_track ) then 0 else if ( oneway:bicycle=no ) then 0 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 6.0 ) else 0.0

zod commented 1 year ago

An increase of 'onewaypenalty' could help I think.

The oneway penalty assumes that you are allowed to walk in the wrong direction. I think for fastbike this assumptions is wrong, because all the road bikers I know would rather ride triple distance instead of walking.

My profile use the logic below, and the cost ($/km) would be = 7700 in the part of reverse direction, so the right way is calculated !

That code seems identical to the normal fastbike. I guess we need slightly different parameters.

quaelnix commented 1 year ago

An increase of 'onewaypenalty' could help I think.

Yes, I would probably solve it like this:

assign onewaypenalty =
         ...
         else if ( oneway:bicycle=no                         ) then 0
         else if ( junction=roundabout                       ) then 60
         else if ( highway=primary|primary_link              ) then 50