@@ -113,6 +113,7 @@ void test_all()
113
113
{
114
114
typedef bg::model::linestring<P> linestring;
115
115
typedef bg::model::polygon<P, Clockwise> polygon;
116
+ typedef typename bg::coordinate_type<P>::type coor_type;
116
117
117
118
bg::strategy::buffer::join_miter join_miter;
118
119
bg::strategy::buffer::join_round join_round (100 );
@@ -138,23 +139,23 @@ void test_all()
138
139
test_one<linestring, polygon>(" simplex_vertical32" , simplex_vertical, join_round32, end_round32, 5.12145 , 1 );
139
140
test_one<linestring, polygon>(" simplex_horizontal32" , simplex_horizontal, join_round32, end_round32, 5.12145 , 1 );
140
141
141
- test_one<linestring, polygon>(" simplex_asym_neg" , simplex, join_miter, end_flat, 3.202 , +1.5 , settings, -1.0 );
142
- test_one<linestring, polygon>(" simplex_asym_pos" , simplex, join_miter, end_flat, 3.202 , -1.0 , settings, +1.5 );
142
+ test_one<linestring, polygon>(" simplex_asym_neg" , simplex, join_miter, end_flat, 3.2016 , +1.5 , settings, -1.0 );
143
+ test_one<linestring, polygon>(" simplex_asym_pos" , simplex, join_miter, end_flat, 3.2016 , -1.0 , settings, +1.5 );
143
144
// Do not work yet:
144
145
// test_one<linestring, polygon>("simplex_asym_neg", simplex, join_miter, end_round, 3.202, +1.5, settings, -1.0);
145
146
// test_one<linestring, polygon>("simplex_asym_pos", simplex, join_miter, end_round, 3.202, -1.0, settings, +1.5);
146
147
147
148
// Generates (initially) a reversed polygon, with a negative area, which is reversed afterwards in assign_parents
148
- test_one<linestring, polygon>(" simplex_asym_neg_rev" , simplex, join_miter, end_flat, 3.202 , +1.0 , settings, -1.5 );
149
- test_one<linestring, polygon>(" simplex_asym_pos_rev" , simplex, join_miter, end_flat, 3.202 , -1.5 , settings, +1.0 );
149
+ test_one<linestring, polygon>(" simplex_asym_neg_rev" , simplex, join_miter, end_flat, 3.2016 , +1.0 , settings, -1.5 );
150
+ test_one<linestring, polygon>(" simplex_asym_pos_rev" , simplex, join_miter, end_flat, 3.2016 , -1.5 , settings, +1.0 );
150
151
151
152
test_one<linestring, polygon>(" straight" , straight, join_round, end_flat, 38.4187 , 1.5 );
152
153
test_one<linestring, polygon>(" straight" , straight, join_miter, end_flat, 38.4187 , 1.5 );
153
154
154
155
// One bend/two bends (tests join-type)
155
- test_one<linestring, polygon>(" one_bend" , one_bend, join_round, end_flat, 28.488 , 1.5 );
156
+ test_one<linestring, polygon>(" one_bend" , one_bend, join_round, end_flat, 28.496 , 1.5 );
156
157
test_one<linestring, polygon>(" one_bend" , one_bend, join_miter, end_flat, 28.696 , 1.5 );
157
- test_one<linestring, polygon>(" one_bend" , one_bend, join_round_by_divide, end_flat, 28.488 , 1.5 );
158
+ test_one<linestring, polygon>(" one_bend" , one_bend, join_round_by_divide, end_flat, 28.497 , 1.5 );
158
159
159
160
test_one<linestring, polygon>(" one_bend" , one_bend, join_round, end_round, 35.5603 , 1.5 );
160
161
test_one<linestring, polygon>(" one_bend" , one_bend, join_miter, end_round, 35.7601 , 1.5 );
@@ -163,7 +164,7 @@ void test_all()
163
164
test_one<linestring, polygon>(" two_bends" , two_bends, join_round, end_flat, 39.235 , 1.5 );
164
165
test_one<linestring, polygon>(" two_bends" , two_bends, join_round_by_divide, end_flat, 39.235 , 1.5 );
165
166
test_one<linestring, polygon>(" two_bends" , two_bends, join_miter, end_flat, 39.513 , 1.5 );
166
- test_one<linestring, polygon>(" two_bends_left" , two_bends, join_round, end_flat, 20.028 , 1.5 , settings, 0.0 );
167
+ test_one<linestring, polygon>(" two_bends_left" , two_bends, join_round, end_flat, 20.025 , 1.5 , settings, 0.0 );
167
168
test_one<linestring, polygon>(" two_bends_left" , two_bends, join_miter, end_flat, 20.225 , 1.5 , settings, 0.0 );
168
169
test_one<linestring, polygon>(" two_bends_right" , two_bends, join_round, end_flat, 19.211 , 0.0 , settings, 1.5 );
169
170
test_one<linestring, polygon>(" two_bends_right" , two_bends, join_miter, end_flat, 19.288 , 0.0 , settings, 1.5 );
@@ -207,8 +208,8 @@ void test_all()
207
208
test_one<linestring, polygon>(" chained4" , chained4, join_round, end_flat, 22.6274 , 2.5 , settings, 1.5 );
208
209
209
210
test_one<linestring, polygon>(" field_sprayer1" , field_sprayer1, join_round, end_flat, 324.3550 , 16.5 , settings, 6.5 );
210
- test_one<linestring, polygon>(" field_sprayer1" , field_sprayer1, join_round, end_round, 718.761877 , 16.5 , settings, 6.5 );
211
- test_one<linestring, polygon>(" field_sprayer1" , field_sprayer1, join_miter, end_round, 718.939628 , 16.5 , settings, 6.5 );
211
+ test_one<linestring, polygon>(" field_sprayer1" , field_sprayer1, join_round, end_round, { 718.686 , 718.762 } , 16.5 , settings, 6.5 );
212
+ test_one<linestring, polygon>(" field_sprayer1" , field_sprayer1, join_miter, end_round, { 718.845 , 718.940 } , 16.5 , settings, 6.5 );
212
213
213
214
test_one<linestring, polygon>(" degenerate0" , degenerate0, join_round, end_round, 0.0 , 3.0 );
214
215
test_one<linestring, polygon>(" degenerate1" , degenerate1, join_round, end_round, 28.25 , 3.0 );
@@ -254,8 +255,9 @@ void test_all()
254
255
}
255
256
256
257
{
257
- // Check on validity, with high precision because areas are all very small
258
- ut_settings settings (1.0e-10 , true );
258
+ ut_settings settings;
259
+ settings.tolerance = 0.1 ;
260
+ settings.use_ln_area = true ;
259
261
260
262
test_one<linestring, polygon>(" aimes120" , aimes120, join_miter, end_flat, 1.62669948622351512e-08 , 0.000018 , settings);
261
263
test_one<linestring, polygon>(" aimes120" , aimes120, join_round, end_round, 1.72842078427493107e-08 , 0.000018 , settings);
@@ -299,9 +301,12 @@ void test_all()
299
301
27862.733459829971 ,
300
302
5.9518403867035365 );
301
303
302
- test_one<linestring, polygon>(" mysql_report_2015_09_08a" , mysql_report_2015_09_08a, join_round32, end_round32, 0.0 , 1.0 );
303
- test_one<linestring, polygon>(" mysql_report_2015_09_08b" , mysql_report_2015_09_08b, join_round32, end_round32, 0.0 , 1099511627778.0 );
304
- test_one<linestring, polygon>(" mysql_report_2015_09_08c" , mysql_report_2015_09_08c, join_round32, end_round32, 0.0 , 0xbe );
304
+ if (BOOST_GEOMETRY_CONDITION ((boost::is_same<coor_type, double >::value)))
305
+ {
306
+ test_one<linestring, polygon>(" mysql_report_2015_09_08a" , mysql_report_2015_09_08a, join_round32, end_round32, 0.0 , 1.0 );
307
+ test_one<linestring, polygon>(" mysql_report_2015_09_08b" , mysql_report_2015_09_08b, join_round32, end_round32, 0.0 , 1099511627778.0 );
308
+ test_one<linestring, polygon>(" mysql_report_2015_09_08c" , mysql_report_2015_09_08c, join_round32, end_round32, 0.0 , 0xbe );
309
+ }
305
310
306
311
test_one<linestring, polygon>(" mysql_23023665_1" , mysql_23023665, join_round32, end_flat, 459.1051 , 10 );
307
312
test_one<linestring, polygon>(" mysql_23023665_2" , mysql_23023665, join_round32, end_flat, 6877.7097 , 50 );
@@ -372,6 +377,11 @@ void test_all()
372
377
template <bool Clockwise, typename P>
373
378
void test_invalid ()
374
379
{
380
+ typedef typename bg::coordinate_type<P>::type coor_type;
381
+ if (! BOOST_GEOMETRY_CONDITION ((boost::is_same<coor_type, double >::value)))
382
+ {
383
+ return ;
384
+ }
375
385
typedef bg::model::linestring<P> linestring;
376
386
typedef bg::model::polygon<P, Clockwise> polygon;
377
387
@@ -408,7 +418,7 @@ int test_main(int, char* [])
408
418
#endif
409
419
410
420
#if defined(BOOST_GEOMETRY_TEST_FAILURES)
411
- BoostGeometryWriteExpectedFailures (2 , 2 );
421
+ BoostGeometryWriteExpectedFailures (2 , 2 , 15 , 2 );
412
422
#endif
413
423
414
424
return 0 ;
0 commit comments