organicmaps / organicmaps

🍃 Organic Maps is a free Android & iOS offline maps app for travelers, tourists, hikers, and cyclists. It uses crowd-sourced OpenStreetMap data and is developed with love by MapsWithMe (MapsMe) founders and our community. No ads, no tracking, no data collection, no crapware. Please donate to support the development!
https://organicmaps.app
Apache License 2.0
10.03k stars 960 forks source link

Unauthorised U-turn #9178

Open Kamerijker opened 3 months ago

Kamerijker commented 3 months ago

*Describe the issue Routing by car proposes an unauthorised U-turn on a primary road in Halle, Belgium https://www.openstreetmap.org/

Schermafbeelding 2024-08-31 om 14 13 42

System information:

RedAuburn commented 3 months ago

route: https://www.openstreetmap.org/directions?engine=fossgis_osrm_car&route=50.741319%2C4.239185%3B50.738304%2C4.235981#map=17/50.740143/4.236587

biodranik commented 3 months ago

Are u-turns prohibited in the osm data?

Bugsbane commented 3 months ago

I don't know. What I do know is that routing frequently suggests U turns where it is not safe to do so, ie on large, major roads. Really this shouldn't happen anywhere larger than a residential street.

map-per commented 3 months ago

It looks like OM suggests the U-Turn at the connection of two OSM road segments right next to, but not at the intersection.

Are u-turns prohibited in the osm data?

For some reasons there are no_u_turn restrictions in the OSM data. Usually, however, no_u_turn are only added on intersections and not on free track sections.

biodranik commented 3 months ago

@vng is it easy to filter out such u-turns on connected segments?

vng commented 2 months ago

Well, we should definitely filter U-turns on single roads (without other connections) even if they are split on several ways.

@Kamerijker I see that you have started adding no-u-turn relations. Well, not a problem here, but it looks like mapping for the app :) We should resolve it in a better way in the code, since there are 3 more same points in this particular intersection. Actually, a better OSM fix here is to merge 3 ways into one, especially when they have identical tags.

BTW, Graphhopper has the same bug.

Kamerijker commented 2 months ago

@vng yes i did add u-turn relations hoping some routers would pick those up, but found out later that most routers are ignoring these relations and use other algorithms to avoid u-turns, and yes GraphHopper has still the same problem even after my changes. OSRM and Valhalla are doing the right job here.

muralito commented 2 months ago

I don't know. What I do know is that routing frequently suggests U turns where it is not safe to do so, ie on large, major roads. Really this shouldn't happen anywhere larger than a residential street.

The problem is how to determine if it is safe or no to do an U turn. Maybe in an urban area you are right, but E.g. if i am driving on a quiet primary road in a rural area, for some reason i miss the intersection to turn right, the router should instruct me to do an U-turn, and not to continue driving several km until i can go back. At least is what i expect from the router.

Kamerijker commented 2 months ago

@vng the new OM version I downloaded from the Apple store today didn’t pickup my no-u-turn relations in OSM, so the U-turn problem persist.

Kamerijker commented 1 month ago

@vng the most recent OM update I installed today solved this problem. Many thanks to the support team!

map-per commented 1 month ago

Reopening as adding turn restrictions in the OSM database is not a proper fix. The OM routing should also work without these superfluous turn restrictions.