Skip to content

Routing fails with hint pass_through and via points near dead-end ways or junctions #1258

Closed

Description

@NopMap

Graphhopper Version: 0.9 stable branch
JVM: Oracle x64 1.8
OS: Windows7 x64
Reproducible: Always

How to reproduce:

  • set hint pass_through
  • use 3 points for routing
  • place the via point behind a dead-end way so it is snapped to the end point tower node of the way (see picture 1)

=> routing fails

Additional findings:

  • when pass_through is de-activated the exact same point works.
  • when the snapped point is on the dead end way, but not the end point, the routing works (see picture 2)

Picture 1: via point is snapped to end point tower node, routing fails

Picture 2: via point is snapped to a point on the way, routing works

Associated forum discussion

Activity

  1. modified the milestone: 0.10 on Jan 4, 2018
  2. boldtrn commented on Feb 13, 2018

    @boldtrn
    Member

    I had a closer look what is happening here.

    When we match a point close to a dead-end, we will match it as Position.TOWER in the LocationIndex. We don't create VirtualNodes for TOWER QueryResults.

    Fixing this seems not straight forward. We keep an unfavored flag for VirtualEdges in memory. Storing this for every edge might be too much?

    Other possible but not optimal fixes could be:

    • Pass a list of EdgeIds to the weighting that contains unfavored edges, instead of storing the unfavored information in the edge. This might actually be slower than our current approach.
    • Create a VirtualEdge for TOWER nodes as well. I don't think that this makes sense to be honest :).
    • Don't throw an exception in QueryGraph#unfavorVirtualEdgePair, but just "fail" silently. The same happens already in QueryGraph#enforceHeading, where we just don't do anything if it's not a
      VirtualNode.

    I think I would go with the "don't throw and exception" solution. It's a corner case and we should create an issue for how to handle edge unfavoring for non VirtualEdges. This can happen both for the heading as well as the pass through parameter.

    BTW: I pushed a test for this issue here

    WDYT?

  3. NopMap commented on Oct 1, 2018

    @NopMap
    ContributorAuthor

    I think just quitely ignoring it instead of failing the routing should be enough.

  4. changed the title [-]Routing fails with hint pass_through and via points near dead-end ways[/-] [+]Routing fails with hint pass_through and via points near dead-end ways and junctions[/+] on Oct 24, 2019
  5. changed the title [-]Routing fails with hint pass_through and via points near dead-end ways and junctions[/-] [+]Routing fails with hint pass_through and via points near dead-end ways or junctions[/+] on Oct 24, 2019
  6. added a commit that references this issue on Oct 24, 2019
    09b5e88
  7. michaz commented on Oct 25, 2019

    @michaz
    Member

    Wouldn't the most general solution to this be that locations can't be on "real tower nodes", but only on links? (Think we've talked about this..) Like, just remove the special case where a point is snapped to a node instead of a link?

    People don't live on intersections, they live at street addresses. Every routable location should be on a road, not on an intersection.

    And suddenly, every location would have a heading. Not every location except those that were snapped to tower nodes.

  8. michaz commented on Oct 25, 2019

    @michaz
    Member

    Or put differently: Mathematically, the probability of a noisy point on a graph embedding falling on a node is 0. So we only create the special case by snapping it.

  9. michaz commented on Oct 25, 2019

    @michaz
    Member

    (My argument doesn't work that well for the dead-end case.)

  10. easbar commented on Oct 28, 2019

    @easbar
    Member

    People don't live on intersections, they live at street addresses. Every routable location should be on a road, not on an intersection.

    I think I agree and maybe we can get rid of some complexity if we can always assume that a QueryResult sits on a virtual node between tower nodes (basically always have Position.EDGE). But of course this solution just moves the problem to the location index lookup: we have to make sure that we always snap somewhere next to the node for cases where we snapped onto a node before (I think this applies for junctions just like it does for dead-ends). For junctions we even have to make a decision onto which of the adjacent edges we want to snap.

    The thing that strikes me more here though is that for pass_through snapping onto a real node (a junction or dead end) is a special case (that we do not handle at the moment), but this is only a problem because of the way the feature is implemented. There is no real problem with this and it is clear what should happen also in this case. All we want is not take a u-turn at the via points so we start the next leg with an edge that was not the one we used to arrive at the via point. Ok for dead ends we indeed have to allow the u-turn in this case (because there is no other alternative). For junctions (in principle) this is not a problem at all.

  11. naser13 commented on Apr 21, 2020

    @naser13
    Contributor

    I think just quitely ignoring it instead of failing the routing should be enough.

    i think this approach is at least better than failing.
    similar to how it's done in QueryGraph.enforceHeading:
    if (!isVirtualNode(nodeId)) return false;

  12. NoamDev commented on May 13, 2020

    @NoamDev

    What about creating a virtual node "just before" the tower node (with weighting 0)?
    Then, the problem for junctions will be solved.

  13. NoamDev commented on May 13, 2020

    @NoamDev

    The problem wih dead-ends can be solved with edge-based routing, as I suggested in (#1765).

  14. NopMap commented on Apr 17, 2022

    @NopMap
    ContributorAuthor

    After reading through these comments and the linked issues, I am still not clear whether the issue with the U-turn routing fails here was solved somewhere there in the meantime and whether it is save now to use the pass_through parameter.

    Can you enlighten me, please?

  15. easbar commented on Apr 17, 2022

    @easbar
    Member

    Yes, it is safe to use.

    • pass_through + CH is forbidden and you'll get an error telling you that pass_through + CH is not supported
    • pass_through will be ignored silently at dead-ends and junctions (since dc2bbd5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions