From e5f2fd419b270d62a4b47d623bcbbd248c63ef8a Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sun, 5 Feb 2012 16:19:23 +0000 Subject: [PATCH] Fixed ticket #6019, when multiple points were on the left, the points below the point taken were popped out by the algorithm, because they were sorted from top to bottom. We therefore take the lower-left point such that there are no points below. This problem was not present at the right side but we now take there the upper right point. [SVN r76899] --- .../strategies/agnostic/hull_graham_andrew.hpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/include/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp b/include/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp index 9537d35ce..747c14075 100644 --- a/include/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp +++ b/include/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp @@ -225,8 +225,15 @@ public: { // First pass. // Get min/max (in most cases left / right) points - // This makes use of the geometry::less/greater predicates with the optional - // direction template parameter to indicate x direction + // This makes use of the geometry::less/greater predicates + + // For the left boundary it is important that multiple points + // are sorted from bottom to top. Therefore the less predicate + // does not take the x-only template parameter (this fixes ticket #6019. + // For the right boundary it is not necessary (though also not harmful), + // because points are sorted from bottom to top in a later stage. + // For symmetry and to get often more balanced lower/upper halves + // we keep it. typedef typename geometry::detail::range_type::type range_type; @@ -239,8 +246,8 @@ public: < range_type, range_iterator, - geometry::less, - geometry::greater + geometry::less, + geometry::greater > extremes; geometry::detail::for_each_range(geometry, extremes);