diff --git a/CHANGELOG.md b/CHANGELOG.md index e8c9c93abe4..f32dc4ce739 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 #4893: Handle motorway forks with links as normal motorway intersections - 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 61637f57cdc..88331fc041d 100644 --- a/features/guidance/motorway.feature +++ b/features/guidance/motorway.feature @@ -301,6 +301,7 @@ Feature: Motorway Guidance | a,g | abcde,bfg,bfg | depart,off ramp slight right,arrive | + # https://www.openstreetmap.org/edit#map=20/53.46176/-2.24501 Scenario: Highway Fork with a Link Given the node map """ @@ -316,7 +317,7 @@ Feature: Motorway Guidance | cd | motorway_link | When I route I should get - | waypoints | route | turns | - | a,d | abce,cd,cd | depart,turn straight,arrive | - | a,e | abce,abce,abce | depart,fork slight left,arrive | - | a,f | abce,cf,cf | depart,fork slight right,arrive | + | waypoints | route | turns | + | a,d | abce,cd,cd | depart,off ramp slight left,arrive | + | a,e | abce,abce | depart,arrive | + | a,f | abce,cf,cf | depart,turn slight right,arrive | diff --git a/src/guidance/motorway_handler.cpp b/src/guidance/motorway_handler.cpp index 10889d5cf84..0376b9eb6a1 100644 --- a/src/guidance/motorway_handler.cpp +++ b/src/guidance/motorway_handler.cpp @@ -219,7 +219,10 @@ Intersection MotorwayHandler::fromMotorway(const EdgeID via_eid, Intersection in } else { - const unsigned exiting_motorways = countExitingMotorways(intersection); + const auto valid_exits = std::count_if(intersection.begin(), + intersection.end(), + [](const auto &road) { return road.entry_allowed; }); + const auto exiting_motorways = countExitingMotorways(intersection); if (exiting_motorways == 0) { @@ -233,7 +236,7 @@ Intersection MotorwayHandler::fromMotorway(const EdgeID via_eid, Intersection in } } } - else if (exiting_motorways == 1) + else if (exiting_motorways == 1 || exiting_motorways != valid_exits) { // normal motorway passing some ramps or mering onto another motorway if (intersection.size() == 2)