Fix manuever overrides finding bug (#6739)

* sort manuever overrides vector after partition

---------

Co-authored-by: rshokri <reza.shokri@tapsi.cab>
Co-authored-by: Michael Bell <michael@mjjbell.com>
This commit is contained in:
rezashokry
2024-03-25 01:18:28 +03:30
committed by GitHub
parent c28ba66039
commit 367933fc1a
2 changed files with 10 additions and 0 deletions
+8
View File
@@ -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")))