fix errors introduced in refactor

This commit is contained in:
Moritz Kobitzsch
2016-08-12 17:04:40 +02:00
committed by Patrick Niklaus
parent e14bc30428
commit e8bae78749
5 changed files with 11 additions and 10 deletions
@@ -104,9 +104,7 @@ LaneDataVector laneDataFromDescription(const TurnLaneDescription &turn_lane_desc
// transform the map into the lane data vector
LaneDataVector lane_data;
for (const auto tag : lane_map)
{
lane_data.push_back({tag.first, tag.second.first, tag.second.second});
}
std::sort(lane_data.begin(), lane_data.end());
+5 -4
View File
@@ -128,7 +128,7 @@ Intersection TurnLaneHandler::assignTurnLanes(const NodeID at,
// FIXME the lane to add depends on the side of driving/u-turn rules in the country
if (!lane_data.empty() && canMatchTrivially(intersection, lane_data) &&
!is_missing_valid_u_turn && !hasTag(TurnLaneType::none, lane_data))
is_missing_valid_u_turn && !hasTag(TurnLaneType::none, lane_data))
lane_data.push_back({TurnLaneType::uturn, lane_data.back().to, lane_data.back().to});
bool is_simple = isSimpleIntersection(lane_data, intersection);
@@ -374,7 +374,10 @@ bool TurnLaneHandler::isSimpleIntersection(const LaneDataVector &lane_data,
all_simple &= (matched_indices.count(match_index) == 0);
matched_indices.insert(match_index);
// in case of u-turns, we might need to activate them first
all_simple &= (best_match->entry_allowed || match_index == 0);
all_simple &= (best_match->entry_allowed ||
// check for possible u-turn match on non-reversed edge
((match_index == 0 || match_index + 1 == intersection.size()) &&
!node_based_graph.GetEdgeData(best_match->turn.eid).reversed));
all_simple &= isValidMatch(data.tag, best_match->turn.instruction);
}
@@ -474,8 +477,6 @@ std::pair<LaneDataVector, LaneDataVector> TurnLaneHandler::partitionLaneData(
straightmost_tag_index = none_index;
}
// TODO handle reverse
// handle none values
if (none_index != turn_lane_data.size())
{
+3 -1
View File
@@ -137,7 +137,7 @@ typename Intersection::const_iterator
findBestMatchForReverse(const TurnLaneType::Mask &neighbor_tag, const Intersection &intersection)
{
const auto neighbor_itr = findBestMatch(neighbor_tag, intersection);
if ((neighbor_itr + 1 == intersection.cend()) || (neighbor_itr == intersection.cbegin() + 1))
if (neighbor_itr + 1 == intersection.cend())
return intersection.begin();
const constexpr double idealized_turn_angles[] = {0, 35, 90, 135, 180, 225, 270, 315};
@@ -239,6 +239,8 @@ Intersection triviallyMatchLanesToTurns(Intersection intersection,
// continue with the first lane
lane = 1;
}
else
return intersection;
}
for (; road_index < intersection.size() && lane < lane_data.size(); ++road_index)