enable suppression name suffix changes
This commit is contained in:
@@ -27,8 +27,10 @@ inline bool requiresAnnouncement(const EdgeData &from, const EdgeData &to)
|
||||
|
||||
IntersectionHandler::IntersectionHandler(const util::NodeBasedDynamicGraph &node_based_graph,
|
||||
const std::vector<QueryNode> &node_info_list,
|
||||
const util::NameTable &name_table)
|
||||
: node_based_graph(node_based_graph), node_info_list(node_info_list), name_table(name_table)
|
||||
const util::NameTable &name_table,
|
||||
const SuffixTable &street_name_suffix_table)
|
||||
: node_based_graph(node_based_graph), node_info_list(node_info_list), name_table(name_table),
|
||||
street_name_suffix_table(street_name_suffix_table)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -86,7 +88,8 @@ TurnInstruction IntersectionHandler::getInstructionForObvious(const std::size_t
|
||||
const auto &out_data = node_based_graph.GetEdgeData(road.turn.eid);
|
||||
if (in_data.name_id != out_data.name_id &&
|
||||
requiresNameAnnounced(name_table.GetNameForID(in_data.name_id),
|
||||
name_table.GetNameForID(out_data.name_id)))
|
||||
name_table.GetNameForID(out_data.name_id),
|
||||
street_name_suffix_table))
|
||||
{
|
||||
// obvious turn onto a through street is a merge
|
||||
if (through_street)
|
||||
|
||||
@@ -44,8 +44,9 @@ inline bool isRampClass(EdgeID eid, const util::NodeBasedDynamicGraph &node_base
|
||||
|
||||
MotorwayHandler::MotorwayHandler(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)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -23,9 +23,10 @@ namespace guidance
|
||||
|
||||
RoundaboutHandler::RoundaboutHandler(const util::NodeBasedDynamicGraph &node_based_graph,
|
||||
const std::vector<QueryNode> &node_info_list,
|
||||
const CompressedEdgeContainer &compressed_edge_container,
|
||||
const util::NameTable &name_table,
|
||||
const CompressedEdgeContainer &compressed_edge_container)
|
||||
: IntersectionHandler(node_based_graph, node_info_list, name_table),
|
||||
const SuffixTable &street_name_suffix_table)
|
||||
: IntersectionHandler(node_based_graph, node_info_list, name_table, street_name_suffix_table),
|
||||
compressed_edge_container(compressed_edge_container)
|
||||
{
|
||||
}
|
||||
@@ -142,9 +143,11 @@ bool RoundaboutHandler::qualifiesAsRoundaboutIntersection(
|
||||
if (!has_limited_size)
|
||||
return false;
|
||||
|
||||
const bool simple_exits = !std::find_if( roundabout_nodes.begin(), roundabout_nodes.end(), [this]( const NodeID node ){
|
||||
return (node_based_graph.GetOutDegree(node) > 3);
|
||||
});
|
||||
const bool simple_exits =
|
||||
roundabout_nodes.end() ==
|
||||
std::find_if(roundabout_nodes.begin(), roundabout_nodes.end(), [this](const NodeID node) {
|
||||
return (node_based_graph.GetOutDegree(node) > 3);
|
||||
});
|
||||
|
||||
if (!simple_exits)
|
||||
return false;
|
||||
@@ -219,7 +222,8 @@ RoundaboutType RoundaboutHandler::getRoundaboutType(const NodeID nid) const
|
||||
// roundabout does not keep its name
|
||||
if (roundabout_name_id != 0 && roundabout_name_id != edge_data.name_id &&
|
||||
requiresNameAnnounced(name_table.GetNameForID(roundabout_name_id),
|
||||
name_table.GetNameForID(edge_data.name_id)))
|
||||
name_table.GetNameForID(edge_data.name_id),
|
||||
street_name_suffix_table))
|
||||
{
|
||||
return SPECIAL_EDGEID;
|
||||
}
|
||||
|
||||
@@ -33,15 +33,16 @@ TurnAnalysis::TurnAnalysis(const util::NodeBasedDynamicGraph &node_based_graph,
|
||||
const RestrictionMap &restriction_map,
|
||||
const std::unordered_set<NodeID> &barrier_nodes,
|
||||
const CompressedEdgeContainer &compressed_edge_container,
|
||||
const util::NameTable &name_table)
|
||||
const util::NameTable &name_table,
|
||||
const SuffixTable &street_name_suffix_table)
|
||||
: node_based_graph(node_based_graph), intersection_generator(node_based_graph,
|
||||
restriction_map,
|
||||
barrier_nodes,
|
||||
node_info_list,
|
||||
compressed_edge_container),
|
||||
roundabout_handler(node_based_graph, node_info_list, name_table, compressed_edge_container),
|
||||
motorway_handler(node_based_graph, node_info_list, name_table),
|
||||
turn_handler(node_based_graph, node_info_list, name_table)
|
||||
roundabout_handler(node_based_graph, node_info_list, compressed_edge_container, name_table, street_name_suffix_table),
|
||||
motorway_handler(node_based_graph, node_info_list, name_table,street_name_suffix_table),
|
||||
turn_handler(node_based_graph, node_info_list, name_table,street_name_suffix_table)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user