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:
@@ -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
|
||||
|
||||
@@ -1053,9 +1053,13 @@ std::vector<RouteStep> collapseTurns(std::vector<RouteStep> steps)
|
||||
const auto ¤t_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;
|
||||
|
||||
Reference in New Issue
Block a user