From bb60749540deaa5d01a240bf8bf2656321d6dfde Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Wed, 12 Feb 2014 16:36:58 +0100 Subject: [PATCH] [geometry] Use fraction instead of distance for "follow" and enrichment --- .../algorithms/detail/overlay/enrich_intersection_points.hpp | 3 +-- include/boost/geometry/algorithms/detail/overlay/follow.hpp | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp b/include/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp index fda98bece..63378e204 100644 --- a/include/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp @@ -264,8 +264,7 @@ inline void enrich_sort(Container& operations, if (prev_op.seg_id == op.seg_id && (turn_points[prev->index].method != method_crosses || turn_points[it->index].method != method_crosses) - && geometry::math::equals(prev_op.enriched.distance, - op.enriched.distance)) + && prev_op.fraction == op.fraction) { if (begin_cluster == boost::end(operations)) { diff --git a/include/boost/geometry/algorithms/detail/overlay/follow.hpp b/include/boost/geometry/algorithms/detail/overlay/follow.hpp index 56cd1bc6a..bd2d67ed7 100644 --- a/include/boost/geometry/algorithms/detail/overlay/follow.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/follow.hpp @@ -304,9 +304,9 @@ class follow inline bool use_distance(Turn const& left, Turn const& right) const { - return geometry::math::equals(left.operations[0].enriched.distance, right.operations[0].enriched.distance) + return left.operations[0].fraction == right.operations[0].fraction ? use_operation(left, right) - : left.operations[0].enriched.distance < right.operations[0].enriched.distance + : left.operations[0].fraction < right.operations[0].fraction ; }