Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn instructions show turn right instead of straight on #21055

Open
2 of 4 tasks
scaidermern opened this issue Oct 16, 2024 · 8 comments
Open
2 of 4 tasks

Turn instructions show turn right instead of straight on #21055

scaidermern opened this issue Oct 16, 2024 · 8 comments

Comments

@scaidermern
Copy link
Contributor

scaidermern commented Oct 16, 2024

Routing engine

  • OsmAnd's in-app offline routing
  • Any online routing provider (YOURS, openrouteservice, OSRM, etc.)

Routing Profile

Car

Start and end points

Start: 51.10898, 13.77396
End: 51.11233, 13.77967

https://osmand.net/map/?start=51.108982%2C13.773956&end=51.112331%2C13.779673&profile=car#17/51.111008/13.776660

Actual route

The route goes almost straight on but OsmAnd displays "turn right" and highlights the "turn right" arrow in the lane widget:

Turning right at this point (onto the white road) will lead into the wrong direction. Driving straight on (onto the yellow road) is the correct instruction.

The road has three lanes (lanes=3) in total. The first two lanes lead to the left. The third lane goes straight and to the right (turn:lanes=left|left|through;right):
https://www.openstreetmap.org/way/384592167
https://www.openstreetmap.org/way/414711400

Maybe this is caused by the raw road geometry of the intersection in OSM:

The route is highlighted in red (coming from south west and going to north east). According to the raw road geometry the right turn is about 48 degrees although in reality it is almost straight (blue arrow).

What I would have imagined: OsmAnd sees the road to the right road (white in the first screenshot, gray in the second) and deduces that "turn right" can't be the correct instruction. "turn right" would be the correct instruction for this white/gray road but this road should not be taken. So the only value that is left from the turn:lanes tag is to go straight.

Expected route

Show and highlight "straight on".

Maps you used (online or offline)

  • Offline maps offered within the OsmAnd app for download.
  • Online (tile / raster) maps

Your Environment

OsmAnd Version: 4.9.0
Android version: Android 13
Device model: Fairphone 4

Anything else?

No response

@scaidermern
Copy link
Contributor Author

Maybe related to #11177, maybe not.
But for #11177 the same strategy could help. Ignore/remove the roads that should not be taken from the set of available turn lanes. Only then check which of the remaining turn instructions will fit the best.

@yuriiurshuliak
Copy link

The bug has been reproduced. The route incorrectly shows a "turn right" direction at an intersection where the road is essentially straight. The correct instruction should be to continue straight.

You can view the route in the web version via this link: Route Example.

@vmicho
Copy link

vmicho commented Oct 18, 2024

Well, the turn is quite sharp and the turn lane is combined right+straight so it will be a right turn for any navigation.
Redrawing a bit the geometry just before the junction like this for example might help:
image

This would also make left turn really left.

@scaidermern
Copy link
Contributor Author

I've never seen such a geometry in OSM and it will create a too sharp angle for the left turn.

Better fix the code to ignore the right turn since the turn to the right leads to the wrong road.

@vmicho
Copy link

vmicho commented Oct 19, 2024

Nope, there is nothing wrong in correcting the geometry. I've done this several times.

My example is a bit exaggerated and can be done a bit better. The fact is currently even ID editor shows left+right+right turns. On the 'corrected' example above it already shows left+straight+right. It's just about sharpening the joining angle from the road from SW.
Another correction possibility would be adding a separate 'through' way or doubling the ways a bit beyond the crossroad but this will add complexity and you will need to assert all allowed/forbidden turns. The separate bus way does not simplify things here neither and it also incorrectly shows 'right' instead of through.

I've read on a separate documentation of Waze that they also suggest fixing geometry if it is a simple action, instead of adding manoeuvres (which are not supported by nearly any routers) (see https://wiki.openstreetmap.org/wiki/Relation:manoeuvre )

@scaidermern
Copy link
Contributor Author

scaidermern commented Oct 20, 2024

Nope, there is nothing wrong in correcting the geometry. I've done this several times.

I fail to understand why this is necessary. I fail to understand why the geometry even matters here.

We are coming from a road with lanes=3 and turn:lanes=left|left|through;right.

  • There are four outgoing roads. The first to the left must be ignored due to a turn restriction.
  • Three roads remain, matching exactly the three available turn instructions. The second road from the left has lanes:forward=2 and should not be taken. So the two left turns left|left belong to this road are removed from the available turn instructions.
  • Two roads remain, the turn instructions throuth;right remains. The next road (when looking from the left) should be taken, the remaining road to the right should not be taken.
  • Therefore choose the first of the two remaining turn instructions through and drop the remaining instruction right.

The resulting solution is correct. No geometry is involved here, all required information is present in the OSM tags. No misunderstanding is possible.

@vmicho
Copy link

vmicho commented Oct 22, 2024

For me it sound complicated to calculate by software correctly for every case - remember there can be more crossroads like this and even more complicated.
Here the most obvious problem is the straight+right lane where both destinations turn (geometrically) right. This most probably cannot be interpreted correctly by any software. And a fix here could potentially break hundreds of other crossroad navigation.

I've checked the 3 routers from OSM on this crossroad with straight route (SW->NE) and with the left turn, and the results are horribly inconsistent and mostly wrong.
I'd really fix geometry here.

@scaidermern
Copy link
Contributor Author

Here the most obvious problem is the straight+right lane where both destinations turn (geometrically) right. This most probably cannot be interpreted correctly by any software.

Well, I just explained how to solve this algorithmically. That's why we have the lanes and turn:lanes tag. So that we don't have to guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants