fix roundabout handling with lanes

instead of artificially removing lanes from a roundabout, we don't assing them in the first place.
this also prevents a problem where we would end up collapsing turns with lanes in a roundabout
This commit is contained in:
Moritz Kobitzsch
2016-12-15 11:02:10 +01:00
parent e48ca65af4
commit d584bcad11
10 changed files with 33 additions and 49 deletions
-23
View File
@@ -180,29 +180,6 @@ std::vector<RouteStep> anticipateLaneChange(std::vector<RouteStep> steps,
return steps;
}
std::vector<RouteStep> removeLanesFromRoundabouts(std::vector<RouteStep> steps)
{
using namespace util::guidance;
const auto removeLanes = [](RouteStep &step) {
for (auto &intersection : step.intersections)
{
intersection.lane_description = {};
intersection.lanes = {};
}
};
for (auto &step : steps)
{
const auto inst = step.maneuver.instruction;
if (entersRoundabout(inst) || staysOnRoundabout(inst) || leavesRoundabout(inst))
removeLanes(step);
}
return steps;
}
} // namespace guidance
} // namespace engine
} // namespace osrm
+4
View File
@@ -1053,9 +1053,13 @@ std::vector<RouteStep> collapseTurns(std::vector<RouteStep> steps)
const auto &current_step = steps[step_index];
const auto next_step_index = step_index + 1;
const auto one_back_index = getPreviousIndex(step_index, steps);
BOOST_ASSERT(one_back_index < steps.size());
const auto &one_back_step = steps[one_back_index];
if (hasRoundaboutType(current_step.maneuver.instruction) ||
hasRoundaboutType(one_back_step.maneuver.instruction))
continue;
if (!hasManeuver(one_back_step, current_step))
continue;