Considering multiple small turns, right after each

other can result in a combined turn angle that is
straight instead of turning left and right.
This commit is contained in:
Moritz Kobitzsch
2016-08-08 15:46:33 +02:00
parent 01a2c66472
commit 88c3f4c481
6 changed files with 260 additions and 20 deletions
@@ -549,6 +549,15 @@ Intersection IntersectionGenerator::AdjustForJoiningRoads(const NodeID node_at_i
for (std::size_t index = 1; index < intersection.size(); ++index)
{
auto &road = intersection[index];
// to find out about the above situation, we need to look at the next intersection (at d in
// the example). If the initial road can be merged to the left/right, we are about to adjust
// the angle.
const auto next_intersection_along_road =
GetConnectedRoads(node_at_intersection, road.turn.eid);
if (next_intersection_along_road.size() <= 1)
continue;
const auto node_at_next_intersection = node_based_graph.GetTarget(road.turn.eid);
const util::Coordinate coordinate_at_next_intersection =
node_info_list[node_at_next_intersection];
@@ -569,12 +578,6 @@ Intersection IntersectionGenerator::AdjustForJoiningRoads(const NodeID node_at_i
if (range.size() <= 1)
continue;
// to find out about the above situation, we need to look at the next intersection (at d in
// the example). If the initial road can be merged to the left/right, we are about to adjust
// the angle.
const auto next_intersection_along_road =
GetConnectedRoads(node_at_intersection, road.turn.eid);
// check if the u-turn edge at the next intersection could be merged to the left/right. If
// this is the case and the road is not far away (see previous distance check), if
// influences the perceived angle.
+1 -1
View File
@@ -28,7 +28,7 @@ using EdgeData = util::NodeBasedDynamicGraph::EdgeData;
bool requiresAnnouncement(const EdgeData &from, const EdgeData &to)
{
return !from.IsCompatibleTo(to);
return !from.CanCombineWith(to);
}
TurnAnalysis::TurnAnalysis(const util::NodeBasedDynamicGraph &node_based_graph,