Skip to content

Commit 27fa2fc

Browse files
committed
1 parent 7434f18 commit 27fa2fc

File tree

3 files changed

+30
-5
lines changed

3 files changed

+30
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- 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)
55
- CHANGED #4830: Announce reference change if names are empty
66
- CHANGED #4835: MAXIMAL_ALLOWED_SEPARATION_WIDTH increased to 12 meters
7+
- CHANGED #4842: Lower priority links from a motorway now are used as motorway links [#4842](https://github.com/Project-OSRM/osrm-backend/pull/4842)
78
- Profile:
89
- FIXED: `highway=service` will now be used for restricted access, `access=private` is still disabled for snapping.
910
- 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: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Feature: Motorway Guidance
8181
"""
8282
,g,e
8383
,f,d
84-
a-b-c
84+
a-b-c
8585
"""
8686

8787
And the ways
@@ -281,3 +281,21 @@ Feature: Motorway Guidance
281281
| waypoints | route | turns |
282282
| a,d | , | depart,arrive |
283283
| b,d | , | depart,arrive |
284+
285+
286+
Scenario: Ramp Exit with Lower Priority
287+
Given the node map
288+
"""
289+
a-b-c-d-e
290+
`--f-g
291+
"""
292+
293+
And the ways
294+
| nodes | highway | oneway |
295+
| abcde | trunk | |
296+
| bfg | primary_link | yes |
297+
298+
When I route I should get
299+
| waypoints | route | turns |
300+
| a,e | abcde,abcde | depart,arrive |
301+
| a,g | abcde,bfg,bfg | depart,off ramp slight right,arrive |

src/guidance/motorway_handler.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,13 @@ inline extractor::RoadClassification roadClass(const ConnectedRoad &road,
3131
return graph.GetEdgeData(road.eid).flags.road_classification;
3232
}
3333

34-
inline bool isRampClass(EdgeID eid, const util::NodeBasedDynamicGraph &node_based_graph)
34+
inline bool isRampClass(EdgeID eid,
35+
const util::NodeBasedDynamicGraph &node_based_graph,
36+
bool from_motorway = true)
3537
{
36-
return node_based_graph.GetEdgeData(eid).flags.road_classification.IsRampClass();
38+
return node_based_graph.GetEdgeData(eid).flags.road_classification.IsRampClass() ||
39+
(from_motorway &&
40+
node_based_graph.GetEdgeData(eid).flags.road_classification.IsLinkClass());
3741
}
3842

3943
} // namespace
@@ -63,6 +67,8 @@ bool MotorwayHandler::canProcess(const NodeID,
6367
const EdgeID via_eid,
6468
const Intersection &intersection) const
6569
{
70+
const bool from_motorway = isMotorwayClass(via_eid, node_based_graph);
71+
6672
bool has_motorway = false;
6773
bool has_normal_roads = false;
6874

@@ -76,14 +82,14 @@ bool MotorwayHandler::canProcess(const NodeID,
7682
if (road.entry_allowed)
7783
has_motorway = true;
7884
}
79-
else if (!isRampClass(road.eid, node_based_graph))
85+
else if (!isRampClass(road.eid, node_based_graph, from_motorway))
8086
has_normal_roads = true;
8187
}
8288

8389
if (has_normal_roads)
8490
return false;
8591

86-
return has_motorway || isMotorwayClass(via_eid, node_based_graph);
92+
return has_motorway || from_motorway;
8793
}
8894

8995
Intersection MotorwayHandler::

0 commit comments

Comments
 (0)