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 #ifndef BOOST_GEOMETRY_NO_SELF_TURNS
134 TEST_UNION(case_109_multi
, 1, 2, 14, 1400);
136 TEST_UNION_IGNORE(case_109_multi
, 1, 1, 14, 1400);
139 // Should have 9 holes, they are all separate and touching
140 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_110_multi",
141 case_110_multi
[0], case_110_multi
[1],
144 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_111_multi",
145 case_111_multi
[0], case_111_multi
[1],
147 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_112_multi",
148 case_112_multi
[0], case_112_multi
[1],
150 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_113_multi",
151 case_113_multi
[0], case_113_multi
[1],
153 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_114_multi",
154 case_114_multi
[0], case_114_multi
[1],
156 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_115_multi",
157 case_115_multi
[0], case_115_multi
[1],
159 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_116_multi",
160 case_116_multi
[0], case_116_multi
[1],
162 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_117_multi",
163 case_117_multi
[0], case_117_multi
[1],
165 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_118_multi",
166 case_118_multi
[0], case_118_multi
[1],
168 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_119_multi",
169 case_119_multi
[0], case_119_multi
[1],
171 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_120_multi",
172 case_120_multi
[0], case_120_multi
[1],
174 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_121_multi",
175 case_121_multi
[0], case_121_multi
[1],
177 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_122_multi",
178 case_122_multi
[0], case_122_multi
[1],
181 TEST_UNION(case_123_multi
, 1, 0, 11, 2.75);
182 TEST_UNION(case_124_multi
, 1, 0, 9, 2.75);
183 TEST_UNION(case_125_multi
, 1, 0, 9, 2.75);
184 TEST_UNION(case_126_multi
, 1, 2, 27, 52.0);
186 #ifndef BOOST_GEOMETRY_NO_SELF_TURNS
187 TEST_UNION(case_131_multi
, 1, 2, 15, 14.0);
189 TEST_UNION_IGNORE(case_131_multi
, 1, 1, 15, 14.0);
192 // 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)))
193 // Which is one self-connected hole with two island polygons in both parts, basically identical to what Boost.Geometry delivers
195 // 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)))
196 // Which seems wrong because the second hole is part of a smaller polygon (?)
197 // ("POSTGIS="2.1.7 r13414" GEOS="3.5.0dev-CAPI-1.9.0 r4057")
198 TEST_UNION(case_132_multi
, 3, 2, 26, 60.0);
200 TEST_UNION(case_133_multi
, 2, 1, -1, 64.625);
201 TEST_UNION(case_134_multi
, 1, 2, -1, 66.0);
202 TEST_UNION(case_135_multi
, 1, 2, -1, 22.0);
203 TEST_UNION(case_136_multi
, 1, 2, -1, 22.0);
204 TEST_UNION(case_137_multi
, 1, 2, -1, 22.0);
205 TEST_UNION(case_138_multi
, 2, 1, -1, 65.225);
206 TEST_UNION(case_139_multi
, 2, 1, -1, 64.953);
207 TEST_UNION(case_140_multi
, 2, 1, -1, 64.953);
208 TEST_UNION(case_141_multi
, 1, 0, -1, 100.0);
210 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_1",
211 case_recursive_boxes_1
[0], case_recursive_boxes_1
[1],
213 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_2",
214 case_recursive_boxes_2
[0], case_recursive_boxes_2
[1],
215 1, 0, 5, 100.0); // Area from SQL Server
216 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_3",
217 case_recursive_boxes_3
[0], case_recursive_boxes_3
[1],
218 17, 6, 154, 56.5); // Area from SQL Server
220 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_4",
221 case_recursive_boxes_4
[0], case_recursive_boxes_4
[1],
224 #ifndef BOOST_GEOMETRY_NO_SELF_TURNS
225 TEST_UNION(case_recursive_boxes_5
, 3, 10, 98, 70.0);
227 TEST_UNION_IGNORE(case_recursive_boxes_5
, 3, 9, 115, 70.0);
230 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_6",
231 case_recursive_boxes_6
[0], case_recursive_boxes_6
[1],
234 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_7",
235 case_recursive_boxes_7
[0], case_recursive_boxes_7
[1],
238 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_8",
239 case_recursive_boxes_8
[0], case_recursive_boxes_8
[1],
242 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_9",
243 case_recursive_boxes_9
[0], case_recursive_boxes_9
[1],
246 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_10",
247 case_recursive_boxes_10
[0], case_recursive_boxes_10
[1],
249 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_11",
250 case_recursive_boxes_11
[0], case_recursive_boxes_11
[1],
252 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_12",
253 case_recursive_boxes_12
[0], case_recursive_boxes_12
[1],
255 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_13",
256 case_recursive_boxes_13
[0], case_recursive_boxes_13
[1],
259 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_14",
260 case_recursive_boxes_14
[0], case_recursive_boxes_14
[1],
263 // 12, 13, 14 with invalid input. To make then valid it is necessary
264 // to break regions at self-intersection points (postponed)
266 TEST_UNION_IGNORE(case_recursive_boxes_12_invalid
, 5, 0, -1, 6.0);
267 #ifndef BOOST_GEOMETRY_NO_SELF_TURNS
268 // Only apply it with self-turns. Without them a whole part is missed
269 TEST_UNION_IGNORE(case_recursive_boxes_13_invalid
, 2, 0, -1, 10.25);
271 TEST_UNION_IGNORE(case_recursive_boxes_14_invalid
, 4, 0, -1, 4.5);
273 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_15",
274 case_recursive_boxes_15
[0], case_recursive_boxes_15
[1],
276 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_16",
277 case_recursive_boxes_16
[0], case_recursive_boxes_16
[1],
279 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_17",
280 case_recursive_boxes_17
[0], case_recursive_boxes_17
[1],
282 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_18",
283 case_recursive_boxes_18
[0], case_recursive_boxes_18
[1],
285 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_19",
286 case_recursive_boxes_19
[0], case_recursive_boxes_19
[1],
288 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_20",
289 case_recursive_boxes_20
[0], case_recursive_boxes_20
[1],
291 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_21",
292 case_recursive_boxes_21
[0], case_recursive_boxes_21
[1],
294 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_22",
295 case_recursive_boxes_22
[0], case_recursive_boxes_22
[1],
297 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_23",
298 case_recursive_boxes_23
[0], case_recursive_boxes_23
[1],
300 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_24",
301 case_recursive_boxes_24
[0], case_recursive_boxes_24
[1],
303 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_25",
304 case_recursive_boxes_25
[0], case_recursive_boxes_25
[1],
306 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_26",
307 case_recursive_boxes_26
[0], case_recursive_boxes_26
[1],
309 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_27",
310 case_recursive_boxes_27
[0], case_recursive_boxes_27
[1],
312 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_28",
313 case_recursive_boxes_28
[0], case_recursive_boxes_28
[1],
315 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_29",
316 case_recursive_boxes_29
[0], case_recursive_boxes_29
[1],
318 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_30",
319 case_recursive_boxes_30
[0], case_recursive_boxes_30
[1],
321 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_31",
322 case_recursive_boxes_31
[0], case_recursive_boxes_31
[1],
324 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_32",
325 case_recursive_boxes_32
[0], case_recursive_boxes_32
[1],
327 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_33",
328 case_recursive_boxes_33
[0], case_recursive_boxes_33
[1],
330 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_34",
331 case_recursive_boxes_34
[0], case_recursive_boxes_34
[1],
333 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_35",
334 case_recursive_boxes_35
[0], case_recursive_boxes_35
[1],
336 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_36",
337 case_recursive_boxes_36
[0], case_recursive_boxes_36
[1],
339 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_37",
340 case_recursive_boxes_37
[0], case_recursive_boxes_37
[1],
342 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("case_recursive_boxes_38",
343 case_recursive_boxes_38
[0], case_recursive_boxes_38
[1],
346 TEST_UNION(case_recursive_boxes_46
, 1, 4, 51, 33.0);
347 TEST_UNION(case_recursive_boxes_47
, 1, 0, -1, 22.0);
348 TEST_UNION(case_recursive_boxes_48
, 1, 1, -1, 10.0);
349 #ifndef BOOST_GEOMETRY_NO_SELF_TURNS
350 TEST_UNION(case_recursive_boxes_49
, 1, 3, -1, 59.0);
352 TEST_UNION_IGNORE(case_recursive_boxes_49
, 1, 2, -1, 59.0);
355 TEST_UNION(case_recursive_boxes_50
, 7, 4, -1, 68.0);
357 #ifndef BOOST_GEOMETRY_NO_SELF_TURNS
358 TEST_UNION(case_recursive_boxes_51
, 2, 6, -1, 75.0);
360 TEST_UNION_IGNORE(case_recursive_boxes_51
, 2, 5, -1, 75.0);
363 TEST_UNION(case_recursive_boxes_52
, 2, 6, -1, 77.0);
364 TEST_UNION(case_recursive_boxes_53
, 1, 1, -1, 24.75);
365 #ifndef BOOST_GEOMETRY_NO_SELF_TURNS
366 TEST_UNION(case_recursive_boxes_54
, 1, 2, -1, 22.5);
368 TEST_UNION_IGNORE(case_recursive_boxes_54
, 1, 1, -1, 22.5);
371 TEST_UNION(case_recursive_boxes_55
, 3, 1, -1, 15.5);
372 #ifndef BOOST_GEOMETRY_NO_SELF_TURNS
373 TEST_UNION(case_recursive_boxes_56
, 5, 1, -1, 7.75);
375 TEST_UNION_IGNORE(case_recursive_boxes_56
, 5, 0, -1, 7.75);
377 TEST_UNION(case_recursive_boxes_57
, 3, 4, -1, 19.75);
378 TEST_UNION(case_recursive_boxes_58
, 6, 1, -1, 6.25);
380 #ifndef BOOST_GEOMETRY_NO_SELF_TURNS
381 // If there are no self-turns, an interior ring is missed
382 TEST_UNION(case_recursive_boxes_59
, 1, 3, -1, 21.75);
385 TEST_UNION(case_recursive_boxes_60
, 3, 0, -1, 20.5);
386 TEST_UNION(case_recursive_boxes_61
, 1, 1, -1, 23.5);
387 TEST_UNION(case_recursive_boxes_62
, 2, 3, -1, 21.25);
388 TEST_UNION(case_recursive_boxes_63
, 2, 3, -1, 44.0);
389 TEST_UNION(case_recursive_boxes_64
, 1, 2, -1, 24.5);
390 TEST_UNION(case_recursive_boxes_65
, 1, 1, -1, 24.5);
391 TEST_UNION(case_recursive_boxes_66
, 1, 1, -1, 24.75);
392 TEST_UNION(case_recursive_boxes_67
, 4, 0, -1, 14.75);
393 TEST_UNION(case_recursive_boxes_68
, 1, 4, -1, 22.5);
394 TEST_UNION(case_recursive_boxes_69
, 4, 0, -1, 16.25);
395 TEST_UNION(case_recursive_boxes_70
, 1, 0, -1, 25.0);
396 TEST_UNION(case_recursive_boxes_71
, 4, 2, -1, 15.75);
397 TEST_UNION(case_recursive_boxes_72
, 10, 0, -1, 15.0);
398 TEST_UNION(case_recursive_boxes_73
, 1, 2, -1, 24.25);
399 TEST_UNION(case_recursive_boxes_74
, 1, 1, -1, 24.75);
400 TEST_UNION(case_recursive_boxes_75
, 1, 2, -1, 23.25);
401 TEST_UNION(case_recursive_boxes_76
, 1, 0, -1, 24.5);
402 TEST_UNION(case_recursive_boxes_77
, 8, 1, -1, 13.5);
403 TEST_UNION(case_recursive_boxes_78
, 2, 5, -1, 18.0);
404 TEST_UNION(case_recursive_boxes_79
, 1, 2, -1, 14.75);
406 #if defined(BOOST_GEOMETRY_NO_ROBUSTNESS)
407 // This is correct: no holes generated
408 TEST_UNION(case_recursive_boxes_80
, 2, 0, -1, 1.5);
410 // See comment for this testcase
411 TEST_UNION(case_recursive_boxes_80
, 2, 1, -1, 1.5);
414 TEST_UNION(case_recursive_boxes_81
, 5, 0, -1, 15.5);
415 TEST_UNION(case_recursive_boxes_82
, 2, 2, -1, 20.25);
416 TEST_UNION(case_recursive_boxes_83
, 3, 1, -1, 20.75);
417 TEST_UNION(case_recursive_boxes_84
, 4, 1, -1, 17.5);
418 TEST_UNION(case_recursive_boxes_85
, 9, 0, -1, 8.0);
419 TEST_UNION(case_recursive_boxes_86
, 3, 0, -1, 3.0);
420 TEST_UNION(case_recursive_boxes_87
, 8, 0, -1, 4.5);
421 TEST_UNION(case_recursive_boxes_88
, 5, 1, -1, 15.0);
423 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("ggl_list_20120915_h2_a",
424 ggl_list_20120915_h2
[0], ggl_list_20120915_h2
[1],
425 1, 0, 12, 23.0); // Area from SQL Server
426 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("ggl_list_20120915_h2_b",
427 ggl_list_20120915_h2
[0], ggl_list_20120915_h2
[2],
428 1, 0, 12, 23.0); // Area from SQL Server
430 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("ggl_list_20140212_sybren",
431 ggl_list_20140212_sybren
[0], ggl_list_20140212_sybren
[1],
432 2, 0, 16, 0.002471626);
434 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("ticket_9081",
435 ticket_9081
[0], ticket_9081
[1],
436 #if defined(BOOST_GEOMETRY_NO_ROBUSTNESS)
443 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("ticket_10803",
444 ticket_10803
[0], ticket_10803
[1],
445 1, 0, 9, 2663736.07038);
446 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("ticket_11984",
447 ticket_11984
[0], ticket_11984
[1],
448 1, 2, 134, 60071.08077);
450 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("ticket_12118",
451 ticket_12118
[0], ticket_12118
[1],
452 1, 1, 27, 2221.38713);
454 #if defined(BOOST_GEOMETRY_ENABLE_FAILING_TESTS) || defined(BOOST_GEOMETRY_NO_ROBUSTNESS)
455 // No output if rescaling is done
456 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("ticket_12125",
457 ticket_12125
[0], ticket_12125
[1],
458 1, 0, -1, 575.831180350007);
461 TEST_UNION(ticket_12503
, 42, 1, -1, 945.625);
463 #ifndef BOOST_GEOMETRY_NO_SELF_TURNS
464 TEST_UNION(mysql_23023665_7
, 1, 1, -1, 99.19494);
466 TEST_UNION_IGNORE(mysql_23023665_7
, 1, 0, -1, 99.19494);
469 #ifndef BOOST_GEOMETRY_NO_SELF_TURNS
470 TEST_UNION(mysql_23023665_8
, 1, 2, -1, 1400.0);
472 TEST_UNION_IGNORE(mysql_23023665_8
, 1, 1, -1, 1400.0);
475 test_one
<Polygon
, MultiPolygon
, MultiPolygon
>("mysql_23023665_9",
476 mysql_23023665_9
[0], mysql_23023665_9
[1],
479 TEST_UNION(mysql_regression_1_65_2017_08_31
, 3, 0, -1, 181.966397646608);
482 // Test cases (generic)
483 template <typename Point
, bool ClockWise
, bool Closed
>
487 typedef bg::model::ring
<Point
, ClockWise
, Closed
> ring
;
488 typedef bg::model::polygon
<Point
, ClockWise
, Closed
> polygon
;
489 typedef bg::model::multi_polygon
<polygon
> multi_polygon
;
490 test_areal
<ring
, polygon
, multi_polygon
>();
493 // Test cases for integer coordinates / ccw / open
494 template <typename Point
, bool ClockWise
, bool Closed
>
497 typedef bg::model::polygon
<Point
, ClockWise
, Closed
> polygon
;
498 typedef bg::model::multi_polygon
<polygon
> multi_polygon
;
500 ut_settings settings
;
501 settings
.test_validity
= true;
503 test_one
<polygon
, multi_polygon
, multi_polygon
>("ticket_10803",
504 ticket_10803
[0], ticket_10803
[1],
505 1, 0, 9, 2664270, settings
);
509 int test_main(int, char* [])
511 test_all
<bg::model::d2::point_xy
<double>, true, true>();
512 #if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
513 test_all
<bg::model::d2::point_xy
<double>, false, false>();
515 test_specific
<bg::model::d2::point_xy
<int>, false, false>();
517 test_all
<bg::model::d2::point_xy
<float>, true, true>();
519 #if defined(HAVE_TTMATH)
520 std::cout
<< "Testing TTMATH" << std::endl
;
521 test_all
<bg::model::d2::point_xy
<ttmath_big
> >();