osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.68k stars 1.02k forks source link

Allow U-Turns based on turn:lanes reverse #15356

Open rKsanu2MMYvypWePtQWM opened 2 years ago

rKsanu2MMYvypWePtQWM commented 2 years ago

🐞 routing report

Routing engine

Routing Profile

Car

Start and end points

54.91344N 23.91167E to 54.91188N 23.90998E and 54.91775N 23.91262E to 54.91695N 23.91307E

Actual and expected routes

1st option has a dedicated U-turn point under the bridge (has one of the turn:lanes tagged as "reverse" as an indication) 2nd option is just a regular intersection with a left turn so it should see that a U-turn is possible

Is this a regression?

Unknown ## 🌍 Your Environment **OsmAnd Version:**

4.2.7 Android
**Device and Android/iOS version:** 12 LineageOS **Maps used (online or offline):**

Anything else relevant? Perhaps OsmAnd looks for different tags to do a U-turn?

Zirochkabila commented 2 years ago

Reproduced

1st example https://www.openstreetmap.org/directions?engine=fossgis_osrm_car&route=54.91334%2C23.91165%3B54.91179%2C23.90992#map=17/54.91298/23.91156 correct route - 478 m https://osmand.net/map?start=54.913503%2C23.911690&end=54.911896%2C23.909973&mode=car#17/54.91448/23.91061 incorrect - 2.4 km, cost 352

2d example https://www.openstreetmap.org/directions?engine=fossgis_osrm_car&route=54.91827%2C23.91313%3B54.91725%2C23.91308#map=17/54.91739/23.91283 correct, (not sure) - 552 m https://osmand.net/map?start=54.917727%2C23.912666&end=54.916931%2C23.913063&mode=car#16/54.9156/23.9107 incorrect - 2.7 km, cost 370

map U-Turns

sonora commented 2 years ago

We have a notable number of open issues involving u-turns https://github.com/osmandapp/Osmand/issues?q=sort%3Aupdated-desc+u-turn+is%3Aopen, reporting both too many (partly illegal) as well as too few (either ignoring explicit possibilities as reported here, or ignoring potential possibilities like when ou are on a wide open road in the desert with no traffic in sight and would certainly turn if your nav only told you that's shorter).

Hence I think the topic deserves an investigation beyond just this issue alone.

rKsanu2MMYvypWePtQWM commented 2 years ago

@Zirochkabila actually the second example does not route properly thru OSM.org OSRM and OSM.org GraphHopper ignores "only straight on" restriction and does the U-turn where it's not allowed. The correct place is on the intersection of Jonavos g. and Salako g.

rKsanu2MMYvypWePtQWM commented 2 years ago

We have a notable number of open issues involving u-turns https://github.com/osmandapp/Osmand/issues?q=sort%3Aupdated-desc+u-turn+is%3Aopen, reporting both too many (partly illegal) as well as too few (either ignoring explicit possibilities as reported here, or ignoring potential possibilities like when ou are on a wide open road in the desert with no traffic in sight and would certainly turn if your nav only told you that's shorter).

Hence I think the topic deserves an investigation beyond just this issue alone.

I was actually surprised that there were no threads about not enough u-turns when researching this topic. seems like there has to be some changes made...

sonora commented 2 years ago

In a lot of cases, whether a U-turn is feasible or not is hard to discover from static map data, it depends on ground truth, traffic, etc. Years ago we used to have a hint "Please make a U-turn when possible" if we discovered movement in the opposite durection of where the best route would actually go.While that gave you a definite hint that turning around would be best if feasible without risk, it also unsettled a lot of users in situations where it was impossible to turn, thinking "What do I do now?". I think eventually we settled to err on the side of safety and rather routed users along a detour than making them aware that u-turning would be shortest...

rKsanu2MMYvypWePtQWM commented 2 years ago

In a lot of cases, whether a U-turn is feasible or not is hard to discover from static map data, it depends on ground truth, traffic, etc. Years ago we used to have a hint "Please make a U-turn when possible" if we discovered movement in the opposite durection of where the best route would actually go.While that gave you a definite hint that turning around would be best if feasible without risk, it also unsettled a lot of users in situations where it was impossible to turn, thinking "What do I do now?". I think eventually we settled to err on the side of safety and rather routed users along a detour than making them aware that u-turning would be shortest...

For random intersections this seems fine, however dedicated places for turn-arounds should be considered.

Also, when road is made out of two one-way ways, OsmAnd will route thru such U-turns because it can't tell that it's the same road and not just two left turns right after another. If such cases are allowed, then u-turns on roads made out of a single way should too...

vshcherb commented 2 years ago

I doubt these are correct routes. So it's better to route as it is then take that risk

rKsanu2MMYvypWePtQWM commented 2 years ago

I doubt these are correct routes. So it's better to route as it is then take that risk

Random U-turns I understand, but turning around at the designated spot should definitely be considered. The first example is exactly why the dedicated turn-around place was made in the first place.

vshcherb commented 2 years ago

Indeed in reality there is a lane and it's possible, I would definetely remap it somehow to make it clear. It has turn:lanes=reverse||| but that's the only indication.

https://help.openstreetmap.org/questions/37870/how-to-map-u-turn-roads

rKsanu2MMYvypWePtQWM commented 2 years ago

Indeed in reality there is a lane and it's possible, I would definetely remap it somehow to make it clear. It has turn:lanes=reverse||| but that's the only indication.

https://help.openstreetmap.org/questions/37870/how-to-map-u-turn-roads

There really isn't a proper way to tag U-turns in OSM. The turnlanes tag seems to be the only way to indicate anything when the road is made out of a single way and not two parallel ways.

vshcherb commented 2 years ago

Yes, I agree you can't put any tag on the node where it should be related to the node (point) not to the way. It's a bit pity of course relying on the lanes looks fishy but probably that the only way to implement it right now.