From ccdebccde1e7d770aa4a7eb20c99cdc379b3e42f Mon Sep 17 00:00:00 2001 From: Moritz Kobitzsch Date: Thu, 13 Oct 2016 09:59:10 +0200 Subject: [PATCH] adjust sliproad handler for empty-name check, illustrate testcase --- .../guidance/dedicated-turn-roads.feature | 26 ++++++++-------- src/extractor/guidance/sliproad_handler.cpp | 30 +++++++++++-------- 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/features/guidance/dedicated-turn-roads.feature b/features/guidance/dedicated-turn-roads.feature index 904a8bec5..12c8006ef 100644 --- a/features/guidance/dedicated-turn-roads.feature +++ b/features/guidance/dedicated-turn-roads.feature @@ -201,20 +201,20 @@ Feature: Slipways and Dedicated Turn Lanes Scenario: Schwarzwaldstrasse Autobahn Given the node map """ - i h g - j - a k - b r c d e f - - - - - l - m + . i . . . . . h . . . . g + .j '. . ' + a . k + ' b . r c . d . e . . . . f + . . . + . . . + . . . + . . . + l . . + m . . n q - - - + . . + . . + . . o p """ diff --git a/src/extractor/guidance/sliproad_handler.cpp b/src/extractor/guidance/sliproad_handler.cpp index eacc63249..f8ddca113 100644 --- a/src/extractor/guidance/sliproad_handler.cpp +++ b/src/extractor/guidance/sliproad_handler.cpp @@ -218,7 +218,7 @@ operator()(const NodeID, const EdgeID source_edge_id, Intersection intersection) const auto link_data = node_based_graph.GetEdgeData(road.eid); // Check if the road continues here const bool is_through_street = - !target_intersection.empty() && + !target_intersection.empty() && link_data.name_id != EMPTY_NAMEID && target_intersection.end() != std::find_if(target_intersection.begin() + 1, target_intersection.end(), @@ -226,12 +226,14 @@ operator()(const NodeID, const EdgeID source_edge_id, Intersection intersection) const auto &road_edge_data = node_based_graph.GetEdgeData(road.eid); - const auto same_name = !util::guidance::requiresNameAnnounced( - name_table.GetNameForID(road_edge_data.name_id), - name_table.GetRefForID(road_edge_data.name_id), - name_table.GetNameForID(link_data.name_id), - name_table.GetRefForID(link_data.name_id), - street_name_suffix_table); + const auto same_name = + road_edge_data.name_id != EMPTY_NAMEID && + !util::guidance::requiresNameAnnounced( + name_table.GetNameForID(road_edge_data.name_id), + name_table.GetRefForID(road_edge_data.name_id), + name_table.GetNameForID(link_data.name_id), + name_table.GetRefForID(link_data.name_id), + street_name_suffix_table); return same_name; }); @@ -272,12 +274,14 @@ operator()(const NodeID, const EdgeID source_edge_id, Intersection intersection) { const auto &next_data = node_based_graph.GetEdgeData(next_road.eid); - const auto same_name = !util::guidance::requiresNameAnnounced( - name_table.GetNameForID(next_data.name_id), - name_table.GetRefForID(next_data.name_id), - name_table.GetNameForID(source_edge_data.name_id), - name_table.GetRefForID(source_edge_data.name_id), - street_name_suffix_table); + const auto same_name = next_data.name_id != EMPTY_NAMEID && + source_edge_data.name_id != EMPTY_NAMEID && + !util::guidance::requiresNameAnnounced( + name_table.GetNameForID(next_data.name_id), + name_table.GetRefForID(next_data.name_id), + name_table.GetNameForID(source_edge_data.name_id), + name_table.GetRefForID(source_edge_data.name_id), + street_name_suffix_table); if (same_name) {