Skip to content

Commit

Permalink
Fix manuever overrides finding bug (#6739)
Browse files Browse the repository at this point in the history
* sort manuever overrides vector after partition

---------

Co-authored-by: rshokri <[email protected]>
Co-authored-by: Michael Bell <[email protected]>
  • Loading branch information
3 people authored Mar 24, 2024
1 parent c28ba66 commit 367933f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@
- Routing:
- FIXED: Fix adding traffic signal penalties during compression [#6419](https://github.com/Project-OSRM/osrm-backend/pull/6419)
- FIXED: Correctly handle compressed traffic signals. [#6724](https://github.com/Project-OSRM/osrm-backend/pull/6724)
- FIXED: Fix bug when searching for maneuver overrides [#6739](https://github.com/Project-OSRM/osrm-backend/pull/6739)
- Debug tiles:
- FIXED: Ensure speed layer features have unique ids. [#6726](https://github.com/Project-OSRM/osrm-backend/pull/6726)

# 5.27.1
- Changes from 5.27.0
- Misc:
Expand Down
8 changes: 8 additions & 0 deletions src/partitioner/partitioner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,14 @@ int Partitioner::Run(const PartitionerConfig &config)
extractor::files::readManeuverOverrides(filename, maneuver_overrides, node_sequences);
renumber(maneuver_overrides, permutation);
renumber(node_sequences, permutation);

// Although the vector is already sorted, the rename function changes the identifiers, so
// the order is not sorted now. So we sort by `from_node` again, so that later lookups can
// be done with a binary search.
std::sort(maneuver_overrides.begin(),
maneuver_overrides.end(),
[](const auto &a, const auto &b) { return a.start_node < b.start_node; });

extractor::files::writeManeuverOverrides(filename, maneuver_overrides, node_sequences);
}
if (boost::filesystem::exists(config.GetPath(".osrm.hsgr")))
Expand Down

0 comments on commit 367933f

Please sign in to comment.