You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can do a basic one to check it e.g. sets the right edge to unfavoured, but I don't think I understand it well enough to test it while routing. Is that OK?
I don't think I understand it well enough to test it while routing
Please keep asking :) !
See e.g. FastestWeightingTest.testWeightWrongHeading, QueryGraphTest.testEnforceHeading, GraphHopperIT.testMonacoStraightVia and GraphHopperOSMTest.testGetPathsDirectionEnforcement*
Hmmm, I think I/we may have misinterpreted the intention of this, and that it is only mean to be used at the start/end of a route. In in the case
v1 v2
A------X------B
with nodes A,B and virtual node X, and virtual edges v1 and v2, we'd call enforceHeadingByEdgeId(X, v1, ...) to enforce a heading left to right (i.e. X->B). This works by making v1 unfavored in both directions and hence v2 is the only option. If we wanted to enforce the reverse direction (X->A), then we'd use enforceHeadingByEdgeId(X, v2, ...). This is the current behaviour and I believe how it is currently used. Therefore I think the incoming parameter is completely redundant and can be removed. It might also pay to rename it to something like unfavorBothDirectionsOnVirtualEdge, which more clearly reflects its purpose.
The only case where the incoming parameter could be useful is if we want to enforce a heading along a route, in which case we'd then have to unfavor the same direction on both v1 and v2 (instead of both directions on only one).
Yes, this is ugly. In GraphHopper the graph is bidirectional but for every virtual node we create for virtual edges to replace the single real edge. Also we are using this method only via incoming=false
So either we make this method work more generic or refactor it, yes.
Yes, this made the implementation of the QueryGraph a lot easier as one has to deal with lots of edge cases, see #115. But as we have now many tests in place we could try to make it bidirectional too.
It's not really an issue right now in map matching issue 70.
If the routing algorithms would support routing from arbitrary positions on edges we wouldn't even need this whole virtual node/virtual edge/QueryGraph business. @karussell, did you consider this before?
If the routing algorithms would support routing from arbitrary positions on edges we wouldn't even need this
whole virtual node/virtual edge/QueryGraph business. @karussell, did you consider this before?
Yes, sure (see the first comment in #115). But then the problem just moves to the algorithms. And the plan was and is to have many algorithms supported, where we abstract away the complexity of the real world as much as possible.
To implement prevention of inner-link U-turns, I don't see a problem with the fact that virtual edges are always unidirectional.
I also do not see a problem, but it is special compared to the other behaviour. And so not really expected.
Once again regarding:
If the routing algorithms would support routing from arbitrary positions on edges we wouldn't even need this whole virtual node/virtual edge/QueryGraph business. @karussell, did you consider this before?
I think we can still delegate the work to the Dijkstra algorithm (using the 'raw' Graph) and e.g. create one special routing algorithm or Dijkstra version for map matching. But handling one ways and multiple requests on one edge made the implementation of QueryGraph very hairy and I expect similar problems for a complete solution inside the algorithm. Also we make replacing the routing algorithm near to impossible then.
As you wrote here, couldn't we just just route between two real edges using edge based traversal?
Even if you get routing to work (although especially multiple points on one real edge will make problems!) ... how do you handle partial geometries, distance, etc then? We can use edge based traversal already with the QueryGraph without the needs to change the algorithm
Activity
karussell commentedon Nov 24, 2016
Looks like this is indeed not implemented. We need a unit test for this :)
kodonnell commentedon Nov 24, 2016
I can do a basic one to check it e.g. sets the right edge to unfavoured, but I don't think I understand it well enough to test it while routing. Is that OK?
karussell commentedon Nov 24, 2016
Please keep asking :) !
See e.g. FastestWeightingTest.testWeightWrongHeading, QueryGraphTest.testEnforceHeading, GraphHopperIT.testMonacoStraightVia and GraphHopperOSMTest.testGetPathsDirectionEnforcement*
kodonnell commentedon Nov 24, 2016
Hmmm, I think I/we may have misinterpreted the intention of this, and that it is only mean to be used at the start/end of a route. In in the case
with nodes A,B and virtual node X, and virtual edges v1 and v2, we'd call enforceHeadingByEdgeId(X, v1, ...) to enforce a heading left to right (i.e. X->B). This works by making v1 unfavored in both directions and hence v2 is the only option. If we wanted to enforce the reverse direction (X->A), then we'd use enforceHeadingByEdgeId(X, v2, ...). This is the current behaviour and I believe how it is currently used. Therefore I think the
incomingparameter is completely redundant and can be removed. It might also pay to rename it to something likeunfavorBothDirectionsOnVirtualEdge, which more clearly reflects its purpose.The only case where the
incomingparameter could be useful is if we want to enforce a heading along a route, in which case we'd then have to unfavor the same direction on both v1 and v2 (instead of both directions on only one).Thoughts @karussell?
Cc @stefanholder
karussell commentedon Nov 24, 2016
Yes, this is ugly. In GraphHopper the graph is bidirectional but for every virtual node we create for virtual edges to replace the single real edge. Also we are using this method only via incoming=false
So either we make this method work more generic or refactor it, yes.
stefanholder commentedon Nov 25, 2016
So virtual edges are always unidirectional?
karussell commentedon Nov 26, 2016
Yes, this made the implementation of the QueryGraph a lot easier as one has to deal with lots of edge cases, see #115. But as we have now many tests in place we could try to make it bidirectional too.
stefanholder commentedon Nov 28, 2016
It's not really an issue right now in map matching issue 70.
If the routing algorithms would support routing from arbitrary positions on edges we wouldn't even need this whole virtual node/virtual edge/QueryGraph business. @karussell, did you consider this before?
karussell commentedon Nov 28, 2016
Yes, sure (see the first comment in #115). But then the problem just moves to the algorithms. And the plan was and is to have many algorithms supported, where we abstract away the complexity of the real world as much as possible.
karussell commentedon Nov 28, 2016
What do you mean here?
stefanholder commentedon Nov 28, 2016
To implement prevention of inner-link U-turns, I don't see a problem with the fact that virtual edges are always unidirectional.
karussell commentedon Nov 29, 2016
I also do not see a problem, but it is special compared to the other behaviour. And so not really expected.
Once again regarding:
I think we can still delegate the work to the Dijkstra algorithm (using the 'raw' Graph) and e.g. create one special routing algorithm or Dijkstra version for map matching. But handling one ways and multiple requests on one edge made the implementation of QueryGraph very hairy and I expect similar problems for a complete solution inside the algorithm. Also we make replacing the routing algorithm near to impossible then.
stefanholder commentedon Nov 29, 2016
Let's continue the discussion of direction of virtual edges in graphhopper/map-matching#83.
As you wrote here, couldn't we just just route between two real edges using edge based traversal?
karussell commentedon Nov 29, 2016
Even if you get routing to work (although especially multiple points on one real edge will make problems!) ... how do you handle partial geometries, distance, etc then? We can use edge based traversal already with the QueryGraph without the needs to change the algorithm
Refactor unfavoring of virtual edges (#885) (#909)