Repository navigation
Show instructions for turns onto oneway streets - #1281
Conversation
| @Test | ||
| public void testAlternativeRoute() { | ||
| // https://graphhopper.com/maps/?point=52.044124%2C10.378346&point=52.043847%2C10.381994&algorithm=alternative_route&ch.disable=true | ||
| // https://graphhopper.com/maps/?point=52.044098%2C10.378368&point=52.043847%2C10.381994&algorithm=alternative_route&ch.disable=true |
There was a problem hiding this comment.
Here the server did not produce alternative routes anymore, I had to move the waypoint a couple of meters.
There was a problem hiding this comment.
Hmmh, strange it should still produce alternatives: https://graphhopper.com/maps/?point=52.044124%2C10.378346&point=52.043847%2C10.381994&algorithm=alternative_route&ch.disable=true
There was a problem hiding this comment.
Mhm, maybe it was a one time issue? Should I revert the change?
There was a problem hiding this comment.
I checked it on GH Maps before changing it and it didn't produce an alternative route. Now it seems to produce alternatives again.
There was a problem hiding this comment.
locally it seems to fail - got the same problem in my branch: https://github.com/graphhopper/graphhopper/commits/json_refactoring
There was a problem hiding this comment.
This is weird as it is okay, when I run it locally.
There was a problem hiding this comment.
Yes, when rerunning the failing jobs now they become green, i.e. they failed temporary due to some data update.
There was a problem hiding this comment.
Yes I had the same impression :). Should I revert this change as it doesn't really belong into this PR?
| /** | ||
| * Calculates the Number of surrounding edges, including the current turn. | ||
| * This includes oneways in the wrong direction that are no possible turn. | ||
| */ |
There was a problem hiding this comment.
Hmmh, I do not understand this comment.
Is it like this:
Calculates the number of possible edges, including the edge of the current turn and oneway edges in the wrong direction that are not possible.
To highlight the similarity to the other method should this be named getAllEdges() and the other above getPossibleEdges() or something?
There was a problem hiding this comment.
Hmmh, I do not understand this comment.
Yes the comment is actually a bit complicated, we should find an easier description.
and the other above getPossibleEdges() or something?
I think possibleTurns is a good name, I think possibleEdges is harder to understand?
getAllEdges()
Yes that's a hard decision. It's not really allEdges.
X
|
\/
A --> B --> C
For the route from A->B->C, possible turns would contain, B->C, because it's the only possible turn.
SurroundingEdges would contain B->X and B->C, but not A->B, so it's not really allEdges. But I agree surroundingEdges is not a good name either.
BTW: here is minor typo
Thanks for the hint, will fix it.
There was a problem hiding this comment.
For me "turns" is not really defined and if I think about a definition it will be combination of start and destination edge and then possibleTurns is not correct and should be possibleEdges
There was a problem hiding this comment.
You are right, it makes reading the code of the instruction generation a bit better understandable I think, but it's not really defined. How about outgoingEdges?
Now we need a way to differentiate the two cases like allowed/passable/traversableOutgoingEdges and allOutgoingEdges? I struggle a bit with possibleEdges, I don't think it describes the situation well enough to understand it without reading the documentation (the same was true for surrounding edges ;)).
There was a problem hiding this comment.
all and allowedOutgoingEdges sounds good. And yes surrounding edges is also unclear. But naming is really hard :)
|
I updated the comments and also added an example in the head comment of the class. |
|
Thanks! |
Fixes #1048.
The idea of this PR is that we show an instruction, even if the turn is the only viable turn, if there is another potential (but forbidden) turn and if the turn is not a "follow road/slight turn".
The idea is that we don't see instructions when entering motorways, because these turns are usually only slight turns, but that we see instructions when turning onto a separated lane oneway as described in #1048.
One situation would be this, but there are plenty.
So far the cases I looked at, look good. So far it feels like a good improvement. But I didn't perform too many tests yet.