Merge pull request #210 from mkaravel/fix/more_test_cases_for_is_valid

[test][algorithms][is_valid] add a few more test cases
This commit is contained in:
Adam Wulkiewicz
2015-02-04 00:20:49 +01:00

View File

@@ -604,6 +604,52 @@ void test_open_polygons()
false);
test::apply(from_wkt<OG>("POLYGON((-10 -10,1 0,1 1,0 1),(-10 -10,-10 10,10 10,10 -10))"),
false);
test::apply
(from_wkt<OG>("POLYGON((-6 -10,-6.6923076923076925 -6.711538461538462,\
-9 -7,-8.824742268041238 -6.123711340206185,\
-10 -6,-8.583333333333332 -4.916666666666667,\
-8.094117647058823 -2.4705882352941173,-10 -3,\
-8.526315789473683 -0.05263157894736803,-10 1,\
-10 10,-7.764705882352941 8.509803921568627,\
-7.65090909090909 7.789090909090909,-10 10,\
-7.574468085106383 7.304964539007091,-7.4375 6.4375,\
-6.5 5.5,-6.4 6,-7.574468085106383 7.304964539007091,\
-7.65090909090909 7.789090909090909,\
-6.297029702970297 6.514851485148515,\
0 0,-6.297029702970297 6.514851485148515,\
-4.848484848484849 5.151515151515151,-4 6,\
-6.117647058823529 7.411764705882352,\
0 0,-6.11764705882353 7.411764705882353,\
-7.764705882352941 8.509803921568627,-8 10,\
-2.9473684210526314 7.052631578947368,-2 8,\
-0.17821782178217824 6.633663366336634,1 10,\
1.8095238095238098 5.142857142857142,\
3.2038834951456314 4.097087378640777,7 7,\
3.7142857142857144 3.7142857142857144,\
4.4 3.1999999999999997,8 2,\
6.540540540540541 1.5945945945945947,10 -1,\
7.454545454545455 -4.393939393939394,8 -5,\
7.320754716981132 -4.716981132075472,7 -6,\
6.062068965517241 -5.117241379310345,\
4.9504132231404965 -5.256198347107438,\
6.1506849315068495 -7.123287671232877,9 -8,\
6.548387096774194 -7.741935483870968,8 -10,\
5.906976744186046 -7.674418604651163,\
3.9107142857142856 -7.464285714285714,4 -8,\
2.8043478260869565 -7.3478260869565215,\
1.7829457364341086 -7.24031007751938,2 -8,\
1.0728476821192054 -7.1655629139072845,\
-4.3583617747440275 -6.593856655290103,-5 -9,\
-5.2020725388601035 -7.720207253886011,-6 -10),\
(5.127659574468085 -6.808510638297872,\
3.72972972972973 -6.378378378378379,\
3.571428571428571 -5.428571428571429,\
3.8539325842696632 -5.393258426966292,\
5.127659574468085 -6.808510638297872),\
(-5.5 4.5,-6.5 5.5,-6.4 6,\
-5.263157894736842 4.736842105263158,-5.5 4.5))"),
false);
}
template <typename Point>
@@ -718,6 +764,24 @@ void test_open_multipolygons()
// and the invalid case:
test::apply(from_wkt<OG>("MULTIPOLYGON(((0 0,100 0,100 100,0 100),(3 3,3 97,97 97,97 3)),((2 2,98 2,98 98,2 98),(1 1,1 99,99 99,99 1)))"),
false);
test::apply
(from_wkt<OG>("MULTIPOLYGON(((-1 4,8 -10,-10 10,7 -6,8 -2,\
-10 10,-10 1,-3 -4,4 1,-1 2,4 3,-8 10,-5 -9,-1 6,-5 0)),\
((-10 -3,-8 1,2 -8,-2 6,-4 0,8 -5,-1 5,8 2)),\
((-6 -10,1 10,4 -8,-7 -2,2 0,-4 3,-10 9)),\
((10 -1,-2 8,-7 3,-6 8,-9 -7,7 -5)),\
((7 7,-4 -4,9 -8,-10 -6)))"),
false);
test::apply
(from_wkt<OG>("MULTIPOLYGON(((-1 4,8 -10,-10 10,7 -6,8 -2,\
-10 10,-10 1,-3 -4,4 1,-1 2,4 3,-8 10,-5 -9,-1 6,-5 0)),\
((-10 -3,-8 1,2 -8,-2 6,-4 0,8 -5,-1 5,8 2)),\
((-6 -10,-10 9,-4 3,2 0,-7 -2,4 -8,1 10)),\
((10 -1,-2 8,-7 3,-6 8,-9 -7,7 -5)),\
((7 7,-10 -6,9 -8,-4 -4)))"),
false);
}
BOOST_AUTO_TEST_CASE( test_is_valid_multipolygon )