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
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?
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?
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
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.
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?
Activity
samruston commentedon Feb 26, 2020
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?
karussell commentedon Feb 26, 2020
Yes, indeed, limiting the snapping with the NameSimilarityEdgeFilter to a certain radius sounds good.
Without the point_hint this can surely happen, with the point_hint it does not make much sense, yes.
boldtrn commentedon Feb 26, 2020
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?
samruston commentedon Feb 27, 2020
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.
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
karussell commentedon Feb 27, 2020
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).
Yes, sounds like a good start and should be the common use case.
samruston commentedon Feb 27, 2020
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.
karussell commentedon Feb 27, 2020
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?