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
9.88k stars 950 forks source link

Redundant turns at highway intersection #9123

Open daviewales opened 2 months ago

daviewales commented 2 months ago

Describe the issue

Instead of veering left to take the Abbott Road Exit link road, I am directed to do a clockwise 270 degree turn around the highway intersection.

Steps to reproduce Using maps for NSW, Australia:

Expected behaviour

I expected to take the left exit on the Abbot Road Exit link road. (Note, the cycle routing gets it right!)

Screenshots

image

System information:

biodranik commented 2 months ago

What are your "avoid" routing options? And is the road data in OpenStreetMap.org correct?

daviewales commented 2 months ago

I had 'avoid tolls', but I get the same result when I remove all 'avoid' options. I've checked in OSM. I couldn't see anything obviously wrong.

This is the intersection: https://www.openstreetmap.org/#map=18/-33.766111/150.957829

biodranik commented 2 months ago

Are there turn restrictions?

@vng the algo should detect such cases properly even if turn restrictions are missing. Any ideas on how to do it?

daviewales commented 2 months ago

There are turn restrictions, but they technically allow this routing, because they are single-node, so each individual segment is allowed to turn right, which makes it possible to do the 270 degree turn:

image

I'm guessing that changing the routing rule to use 'Via, up to 2 ways' for each input segment might forcibly prevent this from occurring, but I'm not sure if that counts as tagging for the renderer:

Before: image

After: image

However, the correct routing is shorter, and has less turns so I would have expected the router to pick that by default.

daviewales commented 2 months ago

OSRM gets it right:

https://www.openstreetmap.org/directions?engine=fossgis_osrm_car&route=-33.767505%2C150.958768%3B-33.765978%2C150.957229#map=19/-33.766665/150.958001

biodranik commented 2 months ago

Looks like other routers with already implemented turn penalty workaround the missing restrictions.

daviewales commented 2 months ago

In your opinion, is this technically a tagging issue, but exacerbated by the lack of turn penalties in OrganicMaps? I'm happy to increase the strictness of the turn restrictions if so.

Essentially I would be adding 'no U-turn' to each input road. This is likely correct in this case, as U-turns are not permitted at traffic lights unless there is a 'U-turn permitted' sign. However, I imagine that there are edge-cases with similar topologies which do permit U-turns, but are unlikely to permit 270 degree turns!

biodranik commented 2 months ago

How many similar cases are there in OSM? Are there cases with valid sharp turns? Adding turn penalties is planned in OM, but making it easier for OSMers to properly tag turn restrictions is also important.

daviewales commented 2 months ago

I suspect there are many similar cases. I believe that the tagging on the intersection shown above is pretty standard.

Here is another, although this one is missing some turn restrictions:

Route from: -33.7211312, 150.9380477 Route to: -33.7207528, 150.9370175

In this case, it avoids the turning lane, although it does not do the 270 degree turn around the lights:

image

Again, OSRM seems to have it figured out:

image

You can see that this intersections has no turn restrictions defined at all, so there is room to improve the tagging. But I wonder if I added the turn restrictions if I would replicate the 270 degree turn above?

image

vng commented 2 months ago

https://github.com/organicmaps/organicmaps/issues/8805