Michael Krasnyk 2018-02-12 17:20:44 +01:00
parent 5f598da76d
commit 519eae63c6
3 changed files with 30 additions and 5 deletions

View File

@ -4,6 +4,7 @@
- ADDED #4676: Support for maneuver override relation, allowing data-driven overrides for turn-by-turn instructions [#4676](https://github.com/Project-OSRM/osrm-backend/pull/4676)
- 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)
- 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)

View File

@ -281,3 +281,21 @@ Feature: Motorway Guidance
| waypoints | route | turns |
| a,d | , | depart,arrive |
| b,d | , | depart,arrive |
Scenario: Ramp Exit with Lower Priority
Given the node map
"""
a-b-c-d-e
`--f-g
"""
And the ways
| nodes | highway | oneway |
| abcde | trunk | |
| bfg | primary_link | yes |
When I route I should get
| waypoints | route | turns |
| a,e | abcde,abcde | depart,arrive |
| a,g | abcde,bfg,bfg | depart,off ramp slight right,arrive |

View File

@ -31,9 +31,13 @@ inline extractor::RoadClassification roadClass(const ConnectedRoad &road,
return graph.GetEdgeData(road.eid).flags.road_classification;
}
inline bool isRampClass(EdgeID eid, const util::NodeBasedDynamicGraph &node_based_graph)
inline bool isRampClass(EdgeID eid,
const util::NodeBasedDynamicGraph &node_based_graph,
bool from_motorway = true)
{
return node_based_graph.GetEdgeData(eid).flags.road_classification.IsRampClass();
return node_based_graph.GetEdgeData(eid).flags.road_classification.IsRampClass() ||
(from_motorway &&
node_based_graph.GetEdgeData(eid).flags.road_classification.IsLinkClass());
}
} // namespace
@ -63,6 +67,8 @@ bool MotorwayHandler::canProcess(const NodeID,
const EdgeID via_eid,
const Intersection &intersection) const
{
const bool from_motorway = isMotorwayClass(via_eid, node_based_graph);
bool has_motorway = false;
bool has_normal_roads = false;
@ -76,14 +82,14 @@ bool MotorwayHandler::canProcess(const NodeID,
if (road.entry_allowed)
has_motorway = true;
}
else if (!isRampClass(road.eid, node_based_graph))
else if (!isRampClass(road.eid, node_based_graph, from_motorway))
has_normal_roads = true;
}
if (has_normal_roads)
return false;
return has_motorway || isMotorwayClass(via_eid, node_based_graph);
return has_motorway || from_motorway;
}
Intersection MotorwayHandler::