fix(openrouteservice): handle empty summary for identical source/destination points#159
fix(openrouteservice): handle empty summary for identical source/destination points#159Mutlaq10 wants to merge 1 commit intomthh:masterfrom
Conversation
mthh
left a comment
There was a problem hiding this comment.
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. |
|
@nilsnolde @mthh I reported the issue in ORS repo: |
|
Thanks @Mutlaq10! |
|
Great, the upstream issue is now fixed thanks to your report @Mutlaq10! |
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