Project-OSRM / osrm-backend

Open Source Routing Machine - C++ backend
http://map.project-osrm.org
BSD 2-Clause "Simplified" License
6.19k stars 3.29k forks source link

Apply turn tag to all lanes #4605

Open 1ec5 opened 6 years ago

1ec5 commented 6 years ago

taginfo.json says OSRM recognizes turn:lanes (turn:lanes:forward, turn:lanes:backward) but not turn (turn:forward, turn:backward), which is shorthand for the lane indications on all lanes.

For example, this way is tagged turn:forward=left, because the right turn lanes are segregated turn lanes that have already branched off to the right.

diversion

Ideally, client-side UI would display lane arrows indicating that all lanes can be used to turn left, not only the leftmost lane.

daniel-j-h commented 6 years ago

@MoKob what's your take here - can we simply make use of the lanes=n tag and the turn tag to re-write these into turn:lanes tags for an easy win? Can this happen in pre-processing already similar to https://github.com/Project-OSRM/osrm-backend/pull/4473?

MoKob commented 6 years ago

@daniel-j-h I don't think that rewriting is a way to go here. The lanes are on different ways, since the turns are not possible after the road splits. The way on the right should only allow turning right, while the part on the left only allows turning left.

If we were to rewrite these tags, we would create turn lane strings that indicate both left/right turns, but only one of them is possible. OSRM will end up saying, that this is a mapping error, since the turn lanes do not match the possible turns and discard the lanes.

The only chance for these kind of labels would be the sliproad handler. Sliproads already combine turn lanes for exactly this case. The main problem here is, that we do not recognise the turn:forward tag and assume no lanes. In this case, since the prior setting is left|none, the none is also assumed valid, if we should actually pull forward the lanes tags.

I would guess that simply also recognising turn:* for lanes could be worth a try.