turn lane handler moved to scenario based handling

This commit is contained in:
Moritz Kobitzsch
2016-06-30 09:31:08 +02:00
parent 802b93fa9a
commit 3b81b39998
21 changed files with 955 additions and 292 deletions
+14 -3
View File
@@ -331,8 +331,6 @@ void closeOffRoundabout(const bool on_roundabout,
OSRM_ATTR_WARN_UNUSED
RouteStep elongate(RouteStep step, const RouteStep &by_step)
{
BOOST_ASSERT(step.mode == by_step.mode);
step.duration += by_step.duration;
step.distance += by_step.distance;
@@ -418,6 +416,11 @@ void collapseTurnAt(std::vector<RouteStep> &steps,
DirectionModifier::Straight &&
one_back_step.intersections.front().bearings.size() > 2)
steps[step_index].maneuver.instruction.type = TurnType::Turn;
else if (TurnType::UseLane == current_step.maneuver.instruction.type &&
current_step.maneuver.instruction.direction_modifier !=
DirectionModifier::Straight &&
one_back_step.intersections.front().bearings.size() > 2)
steps[step_index].maneuver.instruction.type = TurnType::Turn;
steps[two_back_index] = elongate(std::move(steps[two_back_index]), one_back_step);
// If the previous instruction asked to continue, the name change will have to
@@ -741,7 +744,8 @@ std::vector<RouteStep> collapseTurns(std::vector<RouteStep> steps)
if (current_step.maneuver.instruction.type == TurnType::Suppressed &&
compatible(one_back_step, current_step))
{
// Traffic light on the sliproad
// Traffic light on the sliproad, the road itself will be handled in the next
// iteration, when one-back-index again points to the sliproad.
steps[one_back_index] =
elongate(std::move(steps[one_back_index]), steps[step_index]);
invalidateStep(steps[step_index]);
@@ -764,6 +768,13 @@ std::vector<RouteStep> collapseTurns(std::vector<RouteStep> steps)
elongate(std::move(steps[one_back_index]), steps[step_index]);
steps[one_back_index].name_id = steps[step_index].name_id;
steps[one_back_index].name = steps[step_index].name;
steps[one_back_index].maneuver.instruction.type = TurnType::Turn;
// the turn lanes for this turn are on the sliproad itself, so we have to
// remember them
steps[one_back_index].intersections.front().lanes =
current_step.intersections.front().lanes;
steps[one_back_index].intersections.front().lane_description =
current_step.intersections.front().lane_description;
const auto exit_intersection = steps[step_index].intersections.front();
const auto exit_bearing = exit_intersection.bearings[exit_intersection.out];