How to fix navigation directions that don't follow a straight road

Hi all,
I’ve been using OSMAND for several years but I’ve only just started to get into contributing to the OSM mapping community. One oddity that I have noticed is that sometimes navigation directions don’t follow the straight road but take consecutive off-ramps on-ramps. I’m wondering how I could fix this in the map. Here is a screenshot of a navigation path exhibiting the behavior.



First of all, welcome!

Location: OpenStreetMap
(please include this in your post next time)

I’m no expert in OsmAnd, so I can’t be sure. However, I can try: on the intersection there are traffic signals (highway=traffic_singals). On these turn lanes there are no traffic signals. So the router may want to bypass the traffic signals and navigate you around them. That is perfectly valid given the current way this intersection is mapped.

The most proper way to fix this is to add a turn restriction on the turn lanes, so that using the right turn lane only allows to actually turn right (restriction=only_right_turn); see Relation:restriction - OpenStreetMap Wiki.
Mapping of relations is not the easiest, so don’t hesitate to ask for further help.

Hope this helps!

1 Like

Slightly related issue with OSMAnd not wanting to follow highways: Pifia en N-I en Andoain (Guipúzcoa) (Spanish).

Here’s one of my own screenshots. It also demonstrates the on/off ramp issue presented in the OP. Unfortunately I can’t easily find the location.

Make sure that the links have maxspeed tags.

This is not the first time Osmand has such problems.


To be more specific see Relation:restriction - OpenStreetMap Wiki

See specifically File:Turn restriction mapping in iD (animated gif).gif - OpenStreetMap Wiki - iD (default online editor) has really nice restriction editing

And File:Turn restriction mapping in Vespucci (animated gif).gif - OpenStreetMap Wiki for support in Vespucci.

In JOSM you need to craft restrictions in generic relation editor.


Note that restrictions should be only added where turn is illegal - not in all cases where Osmand gives silly instructions.

1 Like

I don’t know the rules locally, but presumably there should also be a highway=give_way at each end of the exits and entrances. This would give a penalty for these ways and thus rebalance the traffic light.

Thanks. The animated gif was a great help. I have fixed the intersection in the original question.

1 Like

How about if Osmand fix this issue instead (pretty much straighforward I would think). The idea of having to cut, chop, put in restrictions all over the country’s intersections is kinda absurd.

I was the victim of this routing in one unfortunate circumstance, while driving a truck. The detour that I had to take was luckily traversable by the truck despite going through a residential area.

In such case you need to report it to Osmand, probably to their issue tracker. Or implement a fix and submit pull request patch.

EDIT: Also, it is almost certainly not straightforward as you would discover in case of implementing it. In related news, I am on fourth day of trying to get “+1” button to work properly and failing.

It is also not really incorrect as you cannot really turn there. So such edits are not wrong and can be made.

Looks like it isn’t as straightforward as you think. These situations also happen with other routing engines from time to time. Although not as often as with OsmAnd in my experience.

1 Like

In this case I think the mapping was just poor. There was nothing indicating that the _link road was only intended as right turn lane. Maybe the issue could also have been fixed by tagging the turn key (thus less ‘cutting and chopping’), but we didn’t try that.

I think that it is important for mappers to include the detail rather than have the software automatically make such decisions. From a software point of view, explicit detail is better than inferred detail. Inferred detail makes it harder to define behaviors. As I’m learning how to use the software, and the mapping backend, it is very well designed and thought out.

Wondered if including overtaking = no will prevent routing across the street. I do like keeping stuff simple and lean while preserving functionality.

I don’t think so and don’t think it should either. Overtaking is a property of a way, turning a property on a node (intersection of ways). If overtaking is not allowed on a way, that would and should not mean that turning (left) is not allowed on the node.

To illustrate:


If the vertical road has overtaking=no, turning left from that road should still be possible (unless otherwise tagged). Similarly, going straight on the horizontal way should also be allowed.

However, as I said, I do think the turn key (on the sliproad) could have made clear that the sliproad was only for turning right and that routers should consider that. That should be a simple solution in this case.

Some more details have been added to that thread where we narrowed the issue down to a short motorway bridge that OSRM seems to want to avoid at all costs: Way: ‪Iparraldeko autobia / Urumeako autobia‬ (‪83180069‬) | OpenStreetMap

I mention it here in case it might be relevant to some of the examples here. In the Andaoin example it doesn’t seem likely that any more detailed tagging would fix the issue.

Following up on my own post, it now looks like the problem in Andoain was due to a toll gantry that had been wrongly tagged with access restrictions (where the mapper was presumably trying to express which vehicles pay a toll, but tagged in a way that suggested that car access was prohibited). It was difficult to find as I was concentrating on ways but this was an isolated node. (Also a node that isn’t displayed in many renderers so didn’t attract my attention at first).