-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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 source phantom weight to first segment when merging legs #4949
Conversation
…weights and durations are correct.
// source phantom. We need to add those values back so that the total | ||
// edge weight is correct | ||
last_segment[old_size].weight_until_turn += | ||
leggy_result.segment_end_coordinates[i].source_phantom.forward_weight; |
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.
if the source phantom is traversed in reverse then the reverse weight must be used:
leggy_result.source_traversed_in_reverse[i] ?
leggy_result.segment_end_coordinates[i].source_phantom.reverse_weight :
leggy_result.segment_end_coordinates[i].source_phantom.forward_weight;
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.
Good catch!
LGTM with adjustments for phantom nodes traversed in the reversed direction.
features/testbot/matching.feature
Outdated
Given a grid size of 10 meters | ||
Given the node map | ||
""" | ||
a--1-b2cd-3--e |
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 suggest to make forward and reverse phantom node weights for bc
segment different as a--1-b2-cd-3--e
features/testbot/matching.feature
Outdated
| generate_hints | false | | ||
When I match I should get | ||
| trace | geometry | a:duration | a:weight | duration | | ||
| 123 | 1.000135,1,1.000225,1,1.000315,1,1.00036,1,1.00045,1 | 1:1:0.5:1 | 1:1:0.5:1 | 3.5 | |
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.
... and here add a test for a reversed trace as 321
@@ -113,15 +114,39 @@ inline LegGeometry assembleGeometry(const datafacade::BaseDataFacade &facade, | |||
const std::vector<DatasourceID> forward_datasources = | |||
facade.GetUncompressedForwardDatasources(target_geometry_id); | |||
|
|||
// FIXME if source and target phantoms are on the same segment then duration and weight |
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.
Hooray, I fixed a FIXME.
I think this is ready to go as soon as Travis passes (there may be some (incorrect) tests affected by the fixed annotation calculation logic). |
Fix annotation values for annotations on edges where phantom nodes are snapped.
Issue
This is a fix for #4948, where, when we merge legs together because of
waypoints=1,N
, the first segment of each leg needs to have the source phantomforward_weight/duration
value added (it is normally subtracted from the first segment, because it's only part of the road). The lack of this was leading to durations that were too short, andweight
,speed
, andduration
annotations containing incorrect values.Tasklist
/cc @bsudekum