use enter + exit for roundabout instructions

This commit is contained in:
Moritz Kobitzsch
2017-07-28 14:38:23 +02:00
committed by Daniel Patterson
parent f4dc93ae66
commit 28ddd983b3
20 changed files with 630 additions and 1165 deletions
+2 -2
View File
@@ -167,12 +167,12 @@ class RouteAPI : public BaseAPI
* the overall response consistent.
*
* ⚠ CAUTION: order of post-processing steps is important
* - postProcess must be called before collapseTurnInstructions that expects
* - handleRoundabouts must be called before collapseTurnInstructions that expects
* post-processed roundabouts without Exit instructions
*/
guidance::trimShortSegments(steps, leg_geometry);
leg.steps = guidance::postProcess(std::move(steps));
leg.steps = guidance::handleRoundabouts(std::move(steps));
leg.steps = guidance::collapseTurnInstructions(std::move(leg.steps));
leg.steps = guidance::anticipateLaneChange(std::move(leg.steps));
leg.steps = guidance::buildIntersections(std::move(leg.steps));
+1 -1
View File
@@ -17,7 +17,7 @@ namespace guidance
// passed as none-reference to modify in-place and move out again
OSRM_ATTR_WARN_UNUSED
std::vector<RouteStep> postProcess(std::vector<RouteStep> steps);
std::vector<RouteStep> handleRoundabouts(std::vector<RouteStep> steps);
// trim initial/final segment of very short length.
// This function uses in/out parameter passing to modify both steps and geometry in place.
@@ -199,7 +199,10 @@ inline bool leavesRoundabout(const extractor::guidance::TurnInstruction instruct
inline bool staysOnRoundabout(const extractor::guidance::TurnInstruction instruction)
{
return instruction.type == extractor::guidance::TurnType::StayOnRoundabout;
return instruction.type == extractor::guidance::TurnType::StayOnRoundabout ||
instruction.type == extractor::guidance::TurnType::EnterRoundaboutAtExit ||
instruction.type == extractor::guidance::TurnType::EnterRotaryAtExit ||
instruction.type == extractor::guidance::TurnType::EnterRoundaboutIntersectionAtExit;
}
// Silent Turn Instructions are not to be mentioned to the outside world but