Skip to content

Commit

Permalink
Don't use obvious directions at ramp bifurcations, #4895
Browse files Browse the repository at this point in the history
  • Loading branch information
oxidase committed Feb 19, 2018
1 parent 04c3a73 commit dffb94d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions features/guidance/motorway.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
7 changes: 6 additions & 1 deletion src/guidance/turn_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit dffb94d

Please sign in to comment.