Repository navigation
Fix PathDetails exception for empty EdgeIdDs list - #1240
Conversation
karussell
left a comment
There was a problem hiding this comment.
Thanks!
Is there a fundamental difference to a via-point with zero length and just a single point? Shouldn't it be more like [0,0,value]?
|
|
||
| public PointList simplify() { | ||
| if (listsToSimplify.isEmpty() || pointList.isEmpty()) | ||
| if (listsToSimplify.isEmpty() || pointList.isEmpty() || pointList.size() <= 2) |
There was a problem hiding this comment.
pointList.isEmpty is not necessary anymore
Yes, for via points we know the value of the edge and if we merge the PathDetails this case is automatically resolved. For empty paths we don't know the value of the edge and cannot create a PathDetail like |
IF both points are on an edge this is solvable (time delta is 0, fetch closest edge to get other path details etc). But when I'm think about this deeper, the problem is if both points are exactly on a tower node so that e.g. street_name value is not decidable, so an empty path detail is the only solution IMO |
If you request a route with two points, with start and end being the same snapped_point, the resulting path has only one point and no edges.
This resulted in an exception:
This PR proposes a possible solution for this by allowing to set empty PathDetails in the PathWrapper.
Due to this change the resulting PathDetails will be empty: