Don't use sliproad scenario if two name announcements are required

This commit is contained in:
Michael Krasnyk 2017-09-12 20:47:50 +02:00 committed by Patrick Niklaus
parent a7ea6e5327
commit 837dba2191
4 changed files with 30 additions and 11 deletions

View File

@ -13,6 +13,7 @@
- MLD uses a unidirectional Dijkstra for 1-to-N and N-to-1 matrices - MLD uses a unidirectional Dijkstra for 1-to-N and N-to-1 matrices
- Guidance - Guidance
- Fixed some cases of sliproads pre-processing (https://github.com/Project-OSRM/osrm-backend/issues/4348) - Fixed some cases of sliproads pre-processing (https://github.com/Project-OSRM/osrm-backend/issues/4348)
- don't suppress name announcements via sliproad handler
# 5.12.0 # 5.12.0
- Changes from 5.11: - Changes from 5.11:

View File

@ -1044,7 +1044,7 @@ Feature: Slipways and Dedicated Turn Lanes
| nodes | highway | name | oneway | | nodes | highway | name | oneway |
| sab | primary | sab | | | sab | primary | sab | |
| dbcef | primary | dbcef | | | dbcef | primary | dbcef | |
| ae | primary_link | ae | yes | | ae | primary_link | sab | yes |
| cg | primary | cg | | | cg | primary | cg | |

View File

@ -829,16 +829,16 @@ Feature: Basic Roundabout
""" """
And the ways And the ways
| nodes | highway | junction | oneway | # | | nodes | highway | junction | oneway | # |
| abcda | tertiary | roundabout | | circle | | abcda | tertiary | roundabout | | circle |
| ebds | tertiary | | | road | | ebds | tertiary | | | road |
| cm | tertiary | | | | | cm | tertiary | | | |
| ds | tertiary | | | road | | ds | tertiary | | | road |
| rstur | tertiary | roundabout | | circle2 | | rstur | tertiary | roundabout | | circle2 |
| ufghl | tertiary | | | road | | ufghl | tertiary | | | road |
| tv | tertiary | | | | | tv | tertiary | | | |
| gi | tertiary | | yes | sliproad | | gi | tertiary_link | | yes | sliproad |
| jhik | tertiary | | | crossroad | | jhik | tertiary | | | crossroad |
When I route I should get When I route I should get

View File

@ -487,6 +487,24 @@ operator()(const NodeID /*nid*/, const EdgeID source_edge_id, Intersection inter
continue; continue;
} }
// Check if main road -> sliproad (non-link) -> candidate road requires two name
// announcements then don't suppress one announcement via sliproad handler
const auto main_road_name_id = node_based_graph.GetEdgeData(main_road.eid).name_id;
if (!sliproad_data.road_classification.IsLinkClass() &&
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 the Sliproad `bd` is a link, `bc` and `cd` must not be links.
if (!isValidSliproadLink(sliproad, main_road, candidate_road)) if (!isValidSliproadLink(sliproad, main_road, candidate_road))
{ {