Skip to content

Improve instructions by using the context of all instructions #1007

Open

Description

@boldtrn

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).

For example roundabouts:
Some roundabouts have an extra lane, meant to be used for shortcutting the first exit of the roundabout. If we don't take the shortcut we oftimes create "KEEP_LEFT" followed by the roundabout instruction. http://localhost:8989/?point=48.680077%2C9.367062&point=48.679121%2C9.366644
The same might happen when leaving a roundabout. I think it would be obvious to everyone that when leaving the roundabout via the 2nd exit, the shortcut should not be taken.

Also see @karussell comment in #955:

  • if turns are <10m away should we consider merging them or how to properly guide a walking person?

I think we have to collect a couple of use-cases where merging/contracting Instrucions makes sense, to decide what steps we should take.

TODO: Replace localhost links once the improved instructions are deployed

Activity

  1. devemux86 commented on Mar 25, 2017

    @devemux86
    Contributor

    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.

  2. karussell commented on Mar 25, 2017

    @karussell
    Member

    Maybe @devemux86 is right. Also you @boldtrn mentioned that you would prefer this (in another issue)?

  3. boldtrn commented on Mar 25, 2017

    @boldtrn
    MemberAuthor

    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 :).

  4. changed the title [-]Merge/Contract close instructions[/-] [+]Improve instructions by using the context of all instructions[/+] on Mar 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions