From fa1a4e8bf6589f8483ff8fe412ee289db3615d52 Mon Sep 17 00:00:00 2001 From: Michael Krasnyk Date: Mon, 18 Sep 2017 18:31:25 +0200 Subject: [PATCH] Relax strict bearings ordering condition to non-strict one, #4331 --- src/extractor/guidance/intersection_generator.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/extractor/guidance/intersection_generator.cpp b/src/extractor/guidance/intersection_generator.cpp index b703b011e..21421f17b 100644 --- a/src/extractor/guidance/intersection_generator.cpp +++ b/src/extractor/guidance/intersection_generator.cpp @@ -192,10 +192,11 @@ IntersectionGenerator::ComputeIntersectionShape(const NodeID node_at_center_of_i next != intersection.end(); ++curr, ++next) { - if (!bearings_order(*curr, *next)) - { // If the true bearing is out of the initial order then adjust to keep the order. - // The adjustment angle is at most 0.5 degree or a half-angle - // between the current bearing and the base bearing to prevent overlaps. + if (bearings_order(*next, *curr)) + { // If the true bearing is out of the initial order (next before current) then + // adjust the next bearing to keep the order. The adjustment angle is at most + // 0.5° or a half-angle between the current bearing and the base bearing. + // to prevent overlapping over base bearing + 360°. const auto angle_adjustment = std::min( .5, util::restrictAngleToValidRange(base_bearing - curr->bearing) / 2.); next->bearing =