Skip to content
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

Refactor segment update code #3737

Closed
TheMarex opened this issue Feb 20, 2017 · 1 comment
Closed

Refactor segment update code #3737

TheMarex opened this issue Feb 20, 2017 · 1 comment
Labels

Comments

@TheMarex
Copy link
Member

Currently we are doing updates of our edge weight in osrm-contract in the following two phases:

  1. Parse all the CSV files and build a global lookup table of speed overrides.
  2. Update each individual segment in the compressed geometry.
  3. Update all edge-based-edges using the .segment_lookup file and .turn_duration_penalty, .turn_weight_penalty.

However since we originally implemented this there have been some structural changes that would allow us to drop using the .segment_lookup file.

  1. Parse all the CSV files and build a global lookup table of speed overrides
  2. Convert the speed/rate value to a duration/weight value using the segment distance (calculate from the coordinates)
  3. Update the compressed geometry, sum up all per-segment values and populate hash map GeometryID -> {weight,duration}
  4. Iterate over all edge based edges, use EdgeBasedEdge::id to lookup GeometryID from OriginalEdgeData
  5. Use GeometryID to check for new duration/weight value, combine value with the turn penalty. If there is no new value for the GeometryID but we only updated the turn penalty we need to re-calculate the sum of all weight/duration values for this GeometryID.

Related to #3349.

/cc @danpat @oxidase @karenzshea

@TheMarex
Copy link
Member Author

We now only use data.turn_id for the indexing in the update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants