osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.61k stars 1.01k forks source link

OsmAnd takes longer route than before #13505

Open xandro0777 opened 2 years ago

xandro0777 commented 2 years ago

🐞 routing report

Routing engine

Routing Profile

Car

Start and end points

start point : https://www.openstreetmap.org/#map=17/49.88313/10.90999

end point : https://www.openstreetmap.org/#map=17/49.87914/10.92658

Actual and expected routes

actual route: https://graphhopper.com/maps/?point=49.883409%2C10.908909&point=49.887501%2C10.921183&point=49.879759%2C10.925817&locale=en-US&elevation=true&profile=car&use_miles=false&selected_detail=Elevation&layer=Omniscale

expected route: https://graphhopper.com/maps/?point=49.883409%2C10.908909&point=49.879759%2C10.925817&locale=en-US&elevation=true&profile=car&use_miles=false&selected_detail=Elevation&layer=Omniscale

Is this a regression?

yes, possibly triggered by a change in OSM data. Someone (probably wrongly) downgraded Forchheimer str from primary to tertiary https://www.openstreetmap.org/changeset/85454316

Nevertheless if I "block" (avoid road) the "wrong" route OsmAnd takes the "better"route through Forchheimer str and displays a 3 min shorter time!

So in this case OsmAnd should imho "ignore" that the road is tertiary - the time difference is just too much, the road has two lanes, less traffic signals etc..

The highway classification should not weigh that much when details of the road like speed limit, number of lanes, turn lanes, traffic lights are all well known.

OsmAnd Version: 4.0.9 from F-droid

Device and Android/iOS version:

Maps used (online or offline):

vshcherb commented 2 years ago

It's not an OsmAnd regression but rather OSM regression. So it's not clear whether it will be fixed in OsmAnd or not.

xandro0777 commented 2 years ago

The problem seems to be giving too much weight to the primary/secondary/tertiary distinction. In this particular example OsmAnd even computes that the more direct route is much faster - and still uses the other one that is almost twice as long.

Using highway classification for routing purposes is helpful in poorly mapped regions but of limited value in Germany.

Looking at German wiki, https://wiki.openstreetmap.org/wiki/Attributierung_von_Stra%C3%9Fen_in_Deutschland the highway types primary to tertiary should be equivalent for routing purposes if other attributes (maxspeed, lanes..) are known and match. In fact the wiki says tertiary roads are less busy than secondary or primary which might sometimes imply a small advantage for them.

In Germany I would consider the following scheme for normal cars:

Countryside:

Urban:

Things are a bit different for heavy goods vehicles, tertiary roads and even more unclassified roads should probably get some handicap intersections and many other details tend to be less HGV friendly.

vshcherb commented 2 years ago

Yes, the route is longer by 700 m but it uses the same road and doesn't cut it. Please take a look it uses same road priority with same road ref i.e. it's structurally designed to be used even though there is a shortcut and probably it's faster but from top-view perspective it doesn't look better.

BTW OsmAnd has a special penalty by going from higher priority road to lower so in that case it's used. It was designed exactly to not use shortcuts, though it's first time I see such a long shortcut (700 m), the time diff though < 1 min

xandro0777 commented 2 years ago

The time diff can be very noticeable, there are 2 more traffic lights on the longer way.

OsmAnd for me displays 3min difference in favor of the shorter route? Even 1 min difference would be a lot for that distance.

In this particular case the shortcut prevention is not so good. The length, together with the 2 extra traffic lights should add enough to compensate the shortcut penalty?

Also would definitely like to try an option to treat primary/secondary/tertiary as identical.

At times of heavy traffic I frequently prefer unclassified backroads.

Farzat07 commented 3 months ago

It was designed exactly to not use shortcuts

Why though? I mean sometimes shortcuts lead to more time loss because of the extra turns and the possibly slower speeds in the shortcut road, but when a traffic light is avoided a shortcut is almost definitely faster.

vshcherb commented 3 months ago

You can experiment now on https://osmand.net/map/ web version to see "Cost", OsmAnd creates route with minimal cost. So it might give explanation what & how prioritized