diff --git a/CHANGELOG.md b/CHANGELOG.md index e8c9c93abe4..5be7976adf1 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 c452bc101bb..0d993dfd6e9 100644 --- a/features/guidance/motorway.feature +++ b/features/guidance/motorway.feature @@ -315,6 +315,6 @@ Feature: Motorway Guidance | bd | motorway_link | | Ravenholm | When I route I should get - | waypoints | route | turns | - | a,c | ,, | depart,turn slight left,arrive | - | a,d | , | depart,arrive | + | waypoints | route | turns | + | a,c | ,, | depart,fork slight left,arrive | + | a,d | ,, | depart,fork slight right,arrive | diff --git a/src/guidance/turn_handler.cpp b/src/guidance/turn_handler.cpp index 2fb6721c972..70924c4d59c 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()); }