From 13aa0b07db6fb8643e384b5763aaea51a5ddb83f Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Wed, 19 Feb 2014 11:18:20 +0100 Subject: [PATCH] [geometry] Append without duplicates, fixed 3 calls --- .../geometry/algorithms/detail/overlay/copy_segments.hpp | 2 +- .../boost/geometry/algorithms/detail/overlay/traverse.hpp | 6 ++++-- test/multi/algorithms/multi_union.cpp | 4 +--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp b/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp index 7c8f2c1f5..8d487d599 100644 --- a/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp @@ -93,7 +93,7 @@ struct copy_segments_ring for (size_type i = 0; i < count; ++i, ++it) { - traits::push_back::apply(current_output, *it); + detail::overlay::append_no_dups_or_spikes(current_output, *it); } } }; diff --git a/include/boost/geometry/algorithms/detail/overlay/traverse.hpp b/include/boost/geometry/algorithms/detail/overlay/traverse.hpp index a2ad5de93..82e25e99c 100644 --- a/include/boost/geometry/algorithms/detail/overlay/traverse.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/traverse.hpp @@ -139,7 +139,7 @@ inline bool assign_next_ip(G1 const& g1, G2 const& g2, seg_id = info.seg_id; } - traits::push_back::apply(current_output, ip->point); + detail::overlay::append_no_dups_or_spikes(current_output, ip->point); return true; } @@ -279,7 +279,7 @@ public : set_visited_for_continue(*it, *iit); ring_type current_output; - geometry::append(current_output, it->point); + detail::overlay::append_no_dups_or_spikes(current_output, it->point); turn_iterator current = it; turn_operation_iterator_type current_iit = iit; @@ -391,7 +391,9 @@ public : detail::overlay::debug_traverse(*current, *iit, "->Finished"); if (geometry::num_points(current_output) >= min_num_points) { + // TODO this call should go, it should already be clean from dups/spikes clean_dups_and_spikes(current_output, rescale_policy); + // END TODO rings.push_back(current_output); } } diff --git a/test/multi/algorithms/multi_union.cpp b/test/multi/algorithms/multi_union.cpp index 8ff3d115f..2e1e309a6 100644 --- a/test/multi/algorithms/multi_union.cpp +++ b/test/multi/algorithms/multi_union.cpp @@ -117,11 +117,9 @@ void test_areal() ggl_list_20120915_h2[0], ggl_list_20120915_h2[2], 1, 0, 12, 23.0); // Area from SQL Server -#if 0 test_one("ggl_list_20140212_sybren", ggl_list_20140212_sybren[0], ggl_list_20140212_sybren[1], - 1, 0, 12, 23.0); -#endif + 2, 0, 16, 0.002471626); test_one("ticket_9081", ticket_9081[0], ticket_9081[1],