From 1cafafc4cd492477ecf0ca4a6767d59dbc87400c Mon Sep 17 00:00:00 2001 From: Michael Krasnyk Date: Fri, 16 Feb 2018 22:23:22 +0100 Subject: [PATCH] Don't use obvious directions at ramp bifurcations, #4895 --- CHANGELOG.md | 1 + features/guidance/motorway.feature | 4 ++-- src/guidance/turn_handler.cpp | 7 ++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8c9c93ab..5be7976ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - CHANGED #4830: Announce reference change if names are empty - CHANGED #4835: MAXIMAL_ALLOWED_SEPARATION_WIDTH increased to 12 meters - CHANGED #4842: Lower priority links from a motorway now are used as motorway links [#4842](https://github.com/Project-OSRM/osrm-backend/pull/4842) + - CHANGED #4895: Use ramp bifurcations as fork intersections [#4895](https://github.com/Project-OSRM/osrm-backend/issues/4895) - 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) diff --git a/features/guidance/motorway.feature b/features/guidance/motorway.feature index 98e019e46..7717b612b 100644 --- a/features/guidance/motorway.feature +++ b/features/guidance/motorway.feature @@ -321,5 +321,5 @@ Feature: Motorway Guidance When I route I should get | waypoints | route | turns | | a,c | ,, | depart,fork slight left,arrive | - | a,e | ,,, | depart,fork slight right,turn slight left,arrive | - | a,f | ,, | depart,fork slight right,arrive | + | a,e | ,,, | depart,fork slight right,fork slight left,arrive | + | a,f | ,,, | depart,fork slight right,fork slight right,arrive | diff --git a/src/guidance/turn_handler.cpp b/src/guidance/turn_handler.cpp index 2fb6721c9..70924c4d5 100644 --- a/src/guidance/turn_handler.cpp +++ b/src/guidance/turn_handler.cpp @@ -249,8 +249,13 @@ Intersection TurnHandler::handleThreeWayTurn(const EdgeID via_edge, Intersection OOOOOOO */ + const auto all_ramps = + std::all_of(intersection.begin(), intersection.end(), [this](const auto &road) { + return node_based_graph.GetEdgeData(road.eid).flags.road_classification.IsRampClass(); + }); + auto fork = findFork(via_edge, intersection); - if (fork && obvious_index == 0) + if (fork && (all_ramps || obvious_index == 0)) { assignFork(via_edge, fork->getLeft(), fork->getRight()); }