Skip to content

Commit d2764bc

Browse files
committed
Don't use obvious directions at ramp bifurcations, #4895
1 parent 005a146 commit d2764bc

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- CHANGED #4830: Announce reference change if names are empty
66
- CHANGED #4835: MAXIMAL_ALLOWED_SEPARATION_WIDTH increased to 12 meters
77
- CHANGED #4842: Lower priority links from a motorway now are used as motorway links [#4842](https://github.com/Project-OSRM/osrm-backend/pull/4842)
8+
- CHANGED #4895: Use ramp bifurcations as fork intersections [#4895](https://github.com/Project-OSRM/osrm-backend/issues/4895)
89
- Profile:
910
- FIXED: `highway=service` will now be used for restricted access, `access=private` is still disabled for snapping.
1011
- 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)

features/guidance/motorway.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,5 +321,5 @@ Feature: Motorway Guidance
321321
When I route I should get
322322
| waypoints | route | turns |
323323
| a,c | ,, | depart,fork slight left,arrive |
324-
| a,e | ,,, | depart,fork slight right,turn slight left,arrive |
325-
| a,f | ,, | depart,fork slight right,arrive |
324+
| a,e | ,,, | depart,fork slight right,fork slight left,arrive |
325+
| a,f | ,,, | depart,fork slight right,fork slight right,arrive |

src/guidance/turn_handler.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,13 @@ Intersection TurnHandler::handleThreeWayTurn(const EdgeID via_edge, Intersection
249249
OOOOOOO
250250
*/
251251

252+
const auto all_ramps =
253+
std::all_of(intersection.begin(), intersection.end(), [this](const auto &road) {
254+
return node_based_graph.GetEdgeData(road.eid).flags.road_classification.IsRampClass();
255+
});
256+
252257
auto fork = findFork(via_edge, intersection);
253-
if (fork && obvious_index == 0)
258+
if (fork && (all_ramps || obvious_index == 0))
254259
{
255260
assignFork(via_edge, fork->getLeft(), fork->getRight());
256261
}

0 commit comments

Comments
 (0)