1 // Boost.Geometry (aka GGL, Generic Geometry Library)
4 // Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands.
6 // This file was modified by Oracle on 2016.
7 // Modifications copyright (c) 2016, Oracle and/or its affiliates.
8 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
10 // Use, modification and distribution is subject to the Boost Software License,
11 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
12 // http://www.boost.org/LICENSE_1_0.txt)
17 #include "test_union.hpp"
18 #include <algorithms/test_overlay.hpp>
19 #include <algorithms/overlay/multi_overlay_cases.hpp>
21 #include <boost/geometry/algorithms/correct.hpp>
22 #include <boost/geometry/algorithms/intersection.hpp>
23 #include <boost/geometry/algorithms/within.hpp>
25 #include <boost/geometry/geometries/point_xy.hpp>
26 #include <boost/geometry/geometries/multi_linestring.hpp>
27 #include <boost/geometry/geometries/multi_polygon.hpp>
29 #include <boost/geometry/io/wkt/read.hpp>
32 #define TEST_UNION(caseid, clips, holes, points, area) \
33 (test_one<Polygon, MultiPolygon, MultiPolygon>) \
34 ( #caseid, caseid[0], caseid[1], clips, holes, points, area)
36 #define TEST_UNION_IGNORE(caseid, clips, holes, points, area) \
37 { ut_settings ignore_validity; ignore_validity.test_validity = false; \
38 test_one<Polygon, MultiPolygon, MultiPolygon> \
39 (#caseid, caseid[0], caseid[1], \
40 clips, holes, points, area, ignore_validity); }
43 template <typename Ring
, typename Polygon
, typename MultiPolygon
>
46 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("simplex_multi",
47 case_multi_simplex
[0], case_multi_simplex
[1],
50 test_one
<Polygon
, Polygon
, MultiPolygon
>("simplex_multi_p_mp",
51 case_single_simplex
, case_multi_simplex
[0],
53 test_one
<Polygon
, MultiPolygon
, Polygon
>("simplex_multi_mp_p",
54 case_multi_simplex
[0], case_single_simplex
,
57 test_one
<Polygon
, Ring
, MultiPolygon
>("simplex_multi_r_mp",
58 case_single_simplex
, case_multi_simplex
[0],
60 test_one
<Ring
, MultiPolygon
, Polygon
>("simplex_multi_mp_r",
61 case_multi_simplex
[0], case_single_simplex
,
66 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_multi_no_ip",
67 case_multi_no_ip
[0], case_multi_no_ip
[1],
69 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_multi_2",
70 case_multi_2
[0], case_multi_2
[1],
73 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_58_multi_a",
74 case_58_multi
[0], case_58_multi
[3],
75 2, 0, 21, 19.83333333);
76 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_58_multi_b",
77 case_58_multi
[1], case_58_multi
[2],
80 // Constructed cases for multi/touch/equal/etc
81 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_61_multi",
82 case_61_multi
[0], case_61_multi
[1],
84 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_62_multi",
85 case_62_multi
[0], case_62_multi
[1],
87 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_63_multi",
88 case_63_multi
[0], case_63_multi
[1],
90 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_64_multi",
91 case_64_multi
[0], case_64_multi
[1],
93 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_65_multi",
94 case_65_multi
[0], case_65_multi
[1],
96 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_66_multi",
97 case_66_multi
[0], case_66_multi
[1],
99 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_72_multi",
100 case_72_multi
[0], case_72_multi
[1],
102 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_75_multi",
103 case_75_multi
[0], case_75_multi
[1],
105 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_76_multi",
106 case_76_multi
[0], case_76_multi
[1],
108 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_89_multi",
109 case_89_multi
[0], case_89_multi
[1],
111 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_101_multi",
112 case_101_multi
[0], case_101_multi
[1],
114 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_103_multi",
115 case_103_multi
[0], case_103_multi
[1],
117 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_104_multi",
118 case_104_multi
[0], case_104_multi
[1],
120 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_105_multi",
121 case_105_multi
[0], case_105_multi
[1],
123 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_106_multi",
124 case_106_multi
[0], case_106_multi
[1],
126 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_107_multi",
127 case_107_multi
[0], case_107_multi
[1],
129 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_108_multi",
130 case_108_multi
[0], case_108_multi
[1],
133 // Should have 2 holes. Needs self turns
134 #ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS
135 TEST_UNION(case_109_multi
, 1, 2, 14, 1400);
137 TEST_UNION_IGNORE(case_109_multi
, 1, 1, 14, 1400);
140 // Should have 9 holes, they are all separate and touching
141 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_110_multi",
142 case_110_multi
[0], case_110_multi
[1],
145 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_111_multi",
146 case_111_multi
[0], case_111_multi
[1],
148 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_112_multi",
149 case_112_multi
[0], case_112_multi
[1],
151 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_113_multi",
152 case_113_multi
[0], case_113_multi
[1],
154 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_114_multi",
155 case_114_multi
[0], case_114_multi
[1],
157 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_115_multi",
158 case_115_multi
[0], case_115_multi
[1],
160 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_116_multi",
161 case_116_multi
[0], case_116_multi
[1],
163 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_117_multi",
164 case_117_multi
[0], case_117_multi
[1],
166 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_118_multi",
167 case_118_multi
[0], case_118_multi
[1],
169 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_119_multi",
170 case_119_multi
[0], case_119_multi
[1],
172 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_120_multi",
173 case_120_multi
[0], case_120_multi
[1],
175 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_121_multi",
176 case_121_multi
[0], case_121_multi
[1],
178 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_122_multi",
179 case_122_multi
[0], case_122_multi
[1],
182 TEST_UNION(case_123_multi
, 1, 0, 11, 2.75);
183 TEST_UNION(case_124_multi
, 1, 0, 9, 2.75);
184 TEST_UNION(case_125_multi
, 1, 0, 9, 2.75);
185 TEST_UNION(case_126_multi
, 1, 2, 27, 52.0);
187 // Should have 2 holes. Needs self turns
188 #ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS
189 TEST_UNION(case_131_multi
, 1, 2, 15, 14.0);
191 TEST_UNION_IGNORE(case_131_multi
, 1, 1, 15, 14.0);
194 // SQL Server returns: MULTIPOLYGON (((4 4, 5.5 4.5, 6 6, 4.5 5.5, 4 4)), ((2 2, 3.5 2.5, 4 4, 2.5 3.5, 2 2)), ((0 0, 8 0, 8 8, 0 8, 0 0), (2 2, 2 4, 4 4, 4 6, 6 6, 6 4, 4 4, 4 2, 2 2)))
195 // Which is one self-connected hole with two island polygons in both parts, basically identical to what Boost.Geometry delivers
197 // PostGIS returns: MULTIPOLYGON(((0 0,0 8,8 8,8 0,0 0),(4 6,4 4,6 4,6 6,4 6)),((2 2,2.5 3.5,4 4,3.5 2.5,2 2),(4 4,2 4,2 2,4 2,4 4)),((4 4,4.5 5.5,6 6,5.5 4.5,4 4)))
198 // Which seems wrong because the second hole is part of a smaller polygon (?)
199 // ("POSTGIS="2.1.7 r13414" GEOS="3.5.0dev-CAPI-1.9.0 r4057")
200 TEST_UNION(case_132_multi
, 3, 2, 26, 60.0);
202 TEST_UNION(case_133_multi
, 2, 1, -1, 64.625);
203 TEST_UNION(case_134_multi
, 1, 2, -1, 66.0);
204 TEST_UNION(case_135_multi
, 1, 2, -1, 22.0);
205 TEST_UNION(case_136_multi
, 1, 2, -1, 22.0);
206 TEST_UNION(case_137_multi
, 1, 2, -1, 22.0);
207 TEST_UNION(case_138_multi
, 2, 1, -1, 65.225);
208 TEST_UNION(case_139_multi
, 2, 1, -1, 64.953);
209 TEST_UNION(case_140_multi
, 2, 1, -1, 64.953);
210 TEST_UNION(case_141_multi
, 1, 0, -1, 100.0);
212 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_1",
213 case_recursive_boxes_1
[0], case_recursive_boxes_1
[1],
215 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_2",
216 case_recursive_boxes_2
[0], case_recursive_boxes_2
[1],
217 1, 0, 14, 100.0); // Area from SQL Server
218 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_3",
219 case_recursive_boxes_3
[0], case_recursive_boxes_3
[1],
220 17, 6, 166, 56.5); // Area from SQL Server
222 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_4",
223 case_recursive_boxes_4
[0], case_recursive_boxes_4
[1],
226 // Should have 10 holes. Needs self turns
227 #ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS
228 TEST_UNION(case_recursive_boxes_5
, 3, 10, 118, 70.0);
230 TEST_UNION_IGNORE(case_recursive_boxes_5
, 3, 9, 115, 70.0);
233 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_6",
234 case_recursive_boxes_6
[0], case_recursive_boxes_6
[1],
237 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_7",
238 case_recursive_boxes_7
[0], case_recursive_boxes_7
[1],
241 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_8",
242 case_recursive_boxes_8
[0], case_recursive_boxes_8
[1],
245 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_9",
246 case_recursive_boxes_9
[0], case_recursive_boxes_9
[1],
249 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_10",
250 case_recursive_boxes_10
[0], case_recursive_boxes_10
[1],
252 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_11",
253 case_recursive_boxes_11
[0], case_recursive_boxes_11
[1],
255 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_12",
256 case_recursive_boxes_12
[0], case_recursive_boxes_12
[1],
258 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_13",
259 case_recursive_boxes_13
[0], case_recursive_boxes_13
[1],
262 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_14",
263 case_recursive_boxes_14
[0], case_recursive_boxes_14
[1],
266 // 12, 13, 14 with invalid input. To make then valid it is necessary
267 // to break regions at self-intersection points (postponed)
269 TEST_UNION_IGNORE(case_recursive_boxes_12_invalid
, 5, 0, -1, 6.0);
270 #ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS
271 // Without self-turns, a whole part is missed
272 TEST_UNION_IGNORE(case_recursive_boxes_13_invalid
, 2, 0, -1, 10.25);
274 TEST_UNION_IGNORE(case_recursive_boxes_14_invalid
, 4, 0, -1, 4.5);
276 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_15",
277 case_recursive_boxes_15
[0], case_recursive_boxes_15
[1],
279 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_16",
280 case_recursive_boxes_16
[0], case_recursive_boxes_16
[1],
282 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_17",
283 case_recursive_boxes_17
[0], case_recursive_boxes_17
[1],
285 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_18",
286 case_recursive_boxes_18
[0], case_recursive_boxes_18
[1],
288 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_19",
289 case_recursive_boxes_19
[0], case_recursive_boxes_19
[1],
291 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_20",
292 case_recursive_boxes_20
[0], case_recursive_boxes_20
[1],
294 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_21",
295 case_recursive_boxes_21
[0], case_recursive_boxes_21
[1],
297 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_22",
298 case_recursive_boxes_22
[0], case_recursive_boxes_22
[1],
300 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_23",
301 case_recursive_boxes_23
[0], case_recursive_boxes_23
[1],
303 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_24",
304 case_recursive_boxes_24
[0], case_recursive_boxes_24
[1],
306 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_25",
307 case_recursive_boxes_25
[0], case_recursive_boxes_25
[1],
309 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_26",
310 case_recursive_boxes_26
[0], case_recursive_boxes_26
[1],
312 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_27",
313 case_recursive_boxes_27
[0], case_recursive_boxes_27
[1],
315 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_28",
316 case_recursive_boxes_28
[0], case_recursive_boxes_28
[1],
318 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_29",
319 case_recursive_boxes_29
[0], case_recursive_boxes_29
[1],
321 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_30",
322 case_recursive_boxes_30
[0], case_recursive_boxes_30
[1],
324 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_31",
325 case_recursive_boxes_31
[0], case_recursive_boxes_31
[1],
327 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_32",
328 case_recursive_boxes_32
[0], case_recursive_boxes_32
[1],
330 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_33",
331 case_recursive_boxes_33
[0], case_recursive_boxes_33
[1],
333 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_34",
334 case_recursive_boxes_34
[0], case_recursive_boxes_34
[1],
336 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_35",
337 case_recursive_boxes_35
[0], case_recursive_boxes_35
[1],
339 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_36",
340 case_recursive_boxes_36
[0], case_recursive_boxes_36
[1],
342 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_37",
343 case_recursive_boxes_37
[0], case_recursive_boxes_37
[1],
345 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_38",
346 case_recursive_boxes_38
[0], case_recursive_boxes_38
[1],
349 TEST_UNION(case_recursive_boxes_46
, 1, 4, 51, 33.0);
350 TEST_UNION(case_recursive_boxes_47
, 1, 0, -1, 22.0);
351 TEST_UNION(case_recursive_boxes_48
, 1, 1, -1, 10.0);
352 #ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS
353 TEST_UNION(case_recursive_boxes_49
, 1, 3, -1, 59.0);
355 TEST_UNION_IGNORE(case_recursive_boxes_49
, 1, 2, -1, 59.0);
358 TEST_UNION(case_recursive_boxes_50
, 7, 4, -1, 68.0);
360 #ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS
361 TEST_UNION(case_recursive_boxes_51
, 2, 6, -1, 75.0);
363 TEST_UNION_IGNORE(case_recursive_boxes_51
, 2, 5, -1, 75.0);
366 TEST_UNION(case_recursive_boxes_52
, 2, 6, -1, 77.0);
367 TEST_UNION(case_recursive_boxes_53
, 1, 1, -1, 24.75);
368 #ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS
369 TEST_UNION(case_recursive_boxes_54
, 1, 2, -1, 22.5);
371 TEST_UNION_IGNORE(case_recursive_boxes_54
, 1, 1, -1, 22.5);
374 TEST_UNION(case_recursive_boxes_55
, 3, 1, -1, 15.5);
375 #ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS
376 TEST_UNION(case_recursive_boxes_56
, 5, 1, -1, 7.75);
378 TEST_UNION_IGNORE(case_recursive_boxes_56
, 5, 0, -1, 7.75);
380 TEST_UNION(case_recursive_boxes_57
, 3, 4, -1, 19.75);
381 TEST_UNION(case_recursive_boxes_58
, 6, 1, -1, 6.25);
383 #ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS
384 // If there are no self-turns, an interior ring is missed
385 TEST_UNION(case_recursive_boxes_59
, 1, 3, -1, 21.75);
388 TEST_UNION(case_recursive_boxes_60
, 3, 0, -1, 20.5);
389 TEST_UNION(case_recursive_boxes_61
, 1, 1, -1, 23.5);
390 TEST_UNION(case_recursive_boxes_62
, 2, 3, -1, 21.25);
391 TEST_UNION(case_recursive_boxes_63
, 2, 3, -1, 44.0);
392 TEST_UNION(case_recursive_boxes_64
, 1, 2, -1, 24.5);
393 TEST_UNION(case_recursive_boxes_65
, 1, 1, -1, 24.5);
394 TEST_UNION(case_recursive_boxes_66
, 1, 1, -1, 24.75);
395 TEST_UNION(case_recursive_boxes_67
, 4, 0, -1, 14.75);
396 TEST_UNION(case_recursive_boxes_68
, 1, 4, -1, 22.5);
397 TEST_UNION(case_recursive_boxes_69
, 4, 0, -1, 16.25);
398 TEST_UNION(case_recursive_boxes_70
, 1, 0, -1, 25.0);
399 TEST_UNION(case_recursive_boxes_71
, 4, 2, -1, 15.75);
400 TEST_UNION(case_recursive_boxes_72
, 10, 0, -1, 15.0);
401 TEST_UNION(case_recursive_boxes_73
, 1, 2, -1, 24.25);
402 TEST_UNION(case_recursive_boxes_74
, 1, 1, -1, 24.75);
403 TEST_UNION(case_recursive_boxes_75
, 1, 2, -1, 23.25);
404 TEST_UNION(case_recursive_boxes_76
, 1, 0, -1, 24.5);
405 TEST_UNION(case_recursive_boxes_77
, 8, 1, -1, 13.5);
406 TEST_UNION(case_recursive_boxes_78
, 2, 5, -1, 18.0);
407 TEST_UNION(case_recursive_boxes_79
, 1, 2, -1, 14.75);
409 #if defined(BOOST_GEOMETRY_NO_ROBUSTNESS)
410 // This is correct: no holes generated
411 TEST_UNION(case_recursive_boxes_80
, 2, 0, -1, 1.5);
413 // See comment for this testcase
414 TEST_UNION(case_recursive_boxes_80
, 2, 1, -1, 1.5);
417 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("ggl_list_20120915_h2_a",
418 ggl_list_20120915_h2
[0], ggl_list_20120915_h2
[1],
419 1, 0, 12, 23.0); // Area from SQL Server
420 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("ggl_list_20120915_h2_b",
421 ggl_list_20120915_h2
[0], ggl_list_20120915_h2
[2],
422 1, 0, 12, 23.0); // Area from SQL Server
424 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("ggl_list_20140212_sybren",
425 ggl_list_20140212_sybren
[0], ggl_list_20140212_sybren
[1],
426 2, 0, 16, 0.002471626);
428 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("ticket_9081",
429 ticket_9081
[0], ticket_9081
[1],
430 #if defined(BOOST_GEOMETRY_NO_ROBUSTNESS)
437 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("ticket_10803",
438 ticket_10803
[0], ticket_10803
[1],
439 1, 0, 9, 2663736.07038);
440 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("ticket_11984",
441 ticket_11984
[0], ticket_11984
[1],
442 1, 2, 134, 60071.08077);
444 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("ticket_12118",
445 ticket_12118
[0], ticket_12118
[1],
446 1, 1, 27, 2221.38713);
448 #if defined(BOOST_GEOMETRY_ENABLE_FAILING_TESTS) || defined(BOOST_GEOMETRY_NO_ROBUSTNESS)
449 // No output if rescaling is done
450 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("ticket_12125",
451 ticket_12125
[0], ticket_12125
[1],
452 1, 0, -1, 575.831180350007);
455 TEST_UNION(ticket_12503
, 42, 1, -1, 945.625);
457 // Should have 1 hole. Needs self turns.
458 #ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS
459 TEST_UNION(mysql_23023665_7
, 1, 1, -1, 99.19494);
461 TEST_UNION_IGNORE(mysql_23023665_7
, 1, 0, -1, 99.19494);
464 // Should have 2 holes. Needs self turns.
465 #ifdef BOOST_GEOMETRY_INCLUDE_SELF_TURNS
466 TEST_UNION(mysql_23023665_8
, 1, 2, -1, 1400.0);
468 TEST_UNION_IGNORE(mysql_23023665_8
, 1, 1, -1, 1400.0);
471 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("mysql_23023665_9",
472 mysql_23023665_9
[0], mysql_23023665_9
[1],
475 TEST_UNION(mysql_regression_1_65_2017_08_31
, 3, 0, -1, 181.966397646608);
478 // Test cases (generic)
479 template <typename Point
, bool ClockWise
, bool Closed
>
483 typedef bg::model::ring
<Point
, ClockWise
, Closed
> ring
;
484 typedef bg::model::polygon
<Point
, ClockWise
, Closed
> polygon
;
485 typedef bg::model::multi_polygon
<polygon
> multi_polygon
;
486 test_areal
<ring
, polygon
, multi_polygon
>();
489 // Test cases for integer coordinates / ccw / open
490 template <typename Point
, bool ClockWise
, bool Closed
>
493 typedef bg::model::polygon
<Point
, ClockWise
, Closed
> polygon
;
494 typedef bg::model::multi_polygon
<polygon
> multi_polygon
;
496 ut_settings settings
;
497 settings
.test_validity
= true;
499 test_one
<polygon
, multi_polygon
, multi_polygon
>("ticket_10803",
500 ticket_10803
[0], ticket_10803
[1],
501 1, 0, 9, 2664270, settings
);
505 int test_main(int, char* [])
507 test_all
<bg::model::d2::point_xy
<double>, true, true>();
508 #if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
509 test_all
<bg::model::d2::point_xy
<double>, false, false>();
511 test_specific
<bg::model::d2::point_xy
<int>, false, false>();
513 test_all
<bg::model::d2::point_xy
<float>, true, true>();
515 #if defined(HAVE_TTMATH)
516 std::cout
<< "Testing TTMATH" << std::endl
;
517 test_all
<bg::model::d2::point_xy
<ttmath_big
> >();