Skip to content

Commit

Permalink
Don't use sliproad scenario if two name announcements are required
Browse files Browse the repository at this point in the history
  • Loading branch information
oxidase committed Sep 12, 2017
1 parent 57e5d1e commit ad9ef92
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion features/guidance/dedicated-turn-roads.feature
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ Feature: Slipways and Dedicated Turn Lanes
| nodes | highway | name | oneway |
| sab | primary | sab | |
| dbcef | primary | dbcef | |
| ae | primary_link | ae | yes |
| ae | primary_link | sab | yes |
| cg | primary | cg | |


Expand Down
16 changes: 16 additions & 0 deletions src/extractor/guidance/sliproad_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,22 @@ operator()(const NodeID /*nid*/, const EdgeID source_edge_id, Intersection inter
continue;
}

// Check if main road -> sliproad -> candidate road requires two name announcements
const auto main_road_name_id = node_based_graph.GetEdgeData(main_road.eid).name_id;
if (sliproad_data.name_id != EMPTY_NAMEID && main_road_name_id != EMPTY_NAMEID &&
candidate_data.name_id != EMPTY_NAMEID &&
util::guidance::requiresNameAnnounced(main_road_name_id,
sliproad_data.name_id,
name_table,
street_name_suffix_table) &&
util::guidance::requiresNameAnnounced(sliproad_data.name_id,
candidate_data.name_id,
name_table,
street_name_suffix_table))
{
continue;
}

// If the Sliproad `bd` is a link, `bc` and `cd` must not be links.
if (!isValidSliproadLink(sliproad, main_road, candidate_road))
{
Expand Down

0 comments on commit ad9ef92

Please sign in to comment.