enable suppression name suffix changes

This commit is contained in:
Moritz Kobitzsch
2016-04-22 11:31:46 +02:00
parent fddb035539
commit a154d71841
21 changed files with 298 additions and 95 deletions
+13 -11
View File
@@ -24,8 +24,9 @@ namespace guidance
TurnHandler::TurnHandler(const util::NodeBasedDynamicGraph &node_based_graph,
const std::vector<QueryNode> &node_info_list,
const util::NameTable &name_table)
: IntersectionHandler(node_based_graph, node_info_list, name_table)
const util::NameTable &name_table,
const SuffixTable &street_name_suffix_table)
: IntersectionHandler(node_based_graph, node_info_list, name_table, street_name_suffix_table)
{
}
@@ -406,22 +407,23 @@ Intersection TurnHandler::assignLeftTurns(const EdgeID via_edge,
Intersection intersection,
const std::size_t starting_at) const
{
BOOST_ASSERT(!intersection.empty());
BOOST_ASSERT(starting_at <= intersection.size());
for (auto &road : intersection)
road = mirror(road);
const auto switch_left_and_right = []( Intersection &intersection )
{
BOOST_ASSERT(!intersection.empty());
std::reverse(intersection.begin() + 1, intersection.end());
for (auto &road : intersection)
road = mirror(std::move(road));
std::reverse(intersection.begin() + 1, intersection.end());
};
switch_left_and_right(intersection);
// account for the u-turn in the beginning
const auto count = intersection.size() - starting_at + 1;
intersection = assignRightTurns(via_edge, std::move(intersection), count);
switch_left_and_right(intersection);
std::reverse(intersection.begin() + 1, intersection.end());
for (auto &road : intersection)
road = mirror(road);
return intersection;
}