Skip to content

demote trunk from divided highways to normal roads, anounce ramps whe… #4275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions features/car/classes.feature
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ Feature: Car - Mode flag
| cd | primary |

When I route I should get
| from | to | route | turns | classes | # |
| a | d | ab,bc,cd | depart,notification right,arrive | ,motorway, | |
| a | c | ab,bc,bc | depart,notification right,arrive | ,motorway,motorway | |
| b | d | bc,cd | depart,arrive | motorway, | we don't announce when we leave the highway |
| from | to | route | turns | classes | # |
| a | d | ab,bc,cd | depart,on ramp right,arrive | ,motorway, | |
| a | c | ab,bc,bc | depart,on ramp right,arrive | ,motorway,motorway | |
| b | d | bc,cd | depart,arrive | motorway, | we don't announce when we leave the highway |

Scenario: Car - We tag motorway_link with a class
Given the node map
Expand Down Expand Up @@ -73,16 +73,16 @@ Feature: Car - Mode flag
"""

And the ways
| nodes | highway | access |
| ab | primary | private |
| bc | motorway| private |
| cd | primary | |
| nodes | highway | access |
| ab | primary | private |
| bc | motorway | private |
| cd | primary | |

When I route I should get
| from | to | route | turns | classes |
| a | d | ab,bc,cd | depart,notification right,arrive| restricted,motorway;restricted, |
| from | to | route | turns | classes |
| a | d | ab,bc,cd | depart,on ramp right,arrive | restricted,motorway;restricted, |

Scenario: Car - We toll restricted with a class
Scenario: Car - We tag toll with a class
Given the node map
"""
a b
Expand All @@ -96,6 +96,6 @@ Feature: Car - Mode flag
| cd | primary | |

When I route I should get
| from | to | route | turns | classes |
| a | d | ab,bc,cd | depart,notification right,arrive | toll,motorway;toll, |
| from | to | route | turns | classes |
| a | d | ab,bc,cd | depart,on ramp right,arrive | toll,motorway;toll, |

34 changes: 17 additions & 17 deletions features/guidance/dedicated-turn-roads.feature
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ Feature: Slipways and Dedicated Turn Lanes
| restriction | bc | cf | c | no_right_turn |

When I route I should get
| waypoints | route | turns | locations |
| a,g | first,second,second | depart,turn right,arrive | a,b,g |
| a,1 | first,, | depart,turn right,arrive | a,b,_ |
| waypoints | route | turns | locations |
| a,g | first,second,second | depart,turn right,arrive | a,b,g |
| a,1 | first,, | depart,turn slight right,arrive | a,b,_ |

Scenario: Turn Instead of Ramp
Given the node map
Expand All @@ -53,12 +53,12 @@ Feature: Slipways and Dedicated Turn Lanes
"""

And the ways
| nodes | highway | name | oneway | route |
| abc | trunk | first | yes | |
| cd | trunk | first | yes | |
| bhf | trunk_link | | yes | ferry |
| cfg | primary | second | yes | |
| ec | primary | second | yes | |
| nodes | highway | name | oneway | route |
| abc | motorway | first | yes | |
| cd | motorway | first | yes | |
| bhf | motorway_link | | yes | ferry |
| cfg | primary | second | yes | |
| ec | primary | second | yes | |

And the relations
| type | way:from | way:to | node:via | restriction |
Expand Down Expand Up @@ -100,9 +100,9 @@ Feature: Slipways and Dedicated Turn Lanes
| restriction | abc | cf | c | no_right_turn |

When I route I should get
| waypoints | route | turns |
| a,i | first,,second,second,second | depart,off ramp right,turn straight,notification straight,arrive |
| a,1 | first,, | depart,off ramp right,arrive |
| waypoints | route | turns |
| a,i | first,,second,second,second | depart,turn slight right,turn straight,notification straight,arrive |
| a,1 | first,, | depart,turn slight right,arrive |

Scenario: Turn Instead of Ramp - Max-Speed
Given the node map
Expand Down Expand Up @@ -133,9 +133,9 @@ Feature: Slipways and Dedicated Turn Lanes
| restriction | bc | cf | c | no_right_turn |

When I route I should get
| waypoints | route | turns | locations |
| a,g | first,second,second | depart,turn right,arrive | a,b,g |
| a,1 | first,, | depart,turn right,arrive | a,b,_ |
| waypoints | route | turns | locations |
| a,g | first,second,second | depart,turn right,arrive | a,b,g |
| a,1 | first,, | depart,turn slight right,arrive | a,b,_ |


Scenario: Turn Instead of Ramp
Expand Down Expand Up @@ -905,8 +905,8 @@ Feature: Slipways and Dedicated Turn Lanes
| restriction | yb | be | b | only_straight |

When I route I should get
| waypoints | route | turns | locations |
| z,t | through,,out,out | depart,off ramp slight right,round-exit-3,arrive | z,s,c,t |
| waypoints | route | turns | locations |
| z,t | through,,out,out | depart,turn slight right,round-exit-3,arrive | z,s,c,t |

Scenario: Sliproad before a roundabout
Given the node map
Expand Down
4 changes: 2 additions & 2 deletions features/guidance/turn.feature
Original file line number Diff line number Diff line change
Expand Up @@ -989,8 +989,8 @@ Feature: Simple Turns
| kh | kh | trunk_link | yes |

When I route I should get
| waypoints | turns | route |
| a,h | depart,off ramp right,turn sharp left,arrive | Blue Star Memorial Hwy,bcde,Centreville Road,Centreville Road |
| waypoints | turns | route |
| a,h | depart,turn right,turn sharp left,arrive | Blue Star Memorial Hwy,bcde,Centreville Road,Centreville Road |

@todo
# https://www.openstreetmap.org/#map=20/52.51609/13.41080
Expand Down
6 changes: 3 additions & 3 deletions profiles/lib/guidance.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ highway_classes = {

default_highway_class = road_priority_class.connectivity;

-- motorway types by default are divided. Trunk roads can be, but we cannot assume them to be by default,
-- since many trunk roads actually run throuhg cities. Motorway types will exhibit `on/off` ramps
motorway_types = Set {
'motorway',
'motorway_link',
'trunk',
'trunk_link'
'motorway_link'
}

-- these road types are set with a car in mind. For bicycle/walk we probably need different ones
Expand Down
5 changes: 3 additions & 2 deletions src/extractor/guidance/intersection_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ TurnType::Enum IntersectionHandler::findBasicTurnType(const EdgeID via_edge,
const auto &out_data = node_based_graph.GetEdgeData(road.eid);

bool on_ramp = in_data.road_classification.IsRampClass();

bool on_motorway = in_data.road_classification.IsMotorwayClass();
bool onto_ramp = out_data.road_classification.IsRampClass();
bool onto_motorway = out_data.road_classification.IsMotorwayClass();

if (!on_ramp && onto_ramp)
if (!on_ramp && !on_motorway && (onto_motorway || onto_ramp))
return TurnType::OnRamp;

const auto same_name = !util::guidance::requiresNameAnnounced(
Expand Down
4 changes: 3 additions & 1 deletion src/extractor/guidance/motorway_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ bool MotorwayHandler::canProcess(const NodeID,
for (const auto &road : intersection)
{
// not merging or forking?
if (road.entry_allowed && angularDeviation(road.angle, STRAIGHT_ANGLE) > 60)
if (road.entry_allowed && angularDeviation(road.angle, STRAIGHT_ANGLE) > 91)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why 91?!

return false;
else if (isMotorwayClass(road.eid, node_based_graph))
{
Expand All @@ -74,7 +74,9 @@ bool MotorwayHandler::canProcess(const NodeID,
}

if (has_normal_roads)
{
return false;
}

return has_motorway || isMotorwayClass(via_eid, node_based_graph);
}
Expand Down