Skip to content

Commit

Permalink
Announce reference change if names are empty, #4830
Browse files Browse the repository at this point in the history
  • Loading branch information
oxidase committed Jan 29, 2018
1 parent d706696 commit 1119a54
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -704,4 +706,4 @@
- `properties.traffic_signal_penalty`
- `properties.use_turn_restrictions`
- `properties.u_turn_penalty`
- `properties.allow_u_turn_at_via`
- `properties.allow_u_turn_at_via`
2 changes: 1 addition & 1 deletion features/car/summaries.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions features/guidance/new-name.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion include/util/guidance/name_announcements.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 1119a54

Please sign in to comment.