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
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
"""

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);
// 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)
{