Daniel J. Hofmann
2016-09-22 16:42:38 +02:00
committed by Daniel J. H
parent f33180f092
commit c1651ccb12
9 changed files with 191 additions and 71 deletions
@@ -2,6 +2,8 @@
#include "extractor/guidance/constants.hpp"
#include "extractor/guidance/toolkit.hpp"
#include "util/guidance/toolkit.hpp"
#include <algorithm>
#include <functional>
#include <iomanip>
@@ -24,10 +26,13 @@ IntersectionGenerator::IntersectionGenerator(
const RestrictionMap &restriction_map,
const std::unordered_set<NodeID> &barrier_nodes,
const std::vector<QueryNode> &node_info_list,
const CompressedEdgeContainer &compressed_edge_container)
const CompressedEdgeContainer &compressed_edge_container,
const util::NameTable &name_table_,
const SuffixTable &street_name_suffix_table_)
: node_based_graph(node_based_graph), restriction_map(restriction_map),
barrier_nodes(barrier_nodes), node_info_list(node_info_list),
coordinate_extractor(node_based_graph, compressed_edge_container, node_info_list)
coordinate_extractor(node_based_graph, compressed_edge_container, node_info_list),
name_table(name_table_), street_name_suffix_table(street_name_suffix_table_)
{
}
@@ -223,7 +228,12 @@ bool IntersectionGenerator::CanMerge(const NodeID node_at_intersection,
return false;
// need to be same name
if (first_data.name_id != second_data.name_id)
if (second_data.name_id != EMPTY_NAMEID &&
util::guidance::requiresNameAnnounced(name_table.GetNameForID(first_data.name_id),
name_table.GetRefForID(first_data.name_id),
name_table.GetNameForID(second_data.name_id),
name_table.GetRefForID(second_data.name_id),
street_name_suffix_table))
return false;
// compatibility is required
@@ -328,7 +338,14 @@ bool IntersectionGenerator::CanMerge(const NodeID node_at_intersection,
}();
// needs to be same road coming in
if (node_based_graph.GetEdgeData(intersection[third_index].eid).name_id != first_data.name_id)
const auto &third_data = node_based_graph.GetEdgeData(intersection[third_index].eid);
if (third_data.name_id != EMPTY_NAMEID &&
util::guidance::requiresNameAnnounced(name_table.GetNameForID(third_data.name_id),
name_table.GetRefForID(third_data.name_id),
name_table.GetNameForID(first_data.name_id),
name_table.GetRefForID(first_data.name_id),
street_name_suffix_table))
return false;
// we only allow collapsing of a Y like fork. So the angle to the third index has to be
@@ -491,7 +508,7 @@ Intersection IntersectionGenerator::MergeSegregatedRoads(const NodeID intersecti
intersection[0].entry_allowed = false;
}
// a merge including the first u-turn requres an adjustment of the turn angles
// a merge including the first u-turn requires an adjustment of the turn angles
// therefore these are handled prior to this step
for (std::size_t index = 2; index < intersection.size(); ++index)
{