adjust sliproad handler for empty-name check, illustrate testcase

This commit is contained in:
Moritz Kobitzsch 2016-10-13 09:59:10 +02:00 committed by Daniel J. H
parent c1651ccb12
commit ccdebccde1
2 changed files with 30 additions and 26 deletions

View File

@ -201,20 +201,20 @@ Feature: Slipways and Dedicated Turn Lanes
Scenario: Schwarzwaldstrasse Autobahn Scenario: Schwarzwaldstrasse Autobahn
Given the node map Given the node map
""" """
i h g . i . . . . . h . . . . g
j .j '. . '
a k a . k
b r c d e f ' b . r c . d . e . . . . f
. . .
. . .
. . .
. . .
l l . .
m m . .
n q n q
. .
. .
. .
o p o p
""" """

View File

@ -218,7 +218,7 @@ operator()(const NodeID, const EdgeID source_edge_id, Intersection intersection)
const auto link_data = node_based_graph.GetEdgeData(road.eid); const auto link_data = node_based_graph.GetEdgeData(road.eid);
// Check if the road continues here // Check if the road continues here
const bool is_through_street = const bool is_through_street =
!target_intersection.empty() && !target_intersection.empty() && link_data.name_id != EMPTY_NAMEID &&
target_intersection.end() != target_intersection.end() !=
std::find_if(target_intersection.begin() + 1, std::find_if(target_intersection.begin() + 1,
target_intersection.end(), target_intersection.end(),
@ -226,12 +226,14 @@ operator()(const NodeID, const EdgeID source_edge_id, Intersection intersection)
const auto &road_edge_data = const auto &road_edge_data =
node_based_graph.GetEdgeData(road.eid); node_based_graph.GetEdgeData(road.eid);
const auto same_name = !util::guidance::requiresNameAnnounced( const auto same_name =
name_table.GetNameForID(road_edge_data.name_id), road_edge_data.name_id != EMPTY_NAMEID &&
name_table.GetRefForID(road_edge_data.name_id), !util::guidance::requiresNameAnnounced(
name_table.GetNameForID(link_data.name_id), name_table.GetNameForID(road_edge_data.name_id),
name_table.GetRefForID(link_data.name_id), name_table.GetRefForID(road_edge_data.name_id),
street_name_suffix_table); name_table.GetNameForID(link_data.name_id),
name_table.GetRefForID(link_data.name_id),
street_name_suffix_table);
return same_name; 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 &next_data = node_based_graph.GetEdgeData(next_road.eid);
const auto same_name = !util::guidance::requiresNameAnnounced( const auto same_name = next_data.name_id != EMPTY_NAMEID &&
name_table.GetNameForID(next_data.name_id), source_edge_data.name_id != EMPTY_NAMEID &&
name_table.GetRefForID(next_data.name_id), !util::guidance::requiresNameAnnounced(
name_table.GetNameForID(source_edge_data.name_id), name_table.GetNameForID(next_data.name_id),
name_table.GetRefForID(source_edge_data.name_id), name_table.GetRefForID(next_data.name_id),
street_name_suffix_table); name_table.GetNameForID(source_edge_data.name_id),
name_table.GetRefForID(source_edge_data.name_id),
street_name_suffix_table);
if (same_name) if (same_name)
{ {