diff --git a/include/boost/geometry/algorithms/detail/overlay/get_clusters.hpp b/include/boost/geometry/algorithms/detail/overlay/get_clusters.hpp index 971cc7b6a9..544bf424ab 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_clusters.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_clusters.hpp @@ -35,20 +35,28 @@ namespace detail { namespace overlay template struct sweep_equal_policy { +private: + template + static inline T threshold() + { + // Tuned by cases of #1081 + return T(3); + } +public: template static inline bool equals(P const& p1, P const& p2) { - // Points within a epsilon are considered as equal + // Points within a some epsilons are considered as equal using coor_t = typename coordinate_type

::type; - return approximately_equals(p1, p2, coor_t(1)); + return approximately_equals(p1, p2, threshold()); } template static inline bool exceeds(T value) { // This threshold is an arbitrary value - // as long as it is than the used epsilon - T const limit = T(1) / T(1); + // as long as it is bigger than the used value above + T const limit = T(1) / threshold(); return value > limit; } };