From 1119a542d65aaa3042e693ab1bb519be367569ac Mon Sep 17 00:00:00 2001 From: Michael Krasnyk Date: Fri, 26 Jan 2018 08:35:11 -0500 Subject: [PATCH] Announce reference change if names are empty, #4830 --- CHANGELOG.md | 4 +++- features/car/summaries.feature | 2 +- features/guidance/new-name.feature | 4 ++-- include/util/guidance/name_announcements.hpp | 4 +++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7ab645fb..9bc37d466 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ - Changes from 5.15.0: - Bugfixes: - FIXED: Segfault in map matching when RouteLeg collapsing code is run on a match with multiple submatches + - Guidance + - CHANGED #4830: Announce reference change if names are empty - Profile: - FIXED: `highway=service` will now be used for restricted access, `access=private` is still disabled for snapping. - ADDED #4775: Exposes more information to the turn function, now being able to set turn weights with highway and access information of the turn as well as other roads at the intersection [#4775](https://github.com/Project-OSRM/osrm-backend/issues/4775) @@ -704,4 +706,4 @@ - `properties.traffic_signal_penalty` - `properties.use_turn_restrictions` - `properties.u_turn_penalty` - - `properties.allow_u_turn_at_via` \ No newline at end of file + - `properties.allow_u_turn_at_via` diff --git a/features/car/summaries.feature b/features/car/summaries.feature index 688f203b0..5228d1822 100644 --- a/features/car/summaries.feature +++ b/features/car/summaries.feature @@ -76,7 +76,7 @@ Feature: Basic Routing When I route I should get | waypoints | route | summary | - | a,c | , | 100, 101 | + | a,c | ,, | 100, 101 | Scenario: Single Ref Given the node map diff --git a/features/guidance/new-name.feature b/features/guidance/new-name.feature index e191f1988..e5307fa0c 100644 --- a/features/guidance/new-name.feature +++ b/features/guidance/new-name.feature @@ -394,8 +394,8 @@ Feature: New-Name Instructions | bc | | US 422 | motorway | When I route I should get - | waypoints | route | turns | - | a,c | , | depart,arrive | + | waypoints | route | turns | + | a,c | ,, | depart,new name straight,arrive | Scenario: Spaces in refs for containment check, #3086 Given the node map diff --git a/include/util/guidance/name_announcements.hpp b/include/util/guidance/name_announcements.hpp index 442f51a91..f8e6761ff 100644 --- a/include/util/guidance/name_announcements.hpp +++ b/include/util/guidance/name_announcements.hpp @@ -160,7 +160,9 @@ inline bool requiresNameAnnounced(const StringView &from_name, const auto needs_announce = // " (Ref)" -> "Name " and reverse (from_name.empty() && !from_ref.empty() && !to_name.empty() && to_ref.empty()) || - (!from_name.empty() && from_ref.empty() && to_name.empty() && !to_ref.empty()); + (!from_name.empty() && from_ref.empty() && to_name.empty() && !to_ref.empty()) || + // ... or names are empty but reference changed + (names_are_empty && !ref_is_contained); const auto pronunciation_changes = from_pronunciation != to_pronunciation;