add a toolkit function to find lanes to the left/right of turn lanes

This commit is contained in:
karenzshea
2016-10-04 15:28:13 -04:00
committed by Moritz Kobitzsch
parent 17eb664597
commit 72fa35da10
16 changed files with 99 additions and 70 deletions
+5 -7
View File
@@ -4,7 +4,7 @@
#include "extractor/guidance/turn_instruction.hpp"
#include "engine/guidance/post_processing.hpp"
#include "engine/guidance/toolkit.hpp"
#include "extractor/guidance/toolkit.hpp"
#include <iterator>
#include <unordered_set>
@@ -16,6 +16,8 @@ namespace DirectionModifier = osrm::extractor::guidance::DirectionModifier;
using osrm::util::guidance::isLeftTurn;
using osrm::util::guidance::isRightTurn;
using osrm::extractor::guidance::numLanesToTheRight;
using osrm::extractor::guidance::numLanesToTheLeft;
namespace osrm
{
@@ -80,12 +82,8 @@ std::vector<RouteStep> anticipateLaneChange(std::vector<RouteStep> steps,
// where lanes in the turn fan in but for example the overall lanes at that location
// fan out, we would have to know the asymmetric mapping of lanes. This is currently
// not possible at the moment. In the following we implement a heuristic instead.
const LaneID current_num_all_lanes =
current.intersections.front().lane_description.size();
const LaneID current_num_lanes_right_of_turn = current_lanes.first_lane_from_the_right;
const LaneID current_num_lanes_left_of_turn =
current_num_all_lanes -
(current_lanes.lanes_in_turn + current_num_lanes_right_of_turn);
const LaneID current_num_lanes_right_of_turn = numLanesToTheRight(current);
const LaneID current_num_lanes_left_of_turn = numLanesToTheLeft(current);
const LaneID num_shared_lanes = std::min(current_lanes.lanes_in_turn, //
previous_lanes.lanes_in_turn); //