diff --git a/include/boost/geometry/algorithms/detail/overlay/handle_colocations.hpp b/include/boost/geometry/algorithms/detail/overlay/handle_colocations.hpp index 9afea24c2..7803db970 100644 --- a/include/boost/geometry/algorithms/detail/overlay/handle_colocations.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/handle_colocations.hpp @@ -515,10 +515,10 @@ inline void gather_cluster_properties(Clusters& clusters, Turns& turns, continue; } - if (BOOST_GEOMETRY_CONDITION(OverlayType != overlay_difference) + if (BOOST_GEOMETRY_CONDITION(OverlayType == overlay_difference) && is_self_turn(turn)) { - // Difference needs the self-turns, TODO: investigate + // TODO: investigate continue; } diff --git a/test/algorithms/overlay/multi_overlay_cases.hpp b/test/algorithms/overlay/multi_overlay_cases.hpp index 8c7ae2ee8..45fc7b532 100644 --- a/test/algorithms/overlay/multi_overlay_cases.hpp +++ b/test/algorithms/overlay/multi_overlay_cases.hpp @@ -1561,6 +1561,12 @@ static std::string issue_888_53[2] = "MULTIPOLYGON(((0.659074 0.243756,0.649585 0.255543,0.651004 0.267233,0.699286 0.310525,0.701216 0.308798,0.659074 0.243756)),((0.65607 0.730838,0.614949 0.760619,0.558286 0.779383,0.569893 0.875763,0.926464 0.956953,0.711407 0.711132,0.702942 0.714146,0.699891 0.720104,0.697876 0.71595,0.65607 0.730838)),((0.6251 0.244006,0.638996 0.227311,0.643368 0.219514,0.606658 0.162855,0.590598 0.213071,0.6251 0.244006)),((0.338625 0.733712,0.323461 0.693095,0.220913 0.771732,0.287708 0.782026,0.338625 0.733712)),((0.315174 0.670899,0.28149 0.712736,0.315658 0.672196,0.315174 0.670899)),((0.625653 0.461363,0.623608 0.462931,0.62395 0.462979,0.625653 0.461363)),((0.794671 0.168431,0.730585 0.154935,0.713413 0.176264,0.756461 0.22946,0.794671 0.168431)),((0.597976 0.482587,0.619207 0.466306,0.621457 0.462628,0.611365 0.461203,0.597976 0.482587)),((0.679066 0.498397,0.646318 0.526268,0.676403 0.53804,0.682592 0.527448,0.679066 0.498397)),((0.402869 0.800065,0.401491 0.804374,0.540911 0.757512,0.402869 0.800065)),((0.402869 0.800065,0.406699 0.78809,0.398324 0.801466,0.402869 0.800065)),((0.719855 0.46368,0.757461 0.431674,0.746845 0.417494,0.719855 0.46368)),((0.719855 0.46368,0.696391 0.483651,0.701969 0.494288,0.719855 0.46368)),((0.746845 0.417494,0.77151 0.375285,0.749286 0.355358,0.736399 0.363101,0.750855 0.385413,0.725474 0.369665,0.721777 0.371886,0.701659 0.354888,0.691299 0.34846,0.665904 0.389973,0.666125 0.391796,0.698833 0.391926,0.669517 0.419742,0.670404 0.427047,0.716114 0.391995,0.727787 0.392041,0.746845 0.417494)),((0.708595 0.320188,0.709115 0.319338,0.706561 0.317049,0.708595 0.320188)),((0.708595 0.320188,0.692237 0.346927,0.701659 0.354888,0.725474 0.369665,0.736399 0.363101,0.708595 0.320188)),((0.473998 0.577658,0.465083 0.605533,0.471121 0.607993,0.530823 0.551344,0.52892 0.535542,0.473998 0.577658)),((0.473998 0.577658,0.487873 0.534273,0.527391 0.522848,0.524311 0.49727,0.509505 0.480347,0.503361 0.485845,0.506294 0.476676,0.501948 0.471709,0.484614 0.50262,0.430805 0.55077,0.4628 0.541521,0.434005 0.592872,0.447166 0.598234,0.473998 0.577658)),((0.509505 0.480347,0.515424 0.475051,0.507771 0.472056,0.506294 0.476676,0.509505 0.480347)),((0.502836 0.470125,0.507771 0.472056,0.515566 0.447682,0.515432 0.447663,0.502836 0.470125)),((0.502836 0.470125,0.499379 0.468772,0.501948 0.471709,0.502836 0.470125)),((0.502031 0.312271,0.526427 0.362556,0.518569 0.371997,0.535749 0.384573,0.533607 0.391271,0.511534 0.391183,0.515288 0.422347,0.497 0.445061,0.515432 0.447663,0.515759 0.44708,0.515566 0.447682,0.518387 0.44808,0.521031 0.470034,0.541862 0.451393,0.57156 0.455585,0.561152 0.434132,0.580186 0.417099,0.620502 0.446609,0.654849 0.391752,0.608717 0.391569,0.660475 0.345254,0.658385 0.328037,0.613594 0.300245,0.623065 0.288482,0.6106 0.27795,0.602098 0.293112,0.590314 0.2858,0.553002 0.330628,0.571143 0.273905,0.445637 0.196032,0.494788 0.297342,0.499477 0.291064,0.502031 0.312271),(0.537856 0.386115,0.535749 0.384573,0.536289 0.382885,0.537856 0.386115),(0.537856 0.386115,0.54201 0.389156,0.540339 0.391232,0.537856 0.386115)),((0.502031 0.312271,0.494788 0.297342,0.467142 0.334354,0.50832 0.364495,0.502031 0.312271)),((0.50832 0.364495,0.510405 0.381806,0.518569 0.371997,0.50832 0.364495)),((0.509635 0.623684,0.524665 0.629807,0.538821 0.617759,0.534711 0.583632,0.509635 0.623684)),((0.509635 0.623684,0.471121 0.607993,0.461323 0.617289,0.432133 0.708562,0.48428 0.664179,0.509635 0.623684)),((0.465083 0.605533,0.447166 0.598234,0.418801 0.619985,0.373678 0.700452,0.461323 0.617289,0.465083 0.605533)),((0.374931 0.830954,0.37797 0.839093,0.529874 0.788791,0.539477 0.772358,0.374931 0.830954)),((0.374931 0.830954,0.369376 0.816075,0.340592 0.843183,0.374931 0.830954)),((0.524311 0.49727,0.542793 0.518396,0.556414 0.514458,0.576592 0.498985,0.521942 0.477601,0.524311 0.49727)),((0.530823 0.551344,0.534711 0.583632,0.561889 0.540224,0.553113 0.530193,0.530823 0.551344)),((0.527391 0.522848,0.52892 0.535542,0.5462 0.522291,0.542793 0.518396,0.527391 0.522848)),((0.539477 0.772358,0.556701 0.766224,0.55437 0.746871,0.539477 0.772358)),((0.483053 0.462384,0.453094 0.450661,0.359867 0.562668,0.372228 0.567704,0.406154 0.557896,0.483053 0.462384)),((0.483053 0.462384,0.499379 0.468772,0.488199 0.455992,0.483053 0.462384)),((0.430805 0.55077,0.406154 0.557896,0.391829 0.575689,0.399476 0.578805,0.430805 0.55077)),((0.359867 0.562668,0.315812 0.54472,0.320962 0.582524,0.350431 0.574005,0.359867 0.562668)),((0.467142 0.334354,0.420948 0.300541,0.387037 0.34036,0.427828 0.386985,0.467142 0.334354)),((0.431222 0.390865,0.467936 0.43283,0.502629 0.391148,0.431222 0.390865)),((0.431222 0.390865,0.427828 0.386985,0.424949 0.39084,0.431222 0.390865)),((0.467936 0.43283,0.461881 0.440105,0.476049 0.442104,0.467936 0.43283)),((0.453094 0.450661,0.461881 0.440105,0.405934 0.432208,0.453094 0.450661)),((0.340592 0.843183,0.281925 0.864075,0.277228 0.872453,0.327022 0.855964,0.340592 0.843183)),((0.350431 0.574005,0.324109 0.60563,0.33042 0.651962,0.391829 0.575689,0.372228 0.567704,0.350431 0.574005)),((0.354048 0.77502,0.369376 0.816075,0.409979 0.777834,0.432133 0.708562,0.354048 0.77502)),((0.354048 0.77502,0.345181 0.751271,0.344189 0.75304,0.347896 0.780256,0.354048 0.77502)),((0.434005 0.592872,0.399476 0.578805,0.378706 0.59739,0.330739 0.654302,0.334835 0.684373,0.418801 0.619985,0.434005 0.592872)),((0.373678 0.700452,0.341221 0.73125,0.34324 0.746072,0.345181 0.751271,0.373678 0.700452)),((0.281925 0.864075,0.311609 0.81114,0.226024 0.883982,0.281925 0.864075)),((0.311609 0.81114,0.336908 0.789608,0.324735 0.787732,0.311609 0.81114)),((0.347896 0.780256,0.336908 0.789608,0.349433 0.791538,0.347896 0.780256)),((0.712142 0.513687,0.759426 0.603857,0.780122 0.563447,0.712142 0.513687)),((0.712142 0.513687,0.701969 0.494288,0.697077 0.50266,0.712142 0.513687)),((0.582796 0.506832,0.561889 0.540224,0.590925 0.573414,0.617678 0.550644,0.59637 0.506724,0.590761 0.504529,0.582796 0.506832)),((0.582796 0.506832,0.585522 0.502479,0.583256 0.501592,0.575516 0.508936,0.582796 0.506832)),((0.575516 0.508936,0.556414 0.514458,0.5462 0.522291,0.553113 0.530193,0.575516 0.508936)),((0.759426 0.603857,0.716989 0.686719,0.779237 0.641637,0.759426 0.603857)),((0.675652 0.470277,0.670404 0.427047,0.632981 0.455744,0.647385 0.466287,0.675652 0.470277)),((0.675652 0.470277,0.677877 0.488607,0.6847 0.493601,0.696391 0.483651,0.690475 0.472369,0.675652 0.470277)),((0.669517 0.419742,0.666125 0.391796,0.664792 0.391791,0.62793 0.452047,0.632188 0.455163,0.669517 0.419742)),((0.660475 0.345254,0.664289 0.376674,0.684569 0.344284,0.670981 0.335853,0.660475 0.345254)),((0.576592 0.498985,0.583256 0.501592,0.590205 0.494998,0.590473 0.49457,0.58827 0.49003,0.576592 0.498985)),((0.692237 0.346927,0.686139 0.341775,0.684569 0.344284,0.691299 0.34846,0.692237 0.346927)),((0.675782 0.67041,0.640975 0.598666,0.629779 0.617826,0.675782 0.67041)),((0.675782 0.67041,0.692351 0.704562,0.700498 0.698662,0.675782 0.67041)),((0.629779 0.617826,0.590925 0.573414,0.538821 0.617759,0.541078 0.636494,0.554323 0.64189,0.54301 0.652544,0.55437 0.746871,0.629779 0.617826)),((0.716989 0.686719,0.700498 0.698662,0.707042 0.706142,0.716989 0.686719)))" }; +static std::string issue_900[2] = +{ + "MULTIPOLYGON(((5 3,6 4,5 2,4 4,5 3)),((4 4,4 6,6 4,4 4)),((6 4,6 5,8 4,6 4)),((4 4,2 4,2 5,4 4)))", + "MULTIPOLYGON(((1 1,1 6,9 6,9 1,1 1)))" +}; + // For intersection / integer static std::string issue_930[2] = { diff --git a/test/algorithms/set_operations/difference/difference_multi.cpp b/test/algorithms/set_operations/difference/difference_multi.cpp index 60447937d..d1d89a99c 100644 --- a/test/algorithms/set_operations/difference/difference_multi.cpp +++ b/test/algorithms/set_operations/difference/difference_multi.cpp @@ -220,6 +220,8 @@ void test_areal() TEST_DIFFERENCE_WITH(0, 1, issue_888_53, 117, 0.2973268, 17, 0.0525798, 134); } + TEST_DIFFERENCE(issue_900, 0, 0.0, 2, 35, 2); + // Areas and #clips correspond with POSTGIS (except sym case) test_one("case_101_multi", case_101_multi[0], case_101_multi[1], @@ -357,11 +359,7 @@ void test_areal() TEST_DIFFERENCE(case_recursive_boxes_59, 8, 6.5, 7, 7.0, 12); TEST_DIFFERENCE(case_recursive_boxes_60, 6, 5.25, 7, 5.25, 11); TEST_DIFFERENCE(case_recursive_boxes_61, 2, 1.5, 6, 2.0, 7); -#if defined(BOOST_GEOMETRY_TEST_FAILURES) - // Misses one triangle, should be fixed in traversal. - // It is not related to rescaling. TEST_DIFFERENCE(case_recursive_boxes_62, 5, 5.0, 11, 5.75, 12); -#endif TEST_DIFFERENCE(case_recursive_boxes_63, 9, 10.5, 5, 27.75, 4); TEST_DIFFERENCE(case_recursive_boxes_64, 6, 2.75, 7, 4.5, 11);