Skip to content

point_hint not precise enough #1828

Closed

Activity

  1. samruston commented on Feb 26, 2020

    @samruston
    Contributor

    Also seeing bad snapping for https://graphhopper.com/maps/?point=43.060328%2C-80.463078&point=43.079409%2C-80.423629&point_hint=c&point_hint=9th%20Concession%20Road

    Here the problem is it getting confused between 9th and Ninth. Interestingly OSM has the roads as Ninth and 10th & Google Maps has 9th and Tenth.

    A fix could just be adding more replacement rules to NameSimilarityEdgeFilter. I think it brings up a bigger issue of snapping though. With various other examples I've seen the distance between snapped point and actual point up to 3km away. In this example it is 1.4km. Should there be a capped distance to the snapped point? And if so would you open to a PR for it?

  2. karussell commented on Feb 26, 2020

    @karussell
    MemberAuthor

    Yes, indeed, limiting the snapping with the NameSimilarityEdgeFilter to a certain radius sounds good.

    With various other examples I've seen the distance between snapped point and actual point up to 3km away.

    Without the point_hint this can surely happen, with the point_hint it does not make much sense, yes.

  3. boldtrn commented on Feb 26, 2020

    @boldtrn
    Member

    Maybe we could add some sort of penalty for distance in addition to name similarity? I am not sure how most people use the point_hint and if it could make sense to match a result that is e.g. farther away than 2 km?

  4. samruston commented on Feb 27, 2020

    @samruston
    Contributor

    Sure. I'm new to the codebase and there's a lot happening so any direction would be helpful. Possible options:

    • Adding a new edge filter in in ViaRoutingTemplate to filter edges beyond a certain radius (or modifying NameSimilarityEdgeFilter to do this)

    • The penalty option sounds much more involved as I think we'd have to modify the EdgeFilter interface to return the penalty, save it in the QueryResult and then modify the findClosest methods to sort using the penalty instead of distance.

    I am not sure how most people use the point_hint and if it could make sense to match a result that is e.g. farther away than 2 km?

    For our case we're snapping street houses to the roads they are on so it doesn't really make sense for them to be more than 100m away

  5. karussell commented on Feb 27, 2020

    @karussell
    MemberAuthor

    Yes, I would start with modifying NameSimilarityEdgeFilter. You could use the Circle shape like this. But I hope the precise geometries&distances are not required and we can avoid calling the expensive fetchGeometry (will also make the code easier).

    For our case we're snapping street houses to the roads they are on so it doesn't really make sense for them to be more than 100m away

    Yes, sounds like a good start and should be the common use case.

  6. samruston commented on Feb 27, 2020

    @samruston
    Contributor

    I've got a circle in NameSimilarityEdgeFilter but we'll need a way to pass in the bounding box.

    We can create the bounding box here as there's a node access, but we'd need a way of passing it through to the edge filter.

  7. karussell commented on Feb 27, 2020

    @karussell
    MemberAuthor

    Ah, yes, this dependency to the graph (graph.getNodeAccess) is ugly and smells unnecessary if we already have the EdgeIteratorState. Maybe for now pass the NodeAccess (ghStorage.getNodeAccess()) to the ViaRoutingTemplate constructor and then to NameSimilarityEdgeFilter constructor?

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