From 556896c7cc0f91a6f4e87aceddae0162a33591fe Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Fri, 15 Dec 2017 14:37:17 +0100 Subject: [PATCH] [traverse] need to select on operations in selecting ranks, it is not done later. Small regression found by recursive_polygons --- .../boost/geometry/algorithms/detail/overlay/traversal.hpp | 6 ++++++ test/algorithms/overlay/multi_overlay_cases.hpp | 7 +++++++ .../set_operations/intersection/intersection_multi.cpp | 2 ++ 3 files changed, 15 insertions(+) diff --git a/include/boost/geometry/algorithms/detail/overlay/traversal.hpp b/include/boost/geometry/algorithms/detail/overlay/traversal.hpp index 75807a203..92827e556 100644 --- a/include/boost/geometry/algorithms/detail/overlay/traversal.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/traversal.hpp @@ -479,6 +479,12 @@ struct traversal } turn_operation_type const& op = operation_from_rank(rp); + if (op.operation != target_operation + && op.operation != operation_continue) + { + continue; + } + if (op.enriched.region_id == incoming_op.enriched.region_id || (skip_isolated && ! op.enriched.isolated)) { diff --git a/test/algorithms/overlay/multi_overlay_cases.hpp b/test/algorithms/overlay/multi_overlay_cases.hpp index 69d594637..02da0fbf9 100644 --- a/test/algorithms/overlay/multi_overlay_cases.hpp +++ b/test/algorithms/overlay/multi_overlay_cases.hpp @@ -1250,6 +1250,13 @@ static std::string case_recursive_boxes_82[2] = "MULTIPOLYGON(((2 4,2 5,4 5,4 4,2 4)),((2 4,2 3,5 3,5 2,4 2,4 1,1 1,1 2,0 2,0 5,1 5,1 4,2 4),(2 2,1 2,1.5 1.5,2 2),(3 2,3.5 1.5,4 2,3 2)),((4 4,5 5,5 4,4 4)))" }; +static std::string case_recursive_boxes_83[2] = +{ + // Needs to select on operation in cluster + "MULTIPOLYGON(((2 1,2 0,1 0,1 4,2 4,2 5,3 5,4 4,4 3,5 3,4 2,5 2,5 0,4 0,4 1,3 0,3 1,2 1),(2 3,1 3,2 2,2 3),(3 2,3 3,2 2,3 2)),((0 2,1 1,0 0,0 2)),((0 2,0 3,1 3,0 2)),((4 4,4 5,5 4,4 4)))", + "MULTIPOLYGON(((2 0,1 0,1 2,2 2,2 5,3 4,3 5,4 5,4 4,5 5,5 3,4 3,4 1,5 1,5 0,2 0),(2 1,3 2,2 2,2 1)),((0 5,1 5,1 4,0 4,0 5)),((1 1,0 1,0 2,1 1)),((1 2,0 2,1 3,1 2)))" +}; + static std::string pie_21_7_21_0_3[2] = { "MULTIPOLYGON(((2500 2500,2500 3875,2855 3828,3187 3690,3472 3472,3690 3187,3828 2855,3875 2500,3828 2144,3690 1812,3472 1527,3187 1309,2855 1171,2499 1125,2144 1171,1812 1309,1527 1527,1309 1812,1171 2144,1125 2499,1171 2855,1309 3187,2500 2500)))", diff --git a/test/algorithms/set_operations/intersection/intersection_multi.cpp b/test/algorithms/set_operations/intersection/intersection_multi.cpp index b48f36c81..69e4812f9 100644 --- a/test/algorithms/set_operations/intersection/intersection_multi.cpp +++ b/test/algorithms/set_operations/intersection/intersection_multi.cpp @@ -362,6 +362,8 @@ void test_areal() TEST_INTERSECTION_IGNORE(case_recursive_boxes_82, 3, -1, 8.5); #endif + TEST_INTERSECTION_IGNORE(case_recursive_boxes_83, 5, -1, 10.25); + test_one("ggl_list_20120915_h2_a", ggl_list_20120915_h2[0], ggl_list_20120915_h2[1], 2, 10, 6.0); // Area from SQL Server