Repository navigation
Finding the prevEdge from the prevNode - #1014
Conversation
Ok, let us fix this other issue first, I think you mean #1013 ? |
|
Ok, this has not much to do with #1013. Would you mind to try if you can find this bug in a (integration) test against a CH graph? I can guess this should easily occur if you do ./graphhopper.sh measurement core/files/some.osm.gz |
|
Strange, I cannot find such an issue although I thought this could happen frequently due to the graph.disconnect call in PrepareContractionHierarchies |
|
I thought I had reproduced the issue but these changes doesn't fix the problem that I had, see this commit, where the tests fails with: Couldn't find the previous edge for 436-435-1369 See the discussion where this is coming from. |
|
The reason that this still fails sometimes for via points is tricky. If we have via points we create 3 virtual nodes e.g. A,B and C to find the paths A->B and B->C. Now if A is on the path B->C the QueryGraph correctly contains the two virtual edges with A leading to a path like B->...->x1->A->x2->...->C but it does not contain x1->x2 BUT when using the CH graph the query B->C can return paths with shortcuts, and these shortcuts are extracted but using only real edge like |
|
Thanks a lot for debugging this and finding a test case @karussell. I suspected the virtual nodes to be the source of the issue as well. I actually wrote some code to ignore virtual nodes a couple of weeks ago (I think I mentioned it offline). The code does not fix the issue, that why I haven't created a PR. But, I just had an idea. And I have to blame myself for writing unnecessarily complicated code here. I cannot so any reason to not store the prevEdge like we do with prevName. I just implemented this (see my latest commit to your branch issue_1014). Currently I simply force the turn sign if the prevEdge is null (which should not happen frequently, if it happens at all). WDYT? |
# Conflicts: # core/src/main/java/com/graphhopper/routing/Path.java
|
So this means we can avoid the limitation of the CH path extraction (returning real edges)? Nice! |
|
Would you mind to update the PR to the latest HEAD? |
# Conflicts: # core/src/main/java/com/graphhopper/routing/InstructionsFromEdges.java
Yes :). Somehow I must have missed that before...
I just updated the PR to the latest master. |
This issues fixes #1010. The old behavior was created when the algorithm was searching for the current edge and the previous edge. I pass the current edge in the method parameter now, so the current edge is not needed anymore. It makes more sense to search from the previous node to the base node instead of searching from the base node to the previous node in reverse.
I have seen some issues here with VirtualNodes that couldn't be found from the base node correctly. This only happened in combination with a custom weighting and CH, so it is hard to write a test here.