handle throughabouts -- do not announce going through
This commit is contained in:
parent
8c9ae4d3b4
commit
0affec8f17
@ -14,6 +14,7 @@
|
||||
- Pass functions instead of strings to `WayHandlers.run()`, so it's possible to mix in your own functions.
|
||||
- Reorders arguments to `WayHandlers` functions to match `process_way()`.
|
||||
- Profiles must return a hash of profile functions. This makes it easier for profiles to include each other.
|
||||
- Guidance: add support for throughabouts
|
||||
|
||||
# 5.9.2
|
||||
- API:
|
||||
|
@ -568,4 +568,4 @@ Feature: Basic Roundabout
|
||||
|
||||
When I route I should get
|
||||
| waypoints | turns | route |
|
||||
| a,f | depart,turn right,roundabout turn straight exit-1,arrive | in,through,through,through |
|
||||
| a,f | depart,turn right,arrive | in,through,through |
|
||||
|
@ -763,7 +763,7 @@ Feature: Basic Roundabout
|
||||
|
||||
When I route I should get
|
||||
| waypoints | bearings | route | turns |
|
||||
| e,f | 90 90 | edf,edf,edf | depart,roundabout-exit-1,arrive |
|
||||
| e,f | 90 90 | edf,edf | depart,arrive |
|
||||
| e,h | 90 135 | edf,gch,gch | depart,roundabout-exit-2,arrive |
|
||||
| g,f | 45 90 | gch,edf,edf | depart,roundabout-exit-2,arrive |
|
||||
| g,h | 45 135 | gch,gch,gch | depart,roundabout-exit-1,arrive |
|
||||
@ -844,5 +844,5 @@ Feature: Basic Roundabout
|
||||
|
||||
When I route I should get
|
||||
| from | to | route | turns | distance |
|
||||
| e | k | ebds,ebds,ds,ufghl,jhik,jhik | depart,rotary-exit-1,rotary-exit-1,rstur-exit-2,turn right,arrive | 189.1m |
|
||||
| 1 | k | ebds,ds,ufghl,jhik,jhik | depart,rotary-exit-1,rstur-exit-2,turn right,arrive | 159.1m |
|
||||
| e | k | ebds,ufghl,jhik,jhik | depart,rstur-exit-2,turn right,arrive | 189.1m |
|
||||
| 1 | k | ebds,ufghl,jhik,jhik | depart,rstur-exit-2,turn right,arrive | 159.1m |
|
||||
|
@ -504,15 +504,23 @@ Intersection RoundaboutHandler::handleRoundabouts(const RoundaboutType roundabou
|
||||
}
|
||||
else
|
||||
{
|
||||
bool crossing_roundabout = false;
|
||||
for (std::size_t cnt = 0, idx = lhs ? intersection.size() - 1 : 0;
|
||||
cnt < intersection.size();
|
||||
++cnt, idx += step)
|
||||
{
|
||||
auto &road = intersection[idx];
|
||||
if (!road.entry_allowed)
|
||||
continue;
|
||||
auto &turn = road;
|
||||
auto &turn = intersection[idx];
|
||||
const auto &out_data = node_based_graph.GetEdgeData(turn.eid);
|
||||
|
||||
// A roundabout consists of exactly two roads at an intersection. by toggeling this
|
||||
// flag, we can switch between roads crossing the roundabout and roads that are on the
|
||||
// same side as via_eid.
|
||||
if (out_data.roundabout || out_data.circular)
|
||||
crossing_roundabout = !crossing_roundabout;
|
||||
|
||||
if (!turn.entry_allowed)
|
||||
continue;
|
||||
|
||||
if (out_data.roundabout || out_data.circular)
|
||||
{
|
||||
if (can_exit_roundabout_separately)
|
||||
@ -523,12 +531,25 @@ Intersection RoundaboutHandler::handleRoundabouts(const RoundaboutType roundabou
|
||||
roundabout_type, getTurnDirection(turn.angle));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Distinguish between throughabouts and entering a roundabout to directly exit: In
|
||||
// case of a throughabout, both enter and exit do not show roundabout tags (as we
|
||||
// already have checked, when arriving here) and the enter/exit are nearly straight
|
||||
// and on different sides of the roundabouts
|
||||
if (util::angularDeviation(turn.angle, STRAIGHT_ANGLE) < FUZZY_ANGLE_DIFFERENCE &&
|
||||
crossing_roundabout)
|
||||
{
|
||||
turn.instruction = getInstructionForObvious(
|
||||
intersection.size(), via_eid, isThroughStreet(idx, intersection), turn);
|
||||
}
|
||||
else
|
||||
{
|
||||
turn.instruction = TurnInstruction::ENTER_AND_EXIT_ROUNDABOUT(
|
||||
roundabout_type, getTurnDirection(turn.angle));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return intersection;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user