Adjust Straight direction modifiers of side roads in driveway handler
This commit is contained in:
parent
6f4af330ed
commit
4d0fb89489
@ -46,3 +46,23 @@ Feature: Driveways intersections
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns | locations |
|
| waypoints | route | turns | locations |
|
||||||
| a,d | ,second | depart,arrive | a,d |
|
| a,d | ,second | depart,arrive | a,d |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Road with a turn to service road
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
/-----------------e
|
||||||
|
a---b------------------c
|
||||||
|
`-----------------d
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | highway | name | oneway |
|
||||||
|
| abc | trunk | road | yes |
|
||||||
|
| bd | service | serv | yes |
|
||||||
|
| be | service | serv | yes |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| waypoints | route | turns | locations |
|
||||||
|
| a,d | road,serv,serv | depart,turn slight right,arrive | a,b,d |
|
||||||
|
| a,e | road,serv,serv | depart,turn slight left,arrive | a,b,e |
|
||||||
|
@ -78,6 +78,18 @@ operator()(const NodeID nid, const EdgeID source_edge_id, Intersection intersect
|
|||||||
road->instruction.type =
|
road->instruction.type =
|
||||||
isSameName(source_edge_id, road->eid) ? TurnType::NoTurn : TurnType::NewName;
|
isSameName(source_edge_id, road->eid) ? TurnType::NoTurn : TurnType::NewName;
|
||||||
|
|
||||||
|
if (road->instruction.direction_modifier == DirectionModifier::Straight)
|
||||||
|
{
|
||||||
|
std::for_each(intersection.begin() + 1, road, [](auto &side_road) {
|
||||||
|
if (side_road.instruction.direction_modifier == DirectionModifier::Straight)
|
||||||
|
side_road.instruction.direction_modifier = DirectionModifier::SlightRight;
|
||||||
|
});
|
||||||
|
std::for_each(road + 1, intersection.end(), [](auto &side_road) {
|
||||||
|
if (side_road.instruction.direction_modifier == DirectionModifier::Straight)
|
||||||
|
side_road.instruction.direction_modifier = DirectionModifier::SlightLeft;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return intersection;
|
return intersection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user