Skip to content

Insert Shape Points at TrafficSpeed Breakpoints#2451

Merged
purew merged 33 commits intomasterfrom
kk_shapeattrib
Jul 8, 2020
Merged

Insert Shape Points at TrafficSpeed Breakpoints#2451
purew merged 33 commits intomasterfrom
kk_shapeattrib

Conversation

@kevinkreiser
Copy link
Copy Markdown
Member

Edges who have live speeds can change their speeds at break points along the edge. Where that happens we need to change the speed value we assign in shape attributes. This PR does that by inserting new shape points at the breakpoints of a given speed record on an edge.

@kevinkreiser kevinkreiser self-assigned this Jul 1, 2020
@kevinkreiser kevinkreiser added this to the Sprint 13 - Left Turn milestone Jul 1, 2020
@kevinkreiser kevinkreiser marked this pull request as ready for review July 2, 2020 18:27
@kevinkreiser kevinkreiser requested review from danpat and purew July 2, 2020 18:27
Comment thread src/thor/triplegbuilder.cc
Comment thread src/thor/triplegbuilder.cc
double distance_total_pct = src_pct;
auto speed_itr = std::find_if(speeds.cbegin(), speeds.cend(),
[distance_total_pct](const decltype(speeds)::value_type& s) {
return distance_total_pct <= std::get<0>(s);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I re-read this a few times. Could distance_total_pct be changed to src_pct to better describe to the reader that the iterator only returns speeds starting at src_pct?


// Set speed if requested
if (controller.attributes.at(kEdgeSpeed)) {
// TODO: if this is a transit edge then the costing will throw
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intended to be fixed in this PR or is it a caveat for future us?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its been broken for a while and the fix is non-trivial. i think we should fix this in a subsequent pr (this happens in another spot at well)

@coxchapman coxchapman removed this from the Sprint 13 - Left Turn milestone Jul 7, 2020
@coxchapman coxchapman added this to the Sprint 14 - Left Turn milestone Jul 7, 2020
danpat
danpat previously approved these changes Jul 8, 2020
@purew purew merged commit 65d56ca into master Jul 8, 2020
@purew purew deleted the kk_shapeattrib branch July 8, 2020 21:34
yuzheyan added a commit that referenced this pull request Jul 13, 2020
* 'master' of github.com:valhalla/valhalla:
  Hide robin hood (#2455)
  openlr: Explicitly check for linear reference option for Valhalla serialization (#2458)
  docs: add luajit to macOS installation (#2461)
  Insert Shape Points at TrafficSpeed Breakpoints (#2451)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants