You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Improve instructions by using the context of all instructions #1007
The instruction generation does not know much about the context of the route, it knows the last and the next edge. Also it considers surrounding edges, but not the whole path.
When knowing all instructions along the path we can check instructions that are close to each other if one instruction might make the second instruction redundant (or vice versa).
Probably that handling is more appropriate in app level (where the requirements vary) than being forced by the library?
So an option to turn it on / off could be useful via e.g. request hint.
Probably that handling is more appropriate in app level (where the requirements vary) than being forced by the library?
Also you @boldtrn mentioned that you would prefer this (in another issue)?
Yes, generally speaking I think this is still true. But there might be situations where we always want to contract/remove turn instructions.
So my idea was to have a correction loop after creating the instructions that uses the knowledge about the graph + the context of all instructions. In this loop we could for example remove the unnecessary instruction at roundabouts. It would be wrong to remove all slight_turns that are closer than 50m to a roundabout instruction (that's what I could do on app level), but it might be good to remove all of the slight turn instructions before a roundabout that do not include a street name change.
I added your comments (@karussell) to the issue because they seem to be related. For example how about instructions that are only 1m away? For example I could think of this scenario:
| <-- Road A
-------- <--- Road B
| <-- Road A
|
| [ Travel direction is bottom up ]
At the crossing of Road A and B, Road A is only slightly displaced (to the right).
The instructions would be: Turn right, After 50 cm turn left.
So if the road name stays consistent and Road B is a different highway type, we could completely ignore the instruction. This is obviously made up and I don't know if such a situation exists in real life, but I think we will see a couple of these issues that are solvable by knowing the context. So we should collect a couple of them to get a better feeling of the issue.
I think I will update my description above to better match my thoughts :).
Activity
devemux86 commentedon Mar 25, 2017
Probably that handling is more appropriate in app level (where the requirements vary) than being forced by the library?
So an option to turn it on / off could be useful via e.g. request hint.
karussell commentedon Mar 25, 2017
Maybe @devemux86 is right. Also you @boldtrn mentioned that you would prefer this (in another issue)?
boldtrn commentedon Mar 25, 2017
Yes, generally speaking I think this is still true. But there might be situations where we always want to contract/remove turn instructions.
So my idea was to have a correction loop after creating the instructions that uses the knowledge about the graph + the context of all instructions. In this loop we could for example remove the unnecessary instruction at roundabouts. It would be wrong to remove all slight_turns that are closer than 50m to a roundabout instruction (that's what I could do on app level), but it might be good to remove all of the slight turn instructions before a roundabout that do not include a street name change.
I added your comments (@karussell) to the issue because they seem to be related. For example how about instructions that are only 1m away? For example I could think of this scenario:
| <-- Road A
-------- <--- Road B
| <-- Road A
|
| [ Travel direction is bottom up ]
At the crossing of Road A and B, Road A is only slightly displaced (to the right).
The instructions would be: Turn right, After 50 cm turn left.
So if the road name stays consistent and Road B is a different highway type, we could completely ignore the instruction. This is obviously made up and I don't know if such a situation exists in real life, but I think we will see a couple of these issues that are solvable by knowing the context. So we should collect a couple of them to get a better feeling of the issue.
I think I will update my description above to better match my thoughts :).
[-]Merge/Contract close instructions[/-][+]Improve instructions by using the context of all instructions[/+]