-
Notifications
You must be signed in to change notification settings - Fork 31
fix(openrouteservice): handle empty summary for identical source/destination points #159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
mthh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
Given what other routers (such as OSRM) return when the starting point and destination are the same, it seems appropriate to do this as a way to correct this edge case.
Can you just run black (by installing and running pre-commit hooks, as described in https://github.com/mthh/routingpy/blob/master/CONTRIBUTING.md#setup) so that the code gets formatted correctly?
is the empty summary the only clue? IMO that's more a ORS bug, it should server-side do exactly what you're doing here, just like valhalla & osrm. might be worth to raise an issue in their repo @Mutlaq10 . |
|
You're probably right, @nilsnolde. I'll take another look tonight (I can't right now) at what ORS returns in this kind of case (and see if this hack is really necessary). |
it's worth a raise. While I don't know if there is a minimum distance between points to return directions between them, tried random close location and (source==destenation) locations, and I got for the following request: the following response (which I understand it as (no path between the two locations) : |
|
the |
|
we can of course still merge this, it won't hurt, even when fixed. |
Fixes KeyError when ORS returns empty summary for directions with same or very close source/destination points by defaulting distance and duration to 0.
This resolves #158