Skip to content

Commit

Permalink
clean: re-added valuable comment about virtual edges
Browse files Browse the repository at this point in the history
Signed-off-by: Karl Schrab <[email protected]>
  • Loading branch information
kschrab committed Nov 3, 2023
1 parent d09edd4 commit f519de7
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,11 @@ private CandidateRoute convertPath(Graph graph, Path newPath, RoutingPosition ta
EdgeIteratorState origEdge = edgesIt.next();
EdgeIteratorState currEdge = origEdge;

/*
* If the requested source or target point is in the middle of the road, an artificial node
* (and artificial edges) is created in the QueryGraph. As a consequence, the first
* and/or last edge of the route might be such virtual edge, which must be converted to its original edge.
*/
if (currEdge instanceof VirtualEdgeIteratorState) {
currEdge = graph.getEdgeIteratorStateForKey(((VirtualEdgeIteratorState) origEdge).getOriginalEdgeKey());
}
Expand Down

0 comments on commit f519de7

Please sign in to comment.