-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add more PathDetails #1142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more PathDetails #1142
Conversation
public boolean isEdgeDifferentToLastEdge(EdgeIteratorState edge) { | ||
if (edge.getEdge() != edgeId) { | ||
edgeId = edge.getEdge(); | ||
time = weighting.calcMillis(edge, encoder.isBackward(edge.getFlags()), -1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we don't have the reverse Flag here, I used this "hack" to determine the direction of the flag. Not sure if this is valid or if we should do it different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The edges in the Path should be already properly directed so reverse should be always false
for the path details?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot! I really like how simple and clean this looks now :)
assertEquals(3, averageSpeedDetails.get(3).getFirst()); | ||
assertEquals(4, averageSpeedDetails.get(3).getLast()); | ||
|
||
List<PathDetail> streetNameDetails = details.get(STREET_NAME); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have different test methods for the different path details (and maybe reuse the common parts)
else if (value.getValue() instanceof Integer) | ||
gen.writeNumber((Integer) value.getValue()); | ||
else if (value.getValue() instanceof Integer) | ||
gen.writeNumber((Integer) value.getValue()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is somehow duplicated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, you are right :)
Fixes #1140.
I added all PathDetails that were requested in #1140. In order to add the time, I used the Weighting. I don't especially like this, as it adds an additional dependency, but I think it's the best solution for this problem.