mirror of
https://github.com/boostorg/geometry.git
synced 2026-02-26 04:42:15 +00:00
Merge branch 'develop' into bg-prepare
This commit is contained in:
@@ -106,6 +106,8 @@ static std::string const mysql_23023665 = "LINESTRING(0 0, 0 5, 5 5, 5 0, 0 0)";
|
||||
static std::string const mysql_25662426 = "LINESTRING(170 4756, 168 4756, 168 4759, 168 4764, 171 4764, 171 4700)";
|
||||
static std::string const mysql_25662426a = "LINESTRING(170 4756, 168 4756, 168 4759, 168 4764, 171 4764, 171 4750)";
|
||||
|
||||
static std::string const issue_596 = "LINESTRING(292979.660 6688731.370, 292979.600 6688733.420, 292979.540 6688735.440, 292979.540 6688735.500)";
|
||||
|
||||
template <bool Clockwise, typename P>
|
||||
void test_all()
|
||||
{
|
||||
@@ -187,9 +189,9 @@ void test_all()
|
||||
// Having flat end
|
||||
test_one<linestring, polygon>("for_collinear", for_collinear, join_round, end_flat, 68.561, 2.0);
|
||||
test_one<linestring, polygon>("for_collinear", for_collinear, join_miter, end_flat, 72, 2.0);
|
||||
#if defined(BOOST_GEOMETRY_TEST_ENABLE_FAILING)
|
||||
test_one<linestring, polygon>("for_collinear2", for_collinear2, join_round, end_flat, 74.387, 2.0, 2.0);
|
||||
test_one<linestring, polygon>("for_collinear2", for_collinear2, join_miter, end_flat, 78.0, 2.0, 2.0);
|
||||
#if defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
test_one<linestring, polygon>("for_collinear2", for_collinear2, join_round, end_flat, 74.387, 2.0);
|
||||
test_one<linestring, polygon>("for_collinear2", for_collinear2, join_miter, end_flat, 78.0, 2.0);
|
||||
#endif
|
||||
|
||||
test_one<linestring, polygon>("curve", curve, join_round, end_flat, 58.1944, 5.0, ut_settings(), 3.0);
|
||||
@@ -281,12 +283,21 @@ void test_all()
|
||||
|
||||
test_one<linestring, polygon>("mikado1", mikado1, join_round32, end_round32, 5441135039.0979, 41751.0);
|
||||
|
||||
{
|
||||
// This case gave a spike (invalid result) up to 1.70
|
||||
// Fixed by general form for line/line intersection in miter calculation
|
||||
using bg::strategy::buffer::join_round;
|
||||
using bg::strategy::buffer::end_round;
|
||||
test_one<linestring, polygon>("issue_596", issue_596, join_round(12), end_round(12), 0.12462779, 0.015);
|
||||
test_one<linestring, polygon>("issue_596", issue_596, join_miter, end_round(12), 0.12462807, 0.015);
|
||||
}
|
||||
|
||||
test_one<linestring, polygon>("mysql_report_2015_06_11",
|
||||
mysql_report_2015_06_11, join_round32, end_round32,
|
||||
27862.733459829971,
|
||||
5.9518403867035365);
|
||||
|
||||
#if defined(BOOST_GEOMETRY_TEST_ENABLE_FAILING)
|
||||
#if defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
test_one<linestring, polygon>("mysql_report_2015_09_08a", mysql_report_2015_09_08a, join_round32, end_round32, 0.0, 1.0);
|
||||
test_one<linestring, polygon>("mysql_report_2015_09_08b", mysql_report_2015_09_08b, join_round32, end_round32, 0.0, 1099511627778.0);
|
||||
test_one<linestring, polygon>("mysql_report_2015_09_08c", mysql_report_2015_09_08c, join_round32, end_round32, 0.0, 0xbe);
|
||||
@@ -314,7 +325,7 @@ void test_all()
|
||||
test_one<linestring, polygon>("mysql_25662426a_5", mysql_25662426a, join_round32, end_flat, 227.8325, 5.0);
|
||||
test_one<linestring, polygon>("mysql_25662426a_10", mysql_25662426a, join_round32, end_flat, 534.1084, 10.0);
|
||||
|
||||
#if defined(BOOST_GEOMETRY_TEST_ENABLE_FAILING)
|
||||
#if defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
// Left
|
||||
test_one<linestring, polygon>("mysql_25662426a_1", mysql_25662426a, join_round32, end_round32, 54.9018, 1.0, ut_settings(), 0.0);
|
||||
test_one<linestring, polygon>("mysql_25662426a_2", mysql_25662426a, join_round32, end_round32, 103.6072, 2.0, ut_settings(), 0.0);
|
||||
|
||||
@@ -141,7 +141,6 @@ void test_all()
|
||||
}
|
||||
|
||||
{
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
// Coordinates in one linestring vary so much that
|
||||
// length = geometry::math::sqrt(dx * dx + dy * dy); returns a value of inf for length
|
||||
// That geometry is skipped for the buffer
|
||||
@@ -156,7 +155,6 @@ void test_all()
|
||||
test_one<multi_linestring_type, polygon>("mysql_2015_04_10b",
|
||||
mysql_2015_04_10b, join_round32, end_round32,
|
||||
ut_settings::ignore_area(), 0.98, ut_settings::assertions_only());
|
||||
#endif
|
||||
|
||||
// Two other cases with <inf> for length calculation
|
||||
test_one<multi_linestring_type, polygon>("mysql_2015_09_08a",
|
||||
|
||||
@@ -47,7 +47,7 @@ void test_all()
|
||||
test_one<multi_point_type, polygon>("simplex3", simplex, join, end_flat, 44.5692, 3.0);
|
||||
|
||||
test_one<multi_point_type, polygon>("three1", three, join, end_flat, 3.0 * pi, 1.0);
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
// For no-rescaling, fails in CCW mode
|
||||
test_one<multi_point_type, polygon>("three2", three, join, end_flat, 36.7592, 2.0);
|
||||
#endif
|
||||
|
||||
@@ -368,26 +368,24 @@ void test_all()
|
||||
test_one<multi_polygon_type, polygon_type>("rt_d", rt_d, join_round, end_flat, 18.8726, 0.3);
|
||||
test_one<multi_polygon_type, polygon_type>("rt_e", rt_e, join_round, end_flat, 14.1866, 0.3);
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
test_one<multi_polygon_type, polygon_type>("rt_g1", rt_g1, join_round, end_flat, 24.719, 1.0);
|
||||
#endif
|
||||
test_one<multi_polygon_type, polygon_type>("rt_g3", rt_g3, join_miter, end_flat, 16.5711, 1.0);
|
||||
|
||||
test_one<multi_polygon_type, polygon_type>("rt_d", rt_d, join_miter, end_flat, 19.8823, 0.3);
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
test_one<multi_polygon_type, polygon_type>("rt_e", rt_e, join_miter, end_flat, 15.1198, 0.3);
|
||||
test_one<multi_polygon_type, polygon_type>("rt_f", rt_f, join_miter, end_flat, 4.60853, 0.3);
|
||||
#endif
|
||||
test_one<multi_polygon_type, polygon_type>("rt_g1", rt_g1, join_miter, end_flat, 30.3137, 1.0);
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
test_one<multi_polygon_type, polygon_type>("rt_g2", rt_g2, join_miter, end_flat, 18.5711, 1.0);
|
||||
#endif
|
||||
|
||||
test_one<multi_polygon_type, polygon_type>("rt_h", rt_h, join_round, end_flat, 47.6012, 1.0);
|
||||
test_one<multi_polygon_type, polygon_type>("rt_h", rt_h, join_miter, end_flat, 61.7058, 1.0);
|
||||
test_one<multi_polygon_type, polygon_type>("rt_i", rt_i, join_round, end_flat, 10.7528, 1.0);
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
test_one<multi_polygon_type, polygon_type>("rt_i", rt_i, join_miter, end_flat, 13.6569, 1.0);
|
||||
#endif
|
||||
test_one<multi_polygon_type, polygon_type>("rt_j", rt_j, join_round, end_flat, 28.7309, 1.0);
|
||||
#endif
|
||||
test_one<multi_polygon_type, polygon_type>("rt_j", rt_j, join_miter, end_flat, 35.1421, 1.0);
|
||||
test_one<multi_polygon_type, polygon_type>("rt_k", rt_k, join_round, end_flat, 42.0092, 1.0);
|
||||
test_one<multi_polygon_type, polygon_type>("rt_k", rt_k, join_miter, end_flat, 48.0563, 1.0);
|
||||
@@ -429,11 +427,11 @@ void test_all()
|
||||
|
||||
test_one<multi_polygon_type, polygon_type>("rt_p18", rt_p18, join_miter, end_flat, 23.3137, 1.0);
|
||||
test_one<multi_polygon_type, polygon_type>("rt_p19", rt_p19, join_miter, end_flat, 25.5637, 1.0);
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
test_one<multi_polygon_type, polygon_type>("rt_p20", rt_p20, join_miter, end_flat, 25.4853, 1.0);
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
test_one<multi_polygon_type, polygon_type>("rt_p21", rt_p21, join_miter, end_flat, 17.1716, 1.0);
|
||||
#endif
|
||||
|
||||
@@ -443,7 +441,7 @@ void test_all()
|
||||
test_one<multi_polygon_type, polygon_type>("rt_q2", rt_q2, join_miter, end_flat, 26.4853, 1.0);
|
||||
test_one<multi_polygon_type, polygon_type>("rt_q2", rt_q2, join_miter, end_flat, 0.9697, -0.25);
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
test_one<multi_polygon_type, polygon_type>("rt_r", rt_r, join_miter, end_flat, 21.0761, 1.0);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -374,7 +374,9 @@ void test_all()
|
||||
test_one<polygon_type, polygon_type>("snake4", snake, join_miter, end_flat, 64.44, 0.4);
|
||||
test_one<polygon_type, polygon_type>("snake5", snake, join_miter, end_flat, 72, 0.5);
|
||||
test_one<polygon_type, polygon_type>("snake6", snake, join_miter, end_flat, 75.44, 0.6);
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
test_one<polygon_type, polygon_type>("snake16", snake, join_miter, end_flat, 114.24, 1.6);
|
||||
#endif
|
||||
|
||||
test_one<polygon_type, polygon_type>("funnelgate2", funnelgate, join_miter, end_flat, 120.982, 2.0);
|
||||
test_one<polygon_type, polygon_type>("funnelgate3", funnelgate, join_miter, end_flat, 13.0*13.0, 3.0);
|
||||
@@ -552,8 +554,8 @@ void test_all()
|
||||
|
||||
test_one<polygon_type, polygon_type>("ticket_10412", ticket_10412, join_miter, end_flat, 3109.6616, 1.5, settings);
|
||||
test_one<polygon_type, polygon_type>("ticket_11580_100", ticket_11580, join_miter, end_flat, 52.0221000, 1.00, settings);
|
||||
#if defined(BOOST_GEOMETRY_TEST_ENABLE_FAILING)
|
||||
// Larger distance, resulting in only one circle
|
||||
#if defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
// Larger distance, resulting in only one circle. Not solved yet in non-rescaled mode.
|
||||
test_one<polygon_type, polygon_type>("ticket_11580_237", ticket_11580, join_miter, end_flat, 999.999, 2.37, settings);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -349,7 +349,7 @@ void test_buffer(std::string const& caseid,
|
||||
// }
|
||||
}
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ENABLE_FAILING)
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ALWAYS_CHECK_VALIDITY)
|
||||
if (settings.test_validity)
|
||||
#endif
|
||||
{
|
||||
|
||||
@@ -228,10 +228,12 @@ private :
|
||||
{
|
||||
continue;
|
||||
}
|
||||
#if 0 // Does not compile (SVG is not enabled by default)
|
||||
if (m_zoom && bg::disjoint(corner, m_alternate_box))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (m_zoom && do_pieces)
|
||||
{
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#define BOOST_TEST_MODULE test_distance_geographic_pointlike_linear
|
||||
#endif
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#include <boost/geometry/srs/spheroid.hpp>
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
@@ -26,6 +28,9 @@ typedef bg::model::segment<point_type> segment_type;
|
||||
typedef bg::model::linestring<point_type> linestring_type;
|
||||
typedef bg::model::multi_linestring<linestring_type> multi_linestring_type;
|
||||
|
||||
typedef bg::cs::geographic<bg::radian> cs_type_rad;
|
||||
typedef bg::model::point<double, 2, cs_type_rad> point_type_rad;
|
||||
typedef bg::model::segment<point_type_rad> segment_type_rad;
|
||||
|
||||
//===========================================================================
|
||||
|
||||
@@ -76,7 +81,7 @@ void test_distance_point_segment(Strategy_pp const& strategy_pp,
|
||||
tester::apply("p-s-02",
|
||||
"POINT(2.5 3)",
|
||||
"SEGMENT(2 0,3 0)",
|
||||
pp_distance("POINT(2.5 3)", "POINT(2.49777 0)", strategy_pp),
|
||||
pp_distance("POINT(2.5 3)", "POINT(2.5 0)", strategy_pp),
|
||||
strategy_ps, true, true);
|
||||
tester::apply("p-s-03",
|
||||
"POINT(2 0)",
|
||||
@@ -171,19 +176,19 @@ void test_distance_point_segment(Strategy_pp const& strategy_pp,
|
||||
tester::apply("p-s-down-1",
|
||||
"POINT(2 1)",
|
||||
"SEGMENT(2 2,3 2)",
|
||||
pp_distance("POINT(2.0003 2)", "POINT(2 1)", strategy_pp),
|
||||
pp_distance("POINT(2 2)", "POINT(2 1)", strategy_pp),
|
||||
strategy_ps, true, true);
|
||||
|
||||
tester::apply("p-s-down-2",
|
||||
"POINT(3 1)",
|
||||
"SEGMENT(2 2,3 2)",
|
||||
pp_distance("POINT(2.9997 2)", "POINT(3 1)", strategy_pp),
|
||||
pp_distance("POINT(3 2)", "POINT(3 1)", strategy_pp),
|
||||
strategy_ps, true, true);
|
||||
|
||||
tester::apply("p-s-south",
|
||||
"POINT(3 -1)",
|
||||
"SEGMENT(2 -2,3 -2)",
|
||||
pp_distance("POINT(2.9997 -2)", "POINT(3 -1)", strategy_pp),
|
||||
pp_distance("POINT(3 -2)", "POINT(3 -1)", strategy_pp),
|
||||
strategy_ps, true, true);
|
||||
|
||||
tester::apply("p-s-antimeridian-1",
|
||||
@@ -381,6 +386,53 @@ void test_distance_point_segment_no_thomas(Strategy_pp const& strategy_pp,
|
||||
strategy_ps, true, true);
|
||||
}
|
||||
|
||||
template <typename Strategy_pp, typename Strategy_ps>
|
||||
void test_distance_point_segment_rad_mix(Strategy_pp const& strategy_pp,
|
||||
Strategy_ps const& strategy_ps)
|
||||
{
|
||||
|
||||
#ifdef BOOST_GEOMETRY_TEST_DEBUG
|
||||
std::cout << std::endl;
|
||||
std::cout << "point/segment distance tests" << std::endl;
|
||||
#endif
|
||||
typedef test_distance_of_geometries<point_type, segment_type> tester1;
|
||||
typedef test_distance_of_geometries<point_type_rad, segment_type> tester2;
|
||||
typedef test_distance_of_geometries<point_type, segment_type_rad> tester3;
|
||||
typedef test_distance_of_geometries<point_type_rad, segment_type_rad> tester4;
|
||||
|
||||
const double d2r = bg::math::d2r<double>();
|
||||
|
||||
std::ostringstream s1;
|
||||
s1 << 1*d2r;
|
||||
std::ostringstream s2;
|
||||
s2 << 2*d2r;
|
||||
std::ostringstream s3;
|
||||
s3 << 3*d2r;
|
||||
|
||||
tester1::apply("p-s-mix1",
|
||||
"POINT(3 1)",
|
||||
"SEGMENT(2 2,3 2)",
|
||||
pp_distance("POINT(3 2)", "POINT(3 1)", strategy_pp),
|
||||
strategy_ps, true, true);
|
||||
tester2::apply("p-s-mix2",
|
||||
"POINT(" + s3.str() + " " + s1.str() + ")",
|
||||
"SEGMENT(2 2,3 2)",
|
||||
pp_distance("POINT(3 2)", "POINT(3 1)", strategy_pp),
|
||||
strategy_ps, true, true);
|
||||
tester3::apply("p-s-mix3",
|
||||
"POINT(3 1)",
|
||||
"SEGMENT(" + s2.str() + " " + s2.str() + ","
|
||||
+ s3.str() + " " + s2.str() + ")",
|
||||
pp_distance("POINT(3 2)", "POINT(3 1)", strategy_pp),
|
||||
strategy_ps, true, true);
|
||||
tester4::apply("p-s-mix4",
|
||||
"POINT(" + s3.str() + " " + s1.str() + ")",
|
||||
"SEGMENT(" + s2.str() + " " + s2.str() + ","
|
||||
+ s3.str() + " " + s2.str() + ")",
|
||||
pp_distance("POINT(3 2)", "POINT(3 1)", strategy_pp),
|
||||
strategy_ps, true, true);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
||||
template <typename Strategy_pp, typename Strategy_ps>
|
||||
@@ -657,6 +709,7 @@ void test_all_pl_l(Strategy_pp pp_strategy, Strategy_ps ps_strategy,
|
||||
|
||||
BOOST_AUTO_TEST_CASE( test_all_pointlike_linear )
|
||||
{
|
||||
test_all_pl_l(vincenty_pp(), vincenty_ps_bisection());
|
||||
test_all_pl_l(vincenty_pp(), vincenty_ps());
|
||||
test_all_pl_l(thomas_pp(), thomas_ps());
|
||||
test_all_pl_l(andoyer_pp(), andoyer_ps());
|
||||
@@ -668,4 +721,8 @@ BOOST_AUTO_TEST_CASE( test_all_pointlike_linear )
|
||||
test_distance_point_segment_no_thomas(vincenty_pp(), vincenty_ps());
|
||||
//test_distance_point_segment_no_thomas(thomas_pp(), thomas_ps());
|
||||
test_distance_point_segment_no_thomas(andoyer_pp(), andoyer_ps());
|
||||
|
||||
test_distance_point_segment_rad_mix(vincenty_pp(), vincenty_ps());
|
||||
test_distance_point_segment_rad_mix(thomas_pp(), thomas_ps());
|
||||
test_distance_point_segment_rad_mix(andoyer_pp(), andoyer_ps());
|
||||
}
|
||||
|
||||
@@ -71,6 +71,9 @@ typedef bg::strategy::distance::geographic_cross_track<bg::strategy::thomas, sty
|
||||
typedef bg::strategy::distance::geographic_cross_track<bg::strategy::vincenty, stype, double>
|
||||
vincenty_ps;
|
||||
|
||||
typedef bg::strategy::distance::detail::geographic_cross_track<bg::strategy::vincenty, stype, double, true>
|
||||
vincenty_ps_bisection;
|
||||
|
||||
// Spherical strategy for point-box distance
|
||||
|
||||
typedef bg::strategy::distance::cross_track_point_box<> spherical_pb;
|
||||
@@ -423,10 +426,10 @@ struct test_distance_of_geometries<Geometry1, Geometry2, 0, 0>
|
||||
<< " -> "
|
||||
<< string_from_type<default_distance_result>::name()
|
||||
<< std::endl;
|
||||
std::cout << "expected distance = "
|
||||
std::cout << "expected distance = " << std::setprecision(10)
|
||||
<< expected_distance << " ; "
|
||||
<< std::endl;
|
||||
std::cout << "distance = "
|
||||
std::cout << "distance = " << std::setprecision(10)
|
||||
<< dist << " ; "
|
||||
<< std::endl;
|
||||
|
||||
@@ -448,7 +451,7 @@ struct test_distance_of_geometries<Geometry1, Geometry2, 0, 0>
|
||||
dist, expected_distance);
|
||||
|
||||
#ifdef BOOST_GEOMETRY_TEST_DEBUG
|
||||
std::cout << "distance[reversed args] = "
|
||||
std::cout << "distance[reversed args] = " << std::setprecision(10)
|
||||
<< dist
|
||||
<< std::endl;
|
||||
#endif
|
||||
@@ -476,7 +479,7 @@ struct test_distance_of_geometries<Geometry1, Geometry2, 0, 0>
|
||||
dist, expected_distance);
|
||||
|
||||
#ifdef BOOST_GEOMETRY_TEST_DEBUG
|
||||
std::cout << "distance[swap geometry args] = "
|
||||
std::cout << "distance[swap geometry args] = " << std::setprecision(10)
|
||||
<< dist
|
||||
<< std::endl;
|
||||
std::cout << std::endl;
|
||||
@@ -504,7 +507,7 @@ struct test_distance_of_geometries<Geometry1, Geometry2, 0, 0>
|
||||
dist, expected_distance);
|
||||
|
||||
#ifdef BOOST_GEOMETRY_TEST_DEBUG
|
||||
std::cout << "distance[mirror geometries] = "
|
||||
std::cout << "distance[mirror geometries] = " << std::setprecision(10)
|
||||
<< dist
|
||||
<< std::endl;
|
||||
std::cout << std::endl;
|
||||
|
||||
@@ -2308,11 +2308,11 @@ BOOST_AUTO_TEST_CASE( envelope_sphere_multilinestring )
|
||||
from_wkt<G>("MULTILINESTRING((10 15))"),
|
||||
10, 15, 10, 15);
|
||||
|
||||
#ifdef BOOST_GEOMETRY_INCLUDE_FAILING_TESTS
|
||||
#ifdef BOOST_GEOMETRY_TEST_FAILURES
|
||||
tester::apply("ml01a",
|
||||
from_wkt<G>("MULTILINESTRING((),(),(10 15),())"),
|
||||
10, 15, 10, 15);
|
||||
#endif // BOOST_GEOMETRY_INCLUDE_FAILING_TESTS
|
||||
#endif
|
||||
|
||||
tester::apply("ml02",
|
||||
from_wkt<G>("MULTILINESTRING((-170 40,-100 80,10 40),(-10 25,10 35,100 45),(50 30,150 45,-160 30))"),
|
||||
@@ -2372,11 +2372,11 @@ BOOST_AUTO_TEST_CASE( envelope_spheroid_multilinestring )
|
||||
from_wkt<G>("MULTILINESTRING((10 15))"),
|
||||
10, 15, 10, 15);
|
||||
|
||||
#ifdef BOOST_GEOMETRY_INCLUDE_FAILING_TESTS
|
||||
#ifdef BOOST_GEOMETRY_TEST_FAILURES
|
||||
tester::apply("ml01a",
|
||||
from_wkt<G>("MULTILINESTRING((),(),(10 15),())"),
|
||||
10, 15, 10, 15);
|
||||
#endif // BOOST_GEOMETRY_INCLUDE_FAILING_TESTS
|
||||
#endif
|
||||
|
||||
tester::apply("ml02",
|
||||
from_wkt<G>("MULTILINESTRING((-170 40,-100 80,10 40),(-10 25,10 35,100 45),(50 30,150 45,-160 30))"),
|
||||
@@ -2416,11 +2416,11 @@ BOOST_AUTO_TEST_CASE( envelope_multilinestring_sphere_with_height )
|
||||
from_wkt<G>("MULTILINESTRING((10 15 1000))"),
|
||||
10, 15, 1000, 10, 15, 1000);
|
||||
|
||||
#ifdef BOOST_GEOMETRY_INCLUDE_FAILING_TESTS
|
||||
#ifdef BOOST_GEOMETRY_TEST_FAILURES
|
||||
tester::apply("mlh01a",
|
||||
from_wkt<G>("MULTILINESTRING((),(),(10 15 1000),())"),
|
||||
10, 15, 1000, 10, 15, 1000);
|
||||
#endif // BOOST_GEOMETRY_INCLUDE_FAILING_TESTS
|
||||
#endif
|
||||
|
||||
tester::apply("mlh02",
|
||||
from_wkt<G>("MULTILINESTRING((-170 40 400,-100 80 300),(-10 25 600,10 35 700,120 45 450))"),
|
||||
@@ -2439,11 +2439,11 @@ BOOST_AUTO_TEST_CASE( envelope_multilinestring_spheroid_with_height )
|
||||
from_wkt<G>("MULTILINESTRING((10 15 1000))"),
|
||||
10, 15, 1000, 10, 15, 1000);
|
||||
|
||||
#ifdef BOOST_GEOMETRY_INCLUDE_FAILING_TESTS
|
||||
#ifdef BOOST_GEOMETRY_TEST_FAILURES
|
||||
tester::apply("mlh01a",
|
||||
from_wkt<G>("MULTILINESTRING((),(),(10 15 1000),())"),
|
||||
10, 15, 1000, 10, 15, 1000);
|
||||
#endif // BOOST_GEOMETRY_INCLUDE_FAILING_TESTS
|
||||
#endif
|
||||
|
||||
tester::apply("mlh02",
|
||||
from_wkt<G>("MULTILINESTRING((-170 40 400,-100 80 300),(-10 25 600,10 35 700,120 45 450))"),
|
||||
|
||||
@@ -243,7 +243,7 @@ struct box_check_equals
|
||||
{
|
||||
equals_with_tolerance equals(tol);
|
||||
|
||||
#ifndef BOOST_GEOMETRY_TEST_ENABLE_FAILING
|
||||
#ifndef BOOST_GEOMETRY_TEST_FAILURES
|
||||
// check latitude with tolerance when necessary
|
||||
return equals_with_eps(bg::get<0, 0>(box), lon_min)
|
||||
&& (bg::get<0, 1>(box) < 0
|
||||
@@ -276,7 +276,7 @@ struct box_check_equals<Box, 3>
|
||||
T3 const& lon_max, T4 const& lat_max, double height_max,
|
||||
double tol)
|
||||
{
|
||||
#ifndef BOOST_GEOMETRY_TEST_ENABLE_FAILING
|
||||
#ifndef BOOST_GEOMETRY_TEST_FAILURES
|
||||
equals_with_tolerance equals(tol);
|
||||
|
||||
return box_check_equals<Box, 2>::apply(box,
|
||||
|
||||
@@ -1009,7 +1009,7 @@ inline void test_open_multipolygons()
|
||||
}
|
||||
|
||||
// MySQL report 30.06.2015
|
||||
#ifdef BOOST_GEOMETRY_TEST_ENABLE_FAILING
|
||||
#ifdef BOOST_GEOMETRY_TEST_FAILURES
|
||||
{
|
||||
std::string wkt = "MULTIPOLYGON(((153.60036248974487 -86.4072234353084,134.8924761503673 -92.0821987136617,151.87887755950274 -92.0821987136617,153.60036248974487 -86.4072234353084)),((-162.3619975827558 -20.37135271519032,-170.42498886764488 -34.35970444494861,-168.21072335866987 -37.67358696575207,-162.3619975827558 -20.37135271519032)),((25.982352329146433 -1.793573272167862,25.81900562736861 -2.0992322130216032,24.216310496207715 -2.737558757030656,25.9822948153016 -1.7936204725604972,25.982352329146433 -1.793573272167862)))";
|
||||
|
||||
@@ -1200,7 +1200,7 @@ inline void test_open_multipolygons()
|
||||
|
||||
BOOST_CHECK_MESSAGE(bg::is_valid(mpoly, msg), msg);
|
||||
}
|
||||
#endif // BOOST_GEOMETRY_TEST_ENABLE_FAILING
|
||||
#endif // BOOST_GEOMETRY_TEST_FAILURES
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( test_is_valid_multipolygon )
|
||||
|
||||
@@ -3,6 +3,11 @@
|
||||
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2019.
|
||||
// Modifications copyright (c) 2019, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -41,18 +46,11 @@
|
||||
template <typename Geometry>
|
||||
inline void test_assemble(std::string const& id, Geometry const& p, Geometry const& q, char operation = 'i')
|
||||
{
|
||||
typedef typename bg::point_type<Geometry>::type point_type;
|
||||
typedef typename bg::rescale_policy_type<point_type>::type
|
||||
rescale_policy_type;
|
||||
rescale_policy_type rescale_policy
|
||||
= bg::get_rescale_policy<rescale_policy_type>(p, q);
|
||||
|
||||
|
||||
std::vector<Geometry> u, i, d1, d2;
|
||||
bg::detail::union_::union_insert<Geometry>(p, q, std::back_inserter(u));
|
||||
bg::detail::intersection::intersection_insert<Geometry>(p, q, std::back_inserter(i));
|
||||
bg::detail::difference::difference_insert<Geometry>(p, q, rescale_policy, std::back_inserter(d1));
|
||||
bg::detail::difference::difference_insert<Geometry>(q, p, rescale_policy, std::back_inserter(d2));
|
||||
bg::detail::difference::difference_insert<Geometry>(p, q, std::back_inserter(d1));
|
||||
bg::detail::difference::difference_insert<Geometry>(q, p, std::back_inserter(d2));
|
||||
|
||||
if (operation == 'i')
|
||||
{
|
||||
|
||||
@@ -268,7 +268,7 @@ void test_all()
|
||||
{
|
||||
// BUG - the operations are correct but IP coordinates are wrong
|
||||
// ok now also the 3rd turn is wrong
|
||||
#ifdef BOOST_GEOMETRY_TEST_ENABLE_FAILING
|
||||
#ifdef BOOST_GEOMETRY_TEST_FAILURES
|
||||
test_geometry<ls, ls>("LINESTRING(8 5,5 1,-2 3,1 10)",
|
||||
"LINESTRING(1.9375 1.875, 1.7441860465116283 1.9302325581395348, -0.7692307692307692 2.6483516483516487, -2 3, -1.0071942446043165 5.316546762589928)",
|
||||
expected("mii++")("ccc==")("ccc==")("mux=="));
|
||||
|
||||
@@ -783,6 +783,62 @@ static std::string case_precision_13[2] =
|
||||
"POLYGON((1 1,9.99999999999999912e-06 1,9.99999999999999912e-06 3,1 3,1 1))"
|
||||
};
|
||||
|
||||
static std::string case_precision_14[2] =
|
||||
{
|
||||
"POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))",
|
||||
"POLYGON((2 7,4 7,4.00000079999999958 3.00000020000000012,2 3,2 7))"
|
||||
};
|
||||
|
||||
static std::string case_precision_15[2] =
|
||||
{
|
||||
// Needs handling of side_value
|
||||
"POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))",
|
||||
"POLYGON((-1 -1,-1 8,8 8,8 -1,-1 -1),(2 7,2 3,3.99999599999999988 3.00000499999999981,4 7,2 7))"
|
||||
};
|
||||
|
||||
static std::string case_precision_16[2] =
|
||||
{
|
||||
"POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))",
|
||||
"POLYGON((-1 -1,-1 8,8 8,8 -1,-1 -1),(2 7,2 3,4 2.99999940000000009,4 7,2 7))"
|
||||
};
|
||||
|
||||
static std::string case_precision_17[2] =
|
||||
{
|
||||
"POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))",
|
||||
"POLYGON((-1 -1,-1 8,8 8,8 -1,-1 -1),(2 7,2 3,4 3.00000499999999999,4 7,2 7))"
|
||||
};
|
||||
|
||||
static std::string case_precision_18[2] =
|
||||
{
|
||||
"POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))",
|
||||
"POLYGON((-1 -1,-1 8,8 8,8 -1,-1 -1),(2 7,2.00000199999999984 3.00000400000000012,4 3,4 7,2 7))"
|
||||
};
|
||||
|
||||
static std::string case_precision_19[2] =
|
||||
{
|
||||
"POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))",
|
||||
"POLYGON((-1 -1,-1 8,8 8,8 -1,-1 -1),(2 7,1.99999199999999999 2.99999400000000005,4 3,4 7,2 7))"
|
||||
};
|
||||
|
||||
static std::string case_precision_20[2] =
|
||||
{
|
||||
"POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))",
|
||||
"POLYGON((2 7,4 7,4 3,2.00000000000000044 3,2 7))"
|
||||
};
|
||||
|
||||
static std::string case_precision_21[2] =
|
||||
{
|
||||
"POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))",
|
||||
"POLYGON((2 7,4 7,4 3.00001000000000007,2 3,2 7))"
|
||||
};
|
||||
|
||||
static std::string case_precision_22[2] =
|
||||
{
|
||||
"POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))",
|
||||
"POLYGON((-1 -1,-1 8,8 8,8 -1,-1 -1),(2 7,2 3,4.00000000200000017 2.99999999000000006,4 7,2 7))"
|
||||
};
|
||||
|
||||
|
||||
// ticket_17 is keyholed, so has a hole formed by an deliberate intersection
|
||||
// This will fail the intersection/traversal process
|
||||
static std::string ticket_17[2] = {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
// Copyright (c) 2016 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2017.
|
||||
// Modifications copyright (c) 2017, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2017, 2019.
|
||||
// Modifications copyright (c) 2017, 2019, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@@ -157,13 +157,10 @@ std::vector<std::size_t> apply_overlay(
|
||||
detail::overlay::assign_null_policy
|
||||
>(geometry1, geometry2, strategy, robust_policy, turns, policy);
|
||||
|
||||
typename Strategy::side_strategy_type side_strategy;
|
||||
cluster_type clusters;
|
||||
|
||||
bg::enrich_intersection_points<Reverse1, Reverse2, OverlayType>(turns,
|
||||
clusters, geometry1, geometry2,
|
||||
robust_policy,
|
||||
side_strategy);
|
||||
clusters, geometry1, geometry2, robust_policy, strategy);
|
||||
|
||||
// Gather cluster properties, with test option
|
||||
return ::gather_cluster_properties<Reverse1, Reverse2, OverlayType>(
|
||||
|
||||
@@ -580,7 +580,7 @@ void test_all(bool test_self_tangencies = true, bool test_mixed = false)
|
||||
2, 2.0, case_82[0], case_82[2]);
|
||||
// other
|
||||
|
||||
#ifdef BOOST_GEOMETRY_ENABLE_FAILING_TESTS
|
||||
#ifdef BOOST_GEOMETRY_TEST_FAILURES
|
||||
// simplified version of 82, area should be different
|
||||
// missing IP at (1.5 3.5) from (1 4,1.5 3.5,2 4)x(2 4,1 3)
|
||||
test_traverse_intersection::apply("83",
|
||||
|
||||
@@ -61,7 +61,7 @@ void test_geometries()
|
||||
case_58_multi[4], case_58_multi[2]
|
||||
);
|
||||
|
||||
#ifdef BOOST_GEOMETRY_TEST_INCLUDE_FAILING_TESTS
|
||||
#ifdef BOOST_GEOMETRY_TEST_FAILURES
|
||||
test_traverse_intersection::apply
|
||||
(
|
||||
"case_58_multi_b5", 1, 1,
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2015, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2015, 2019, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
// http://www.boost.org/users/license.html
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
|
||||
#ifndef BOOST_GEOMETRY_TEST_CHECK_TURN_LESS_HPP
|
||||
#define BOOST_GEOMETRY_TEST_CHECK_TURN_LESS_HPP
|
||||
|
||||
@@ -86,11 +87,13 @@ struct check_turn_less
|
||||
bg::detail::get_turns::get_turn_info_type
|
||||
<
|
||||
Geometry1, Geometry2, assign_policy<>
|
||||
>,
|
||||
robust_policy_type
|
||||
>
|
||||
> get_turns_type;
|
||||
|
||||
typedef typename get_turns_type::turn_info turn_info;
|
||||
typedef typename get_turns_type::template turn_info_type
|
||||
<
|
||||
strategy_type, robust_policy_type
|
||||
>::type turn_info;
|
||||
|
||||
typedef std::vector<turn_info> turns_container;
|
||||
|
||||
|
||||
@@ -85,13 +85,11 @@ void test_all()
|
||||
1, 5, 8.0,
|
||||
1, 5, 8.0);
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
test_one<polygon, polygon, polygon>("star_comb_15",
|
||||
star_comb_15[0], star_comb_15[1],
|
||||
30, -1, 227.658275102812,
|
||||
30, -1, 480.485775259312,
|
||||
sym_settings);
|
||||
#endif
|
||||
|
||||
test_one<polygon, polygon, polygon>("new_hole",
|
||||
new_hole[0], new_hole[1],
|
||||
@@ -122,7 +120,6 @@ void test_all()
|
||||
1, 5, 9.0,
|
||||
1, 5, 9.0);
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
test_one<polygon, polygon, polygon>("only_hole_intersections1",
|
||||
only_hole_intersections[0], only_hole_intersections[1],
|
||||
2, 10, 1.9090909,
|
||||
@@ -134,7 +131,6 @@ void test_all()
|
||||
3, 20, 30.9090909,
|
||||
4, 16, 10.9090909,
|
||||
sym_settings);
|
||||
#endif
|
||||
|
||||
test_one<polygon, polygon, polygon>("first_within_second",
|
||||
first_within_second[1], first_within_second[0],
|
||||
@@ -271,15 +267,14 @@ void test_all()
|
||||
1, 61, 10.2717,
|
||||
1, 61, 10.2717);
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
if ( BOOST_GEOMETRY_CONDITION((boost::is_same<ct, double>::value)) )
|
||||
{
|
||||
test_one<polygon, polygon, polygon>("buffer_mp2",
|
||||
buffer_mp2[0], buffer_mp2[1],
|
||||
1, 91, 12.09857,
|
||||
1, 155, 24.19714);
|
||||
1, 155, 24.19714,
|
||||
BG_IF_RESCALED(2, 1), -1, 12.09857 + 24.19714);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*** TODO: self-tangencies for difference
|
||||
test_one<polygon, polygon, polygon>("wrapped_a",
|
||||
@@ -297,6 +292,7 @@ void test_all()
|
||||
ut_settings settings;
|
||||
settings.percentage = BG_IF_RESCALED(0.001, 0.1);
|
||||
settings.test_validity = BG_IF_RESCALED(true, false);
|
||||
settings.sym_difference = BG_IF_RESCALED(true, false);
|
||||
|
||||
// Isovist - the # output polygons differ per compiler/pointtype, (very) small
|
||||
// rings might be discarded. We check area only
|
||||
@@ -312,7 +308,7 @@ void test_all()
|
||||
settings);
|
||||
}
|
||||
|
||||
#if defined(BOOST_GEOMETRY_TEST_ENABLE_FAILING)
|
||||
#if defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
test_one<polygon, polygon, polygon>("geos_1",
|
||||
geos_1[0], geos_1[1],
|
||||
21, -1, 0.31640625,
|
||||
@@ -378,7 +374,7 @@ void test_all()
|
||||
1, -1, 35723.8506317139 + 58456.4964294434);
|
||||
}
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
{
|
||||
// symmetric difference is not valid due to robustness issue, it has
|
||||
// two turns (touch_only) and a midpoint is located in other polygon
|
||||
@@ -399,22 +395,21 @@ void test_all()
|
||||
1, 5, 384.2295081964694,
|
||||
tolerance(0.01));
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
// 2011-07-02 / 2014-06-19
|
||||
// Interesting FP-precision case.
|
||||
// sql server gives: 6.62295817619452E-05
|
||||
// PostGIS gives: 0.0 (no output)
|
||||
// Boost.Geometry gave results depending on FP-type, and compiler, and operating system.
|
||||
// Since rescaling to integer results are equal w.r.t. compiler/FP type,
|
||||
// With rescaling results are equal w.r.t. compiler/FP type,
|
||||
// however, some long spikes are still generated in the resulting difference
|
||||
// Without rescaling there is no output, like PostGIS
|
||||
test_one<polygon, polygon, polygon>("ggl_list_20110627_phillip",
|
||||
ggl_list_20110627_phillip[0], ggl_list_20110627_phillip[1],
|
||||
if_typed_tt<ct>(1, 1), -1,
|
||||
if_typed_tt<ct>(0.0000000000001105367, 0.000125137888971949),
|
||||
BG_IF_RESCALED(1, 0), -1,
|
||||
BG_IF_RESCALED(if_typed_tt<ct>(0.0000000000001105367, 0.000125137888971949), 0),
|
||||
1, -1, 3577.40960816756,
|
||||
tolerance(0.01)
|
||||
);
|
||||
#endif
|
||||
|
||||
{
|
||||
// With rescaling, difference of output a-b and a sym b is invalid
|
||||
@@ -438,19 +433,17 @@ void test_all()
|
||||
1, 10, 10.03103292,
|
||||
0, 0, 0);
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
test_one<polygon, polygon, polygon>("ticket_9081_15",
|
||||
ticket_9081_15[0], ticket_9081_15[1],
|
||||
2, 10, 0.0334529710902111,
|
||||
1, 4, 5.3469555172380723e-010);
|
||||
#endif
|
||||
2, -1, 0.0334529710902111,
|
||||
BG_IF_RESCALED(1, 0), -1, BG_IF_RESCALED(5.3469555172380723e-010, 0));
|
||||
|
||||
test_one<polygon, polygon, polygon>("ticket_9081_314",
|
||||
ticket_9081_314[0], ticket_9081_314[1],
|
||||
2, 12, 0.0451236449624935,
|
||||
0, 0, 0);
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
test_one<polygon, polygon, polygon>("ticket_9563",
|
||||
ticket_9563[0], ticket_9563[1],
|
||||
0, -1, 0,
|
||||
@@ -463,12 +456,11 @@ void test_all()
|
||||
1, 4, 0.029019232,
|
||||
sym_settings);
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
test_one<polygon, polygon, polygon>("ticket_10108_b",
|
||||
ticket_10108_b[0], ticket_10108_b[1],
|
||||
1, 5, 1081.68697,
|
||||
1, 5, 1342.65795);
|
||||
#endif
|
||||
1, -1, 1081.68697,
|
||||
1, -1, 1342.65795,
|
||||
BG_IF_RESCALED(2, 1), -1, 1081.68697 + 1342.65795);
|
||||
|
||||
test_one<polygon, polygon, polygon>("ticket_11725",
|
||||
ticket_11725[0], ticket_11725[1],
|
||||
@@ -567,7 +559,7 @@ void test_all()
|
||||
TEST_DIFFERENCE(mysql_23023665_2, 1, 96.0, 1, 16.0, 2);
|
||||
TEST_DIFFERENCE(mysql_23023665_3, 1, 225.0, 1, 66.0, 2);
|
||||
TEST_DIFFERENCE(mysql_23023665_5, 2, 165.23735, 2, 105.73735, 4);
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
TEST_DIFFERENCE(mysql_23023665_6, 2, 105.68756, 3, 10.18756, 5);
|
||||
TEST_DIFFERENCE(mysql_23023665_13, 3, 99.74526, 3, 37.74526, 6);
|
||||
#endif
|
||||
|
||||
@@ -503,7 +503,7 @@ BOOST_AUTO_TEST_CASE( test_difference_linestring_linestring )
|
||||
"lldf29d"
|
||||
);
|
||||
|
||||
#ifdef GEOMETRY_TEST_INCLUDE_FAILING_TESTS
|
||||
#ifdef BOOST_GEOMETRY_TEST_FAILURES
|
||||
tester::apply
|
||||
(from_wkt<L>("LINESTRING(8 5,5 1,-2 3,1 10)"),
|
||||
from_wkt<L>("LINESTRING(1.9375 1.875,\
|
||||
|
||||
@@ -166,7 +166,7 @@ void test_areal()
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
{
|
||||
// Without rescaling, this one misses one of the output polygons
|
||||
// With rescaling, it is complete but invalid
|
||||
@@ -316,7 +316,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_ENABLE_FAILING)
|
||||
#if defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
// Misses one triangle
|
||||
TEST_DIFFERENCE(case_recursive_boxes_62, 5, 5.0, 11, 5.75, 12);
|
||||
#endif
|
||||
|
||||
@@ -37,7 +37,7 @@ void test_spikes_in_ticket_8364()
|
||||
// The difference of polygons below result in a spike. The spike should be there, it is also generated in ttmath,
|
||||
// and (e.g.) in SQL Server. However, using int-coordinates, the spike makes the polygon invalid. Therefore it is now (since August 2013) checked and removed.
|
||||
|
||||
#ifdef BOOST_GEOMETRY_TEST_INCLUDE_FAILING_TESTS
|
||||
#ifdef BOOST_GEOMETRY_TEST_FAILURES
|
||||
// TODO: commented working at ii/validity, this changes the area slightly, to be checked
|
||||
// So using int's, the spike is removed automatically. Therefore there is one polygon less, and less points. Also area differs
|
||||
test_one<polygon, multi_polygon, multi_polygon>("ticket_8364_step3",
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2016, 2017.
|
||||
// Modifications copyright (c) 2016-2017, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2016, 2017, 2019.
|
||||
// Modifications copyright (c) 2016-2019, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@@ -187,11 +187,9 @@ std::string test_difference(std::string const& caseid, G1 const& g1, G2 const& g
|
||||
return_string << bg::wkt(result);
|
||||
|
||||
typename bg::default_area_result<G1>::type const area = bg::area(result);
|
||||
std::size_t const n = expected_point_count >= 0
|
||||
? bg::num_points(result) : 0;
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_NO_BOOST_TEST)
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ENABLE_FAILING)
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ALWAYS_CHECK_VALIDITY)
|
||||
if (settings.test_validity)
|
||||
#endif
|
||||
{
|
||||
@@ -211,13 +209,6 @@ std::string test_difference(std::string const& caseid, G1 const& g1, G2 const& g
|
||||
{
|
||||
// Test inserter functionality
|
||||
// Test if inserter returns output-iterator (using Boost.Range copy)
|
||||
typedef typename bg::point_type<G1>::type point_type;
|
||||
typedef typename bg::rescale_policy_type<point_type>::type
|
||||
rescale_policy_type;
|
||||
|
||||
rescale_policy_type rescale_policy
|
||||
= bg::get_rescale_policy<rescale_policy_type>(g1, g2);
|
||||
|
||||
typename setop_output_type<OutputType>::type
|
||||
inserted, array_with_one_empty_geometry;
|
||||
array_with_one_empty_geometry.push_back(OutputType());
|
||||
@@ -225,13 +216,13 @@ std::string test_difference(std::string const& caseid, G1 const& g1, G2 const& g
|
||||
{
|
||||
boost::copy(array_with_one_empty_geometry,
|
||||
bg::detail::sym_difference::sym_difference_insert<OutputType>
|
||||
(g1, g2, rescale_policy, std::back_inserter(inserted)));
|
||||
(g1, g2, std::back_inserter(inserted)));
|
||||
}
|
||||
else
|
||||
{
|
||||
boost::copy(array_with_one_empty_geometry,
|
||||
bg::detail::difference::difference_insert<OutputType>(
|
||||
g1, g2, rescale_policy, std::back_inserter(inserted)));
|
||||
g1, g2, std::back_inserter(inserted)));
|
||||
}
|
||||
|
||||
BOOST_CHECK_EQUAL(boost::size(result), boost::size(inserted) - 1);
|
||||
@@ -241,8 +232,10 @@ std::string test_difference(std::string const& caseid, G1 const& g1, G2 const& g
|
||||
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_NO_BOOST_TEST)
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
if (expected_point_count >= 0)
|
||||
{
|
||||
std::size_t const n = bg::num_points(result);
|
||||
BOOST_CHECK_MESSAGE(bg::math::abs(int(n) - expected_point_count) < 3,
|
||||
"difference: " << caseid
|
||||
<< " #points expected: " << expected_point_count
|
||||
@@ -250,6 +243,7 @@ std::string test_difference(std::string const& caseid, G1 const& g1, G2 const& g
|
||||
<< " type: " << (type_for_assert_message<G1, G2>())
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (expected_count >= 0)
|
||||
{
|
||||
@@ -283,7 +277,6 @@ std::string test_difference(std::string const& caseid, G1 const& g1, G2 const& g
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
return return_string.str();
|
||||
}
|
||||
|
||||
@@ -342,7 +335,7 @@ std::string test_one(std::string const& caseid,
|
||||
expected_count2, expected_rings_count2, expected_point_count2,
|
||||
expected_area2, false, settings);
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ENABLE_FAILING)
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ALWAYS_CHECK_SYMDIFFERENCE)
|
||||
if (settings.sym_difference)
|
||||
#endif
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@ BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector)
|
||||
#define TEST_INTERSECTION_WITH(caseid, index1, index2, \
|
||||
clips, points, area, settings) \
|
||||
(test_one<Polygon, Polygon, Polygon>) \
|
||||
( #caseid #index1 "_" #index2, caseid[index1], caseid[index2], \
|
||||
( #caseid "_" #index1 "_" #index2, caseid[index1], caseid[index2], \
|
||||
clips, points, area, settings)
|
||||
|
||||
template <typename Polygon>
|
||||
@@ -190,8 +190,8 @@ void test_areal()
|
||||
|
||||
test_one<Polygon, Polygon, Polygon>("geos_1",
|
||||
geos_1[0], geos_1[1],
|
||||
1, -1, 3461.0214843, // MSVC 14 reports 3461.025390625
|
||||
ut_settings(0.005, false));
|
||||
1, -1, 3461.12321694, // MSVC 14 reports 3461.025390625
|
||||
ut_settings(0.01, false));
|
||||
|
||||
// Expectations:
|
||||
// In most cases: 0 (no intersection)
|
||||
@@ -253,13 +253,10 @@ void test_areal()
|
||||
TEST_INTERSECTION(ggl_list_20190307_matthieu_1, 2, -1, 0.035136);
|
||||
TEST_INTERSECTION(ggl_list_20190307_matthieu_2, 1, -1, 3.64285);
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_rt_f", buffer_rt_f[0], buffer_rt_f[1],
|
||||
1, 4, 0.00029437899183903937, ut_settings(0.01));
|
||||
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_rt_g", buffer_rt_g[0], buffer_rt_g[1],
|
||||
1, 0, 2.914213562373);
|
||||
#endif
|
||||
|
||||
test_one<Polygon, Polygon, Polygon>("ticket_8254", ticket_8254[0], ticket_8254[1],
|
||||
1, 4, 3.635930e-08, ut_settings(0.01));
|
||||
@@ -283,13 +280,11 @@ void test_areal()
|
||||
ticket_10108_a[0], ticket_10108_a[1],
|
||||
0, 0, 0.0);
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
// msvc 5.6023011e-5
|
||||
// mingw 5.6022954e-5
|
||||
test_one<Polygon, Polygon, Polygon>("ticket_10108_b",
|
||||
ticket_10108_b[0], ticket_10108_b[1],
|
||||
0, 0, 5.6022983e-5, ut_settings(-1.0));
|
||||
#endif
|
||||
|
||||
test_one<Polygon, Polygon, Polygon>("ticket_10747_a",
|
||||
ticket_10747_a[0], ticket_10747_a[1],
|
||||
@@ -303,18 +298,25 @@ void test_areal()
|
||||
test_one<Polygon, Polygon, Polygon>("ticket_10747_d",
|
||||
ticket_10747_d[0], ticket_10747_d[1],
|
||||
1, 4, 703687777321.0);
|
||||
|
||||
// Delivers very small triangle < 1.0e-13, or zero
|
||||
test_one<Polygon, Polygon, Polygon>("ticket_10747_e",
|
||||
ticket_10747_e[0], ticket_10747_e[1],
|
||||
1, 4, 7.0368748575710959e-15);
|
||||
BG_IF_RESCALED(1, 0), -1, 1.0e-13, ut_settings(-1.0));
|
||||
|
||||
test_one<Polygon, Polygon, Polygon>("ticket_11576",
|
||||
ticket_11576[0], ticket_11576[1],
|
||||
1, 0, 5.585617332907136e-07);
|
||||
|
||||
test_one<Polygon, Polygon, Polygon>("ticket_9563", ticket_9563[0], ticket_9563[1],
|
||||
1, 8, 129.90381);
|
||||
{
|
||||
// Not yet valid when rescaling is turned off
|
||||
ut_settings settings;
|
||||
settings.test_validity = BG_IF_RESCALED(true, false);
|
||||
test_one<Polygon, Polygon, Polygon>("ticket_9563", ticket_9563[0], ticket_9563[1],
|
||||
1, 8, 129.90381, settings);
|
||||
}
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
// With rescaling the output is empty
|
||||
TEST_INTERSECTION(issue_548, 1, -1, 1958824415.2151);
|
||||
#endif
|
||||
@@ -354,6 +356,8 @@ void test_areal()
|
||||
0, -1, 0.0);
|
||||
|
||||
TEST_INTERSECTION(case_105, 1, 34, 76.0);
|
||||
TEST_INTERSECTION(case_106, 2, -1, 3.5);
|
||||
TEST_INTERSECTION(case_107, 3, -1, 3.0);
|
||||
|
||||
TEST_INTERSECTION(case_precision_1, 0, 0, 0.0);
|
||||
TEST_INTERSECTION(case_precision_2, 0, 0, 0.0);
|
||||
@@ -367,6 +371,24 @@ void test_areal()
|
||||
TEST_INTERSECTION(case_precision_10, 1, -1, 14.0);
|
||||
TEST_INTERSECTION(case_precision_11, 1, -1, 14.0);
|
||||
|
||||
{
|
||||
ut_settings settings(0.01);
|
||||
TEST_INTERSECTION_WITH(case_precision_12, 0, 1, 1, -1, 2.0, settings);
|
||||
TEST_INTERSECTION_WITH(case_precision_13, 0, 1, 1, -1, 2.0, settings);
|
||||
TEST_INTERSECTION_WITH(case_precision_12, 1, 0, 1, -1, 2.0, settings);
|
||||
TEST_INTERSECTION_WITH(case_precision_13, 1, 0, 1, -1, 2.0, settings);
|
||||
}
|
||||
|
||||
TEST_INTERSECTION(case_precision_14, 0, -1, 0.0);
|
||||
TEST_INTERSECTION(case_precision_15, 1, -1, 14.0);
|
||||
TEST_INTERSECTION(case_precision_16, 1, -1, 14.0);
|
||||
TEST_INTERSECTION(case_precision_17, 1, -1, 14.0);
|
||||
TEST_INTERSECTION(case_precision_18, 1, -1, 14.0);
|
||||
TEST_INTERSECTION(case_precision_19, 1, -1, 14.0);
|
||||
TEST_INTERSECTION(case_precision_20, 0, 0, 0.0);
|
||||
TEST_INTERSECTION(case_precision_21, 0, 0, 0.0);
|
||||
TEST_INTERSECTION(case_precision_22, 1, -1, 14.0);
|
||||
|
||||
TEST_INTERSECTION_REV(case_precision_1, 0, 0, 0.0);
|
||||
TEST_INTERSECTION_REV(case_precision_2, 0, 0, 0.0);
|
||||
TEST_INTERSECTION_REV(case_precision_3, 0, 0, 0.0);
|
||||
@@ -378,16 +400,16 @@ void test_areal()
|
||||
TEST_INTERSECTION_REV(case_precision_9, 1, -1, 14.0);
|
||||
TEST_INTERSECTION_REV(case_precision_10, 1, -1, 14.0);
|
||||
TEST_INTERSECTION_REV(case_precision_11, 1, -1, 14.0);
|
||||
{
|
||||
ut_settings settings(0.01);
|
||||
TEST_INTERSECTION_WITH(case_precision_12, 0, 1, 1, -1, 2.0, settings);
|
||||
TEST_INTERSECTION_WITH(case_precision_13, 0, 1, 1, -1, 2.0, settings);
|
||||
TEST_INTERSECTION_WITH(case_precision_12, 1, 0, 1, -1, 2.0, settings);
|
||||
TEST_INTERSECTION_WITH(case_precision_13, 1, 0, 1, -1, 2.0, settings);
|
||||
}
|
||||
|
||||
TEST_INTERSECTION(case_106, 2, -1, 3.5);
|
||||
TEST_INTERSECTION(case_107, 3, -1, 3.0);
|
||||
TEST_INTERSECTION_REV(case_precision_14, 0, -1, 0.0);
|
||||
TEST_INTERSECTION_REV(case_precision_15, 1, -1, 14.0);
|
||||
TEST_INTERSECTION_REV(case_precision_16, 1, -1, 14.0);
|
||||
TEST_INTERSECTION_REV(case_precision_17, 1, -1, 14.0);
|
||||
TEST_INTERSECTION_REV(case_precision_18, 1, -1, 14.0);
|
||||
TEST_INTERSECTION_REV(case_precision_19, 1, -1, 14.0);
|
||||
TEST_INTERSECTION_REV(case_precision_20, 0, 0, 0.0);
|
||||
TEST_INTERSECTION_REV(case_precision_21, 0, 0, 0.0);
|
||||
TEST_INTERSECTION_REV(case_precision_22, 1, -1, 14.0);
|
||||
|
||||
test_one<Polygon, Polygon, Polygon>("mysql_21964049",
|
||||
mysql_21964049[0], mysql_21964049[1],
|
||||
@@ -921,7 +943,7 @@ int test_main(int, char* [])
|
||||
|
||||
test_boxes_nd<double>();
|
||||
|
||||
#if defined(BOOST_GEOMETRY_TEST_ENABLE_FAILING)
|
||||
#if defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
// ticket #10868 still fails for 32-bit integers
|
||||
test_ticket_10868<int32_t>("MULTIPOLYGON(((33520458 6878575,33480192 14931538,31446819 18947953,30772384 19615678,30101303 19612322,30114725 16928001,33520458 6878575)))");
|
||||
|
||||
|
||||
@@ -135,14 +135,14 @@ void test_areal()
|
||||
case_107_multi[1], case_107_multi[2],
|
||||
3, 13, 3.0);
|
||||
|
||||
#if defined(BOOST_GEOMETRY_TEST_ENABLE_FAILING)
|
||||
#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
{
|
||||
ut_settings ignore_validity; ignore_validity.test_validity = false;
|
||||
ut_settings ignore_validity;
|
||||
|
||||
// One intersection is missing (by rescaling)
|
||||
// Rescaling misses one intersection
|
||||
test_one<Polygon, MultiPolygon, MultiPolygon>("case_108_multi",
|
||||
case_108_multi[0], case_108_multi[1],
|
||||
5, 33, 7.5,
|
||||
7, -1, 7.5,
|
||||
ignore_validity);
|
||||
}
|
||||
#endif
|
||||
@@ -326,15 +326,23 @@ void test_areal()
|
||||
TEST_INTERSECTION(case_recursive_boxes_82, 5, -1, 8.5);
|
||||
TEST_INTERSECTION(case_recursive_boxes_83, 5, -1, 10.25);
|
||||
TEST_INTERSECTION(case_recursive_boxes_84, 1, -1, 0.5);
|
||||
#if ! defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
TEST_INTERSECTION(case_recursive_boxes_85, 1, -1, 0.25);
|
||||
#endif
|
||||
TEST_INTERSECTION(case_recursive_boxes_86, 0, -1, 0.0);
|
||||
TEST_INTERSECTION(case_recursive_boxes_87, 0, -1, 0.0);
|
||||
TEST_INTERSECTION(case_recursive_boxes_88, 4, -1, 3.5);
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
TEST_INTERSECTION(case_precision_m1, 1, -1, 14.0);
|
||||
TEST_INTERSECTION(case_precision_m2, 2, -1, 15.25);
|
||||
TEST_INTERSECTION_REV(case_precision_m1, 1, -1, 14.0);
|
||||
TEST_INTERSECTION_REV(case_precision_m2, 2, -1, 15.25);
|
||||
#else
|
||||
// Validity: false positives (very small triangles looking like a line)
|
||||
TEST_INTERSECTION_IGNORE(case_precision_m1, 1, -1, 14.0);
|
||||
TEST_INTERSECTION_IGNORE(case_precision_m2, 2, -1, 15.25);
|
||||
#endif
|
||||
|
||||
test_one<Polygon, MultiPolygon, MultiPolygon>("ggl_list_20120915_h2_a",
|
||||
ggl_list_20120915_h2[0], ggl_list_20120915_h2[1],
|
||||
@@ -354,10 +362,11 @@ void test_areal()
|
||||
|
||||
// Very small slice is generated.
|
||||
// qcc-arm reports 1.7791215549400884e-14
|
||||
// With rescaling, generates very small triangle
|
||||
test_one<Polygon, MultiPolygon, MultiPolygon>("ticket_11018",
|
||||
ticket_11018[0], ticket_11018[1],
|
||||
1, 4, BG_IF_RESCALED(1.7791170511070893e-14, 9.896437631745599e-09),
|
||||
ut_settings(0.001)
|
||||
BG_IF_RESCALED(1, 0), 0,
|
||||
1.0e-8, ut_settings(-1)
|
||||
);
|
||||
|
||||
TEST_INTERSECTION(ticket_12503, 2, 13, 17.375);
|
||||
|
||||
@@ -105,7 +105,7 @@ check_result(
|
||||
}
|
||||
}
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ENABLE_FAILING)
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ALWAYS_CHECK_VALIDITY)
|
||||
if (settings.test_validity)
|
||||
#endif
|
||||
{
|
||||
|
||||
@@ -629,7 +629,7 @@ BOOST_AUTO_TEST_CASE( test_sym_difference_linestring_multilinestring )
|
||||
"lmlsdf18d"
|
||||
);
|
||||
|
||||
#ifdef GEOMETRY_TEST_INCLUDE_FAILING_TESTS
|
||||
#ifdef BOOST_GEOMETRY_TEST_FAILURES
|
||||
tester::apply
|
||||
(from_wkt<L>("LINESTRING(1 5,4 2,1 -1.1,1 6,1 189.7654,2 5,-0.7654 3)"),
|
||||
from_wkt<ML>("MULTILINESTRING((2 5,-0.7654 2),\
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2014, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2014, 2019, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
// http://www.boost.org/users/license.html
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
|
||||
#ifndef BOOST_GEOMETRY_TEST_GET_TURNS_LL_INVARIANCE_HPP
|
||||
#define BOOST_GEOMETRY_TEST_GET_TURNS_LL_INVARIANCE_HPP
|
||||
|
||||
@@ -91,10 +92,15 @@ public:
|
||||
static inline void apply(Linear1 const& lineargeometry1,
|
||||
Linear2 const& lineargeometry2)
|
||||
{
|
||||
typedef typename bg::strategy::relate::services::default_strategy
|
||||
<
|
||||
Linear1, Linear2
|
||||
>::type strategy_type;
|
||||
|
||||
typedef typename bg_detail::relate::turns::get_turns
|
||||
<
|
||||
Linear1, Linear2
|
||||
>::turn_info turn_info;
|
||||
>::template turn_info_type<strategy_type>::type turn_info;
|
||||
|
||||
typedef std::vector<turn_info> turns_container;
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ void test_union(std::string const& caseid, G1 const& g1, G2 const& g2,
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ENABLE_FAILING)
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ALWAYS_CHECK_VALIDITY)
|
||||
if (settings.test_validity)
|
||||
#endif
|
||||
{
|
||||
@@ -136,7 +136,6 @@ void test_union(std::string const& caseid, G1 const& g1, G2 const& g2,
|
||||
<< " type: " << (type_for_assert_message<G1, G2>()));
|
||||
}
|
||||
|
||||
|
||||
typename bg::default_area_result<OutputType>::type area = 0;
|
||||
std::size_t n = 0;
|
||||
std::size_t holes = 0;
|
||||
|
||||
@@ -268,6 +268,17 @@ void test_areal()
|
||||
TEST_UNION(case_precision_11, 1, 1, -1, 73.0);
|
||||
TEST_UNION(case_precision_12, 1, 0, -1, 14.0);
|
||||
TEST_UNION(case_precision_13, 1, 0, -1, 14.0);
|
||||
TEST_UNION(case_precision_14, 1, 0, -1, 22.0);
|
||||
TEST_UNION(case_precision_15, 1, 1, -1, 73.0);
|
||||
TEST_UNION(case_precision_16, 1, 1, -1, 73.0);
|
||||
TEST_UNION(case_precision_17, 1, 1, -1, 73.0);
|
||||
TEST_UNION(case_precision_18, 1, 1, -1, 73.0);
|
||||
TEST_UNION(case_precision_19, 1, 1, -1, 73.0);
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
TEST_UNION(case_precision_20, 1, 0, -1, 22.0);
|
||||
#endif
|
||||
TEST_UNION(case_precision_21, 1, 0, -1, 22.0);
|
||||
TEST_UNION(case_precision_22, 1, 1, -1, 73.0);
|
||||
|
||||
TEST_UNION_REV(case_precision_1, 1, 0, -1, 22.0);
|
||||
TEST_UNION_REV(case_precision_2, 1, 0, -1, 22.0);
|
||||
@@ -282,6 +293,17 @@ void test_areal()
|
||||
TEST_UNION_REV(case_precision_11, 1, 1, -1, 73.0);
|
||||
TEST_UNION_REV(case_precision_12, 1, 0, -1, 14.0);
|
||||
TEST_UNION_REV(case_precision_13, 1, 0, -1, 14.0);
|
||||
TEST_UNION_REV(case_precision_14, 1, 0, -1, 22.0);
|
||||
TEST_UNION_REV(case_precision_15, 1, 1, -1, 73.0);
|
||||
TEST_UNION_REV(case_precision_16, 1, 1, -1, 73.0);
|
||||
TEST_UNION_REV(case_precision_17, 1, 1, -1, 73.0);
|
||||
TEST_UNION_REV(case_precision_18, 1, 1, -1, 73.0);
|
||||
TEST_UNION_REV(case_precision_19, 1, 1, -1, 73.0);
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
TEST_UNION_REV(case_precision_20, 1, 0, -1, 22.0);
|
||||
#endif
|
||||
TEST_UNION_REV(case_precision_21, 1, 0, -1, 22.0);
|
||||
TEST_UNION_REV(case_precision_22, 1, 1, -1, 73.0);
|
||||
|
||||
/*
|
||||
test_one<Polygon, Polygon, Polygon>(102,
|
||||
@@ -332,7 +354,7 @@ void test_areal()
|
||||
ggl_list_20110716_enrico[0], ggl_list_20110716_enrico[1],
|
||||
1, 1, 15, 129904.197692871);
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
test_one<Polygon, Polygon, Polygon>("ggl_list_20110820_christophe",
|
||||
ggl_list_20110820_christophe[0], ggl_list_20110820_christophe[1],
|
||||
-1, // Either 1 or 2, depending if the intersection/turn point (eps.region) is missed
|
||||
@@ -388,20 +410,25 @@ void test_areal()
|
||||
ticket_9081_15[0], ticket_9081_15[1],
|
||||
1, 0, -1, 0.0403425433);
|
||||
|
||||
test_one<Polygon, Polygon, Polygon>("ticket_9563", ticket_9563[0], ticket_9563[1],
|
||||
1, 0, 13, 150.0);
|
||||
{
|
||||
ut_settings settings;
|
||||
settings.test_validity = BG_IF_RESCALED(true, false);
|
||||
test_one<Polygon, Polygon, Polygon>("ticket_9563", ticket_9563[0], ticket_9563[1],
|
||||
1, 0, 13, 150.0, settings);
|
||||
}
|
||||
|
||||
// Float result is OK but a bit larger
|
||||
test_one<Polygon, Polygon, Polygon>("ticket_9756", ticket_9756[0], ticket_9756[1],
|
||||
1, 0, 10, if_typed<ct, float>(1291.5469, 1289.08374));
|
||||
|
||||
// Can generate one polygon, or two splitted, both is OK
|
||||
test_one<Polygon, Polygon, Polygon>("ticket_10108_a", ticket_10108_a[0], ticket_10108_a[1],
|
||||
BG_IF_RESCALED(2, 1), 0, 8, 0.0435229);
|
||||
|
||||
// Can generate one combined polygon, or two splitted, both is acceptable
|
||||
test_one<Polygon, Polygon, Polygon>("ticket_10108_b", ticket_10108_b[0], ticket_10108_b[1],
|
||||
BG_IF_RESCALED(1, 2), 0, 10, 2424.3449);
|
||||
#if ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE)
|
||||
TEST_UNION(ticket_10108_a, 2, 0, 8, 0.0435229);
|
||||
TEST_UNION(ticket_10108_b, 1, 0, 10, 2424.3449);
|
||||
#else
|
||||
TEST_UNION(ticket_10108_a, BG_IF_RESCALED(2, 1), 0, 8, 0.0435229);
|
||||
TEST_UNION(ticket_10108_b, BG_IF_RESCALED(1, 2), 0, 10, 2424.3449);
|
||||
#endif
|
||||
|
||||
test_one<Polygon, Polygon, Polygon>("ticket_10866", ticket_10866[0], ticket_10866[1],
|
||||
1, 0, 14, if_typed<ct, float>(332752493.0, 332760303.5));
|
||||
@@ -416,10 +443,13 @@ void test_areal()
|
||||
|
||||
TEST_UNION(issue_566_a, 1, 0, -1, 214.3728);
|
||||
TEST_UNION(issue_566_b, 1, 0, -1, 214.3728);
|
||||
TEST_UNION_REV(issue_566_a, 1, 0, -1, 214.3728);
|
||||
TEST_UNION_REV(issue_566_b, 1, 0, -1, 214.3728);
|
||||
|
||||
{
|
||||
ut_settings ignore_validity;
|
||||
ignore_validity.test_validity = false;
|
||||
ignore_validity.percentage = 0.01;
|
||||
test_one<Polygon, Polygon, Polygon>("geos_1", geos_1[0], geos_1[1],
|
||||
1, 0, -1, 3461.3203125,
|
||||
ignore_validity);
|
||||
@@ -431,11 +461,17 @@ void test_areal()
|
||||
test_one<Polygon, Polygon, Polygon>("geos_4", geos_4[0], geos_4[1],
|
||||
1, 0, -1, 2304.4163115);
|
||||
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_rt_a", buffer_rt_a[0], buffer_rt_a[1],
|
||||
1, 0, 265, 19.280667);
|
||||
|
||||
// Robustness issues, followed out buffer-robustness-tests, test them also reverse
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
{
|
||||
// Area can vary depending on joining point of nearly parallel lines
|
||||
ut_settings settings;
|
||||
settings.percentage = 0.01;
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_rt_a", buffer_rt_a[0], buffer_rt_a[1],
|
||||
1, 0, -1, 19.28, settings);
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_rt_a_rev", buffer_rt_a[1], buffer_rt_a[0],
|
||||
1, 0, -1, 19.28, settings);
|
||||
}
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_rt_f", buffer_rt_f[0], buffer_rt_f[1],
|
||||
1, 0, -1, 4.60853);
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_rt_f_rev", buffer_rt_f[1], buffer_rt_f[0],
|
||||
@@ -445,7 +481,7 @@ void test_areal()
|
||||
1, 0, -1, 16.571);
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_rt_g_rev", buffer_rt_g[1], buffer_rt_g[0],
|
||||
1, 0, -1, 16.571);
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_rt_i", buffer_rt_i[0], buffer_rt_i[1],
|
||||
1, 0, -1, 13.6569);
|
||||
#endif
|
||||
@@ -476,7 +512,7 @@ void test_areal()
|
||||
1, 0, -1, 18.5710);
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_rt_q_rev", buffer_rt_q[1], buffer_rt_q[0],
|
||||
1, 0, -1, 18.5710);
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_rt_r", buffer_rt_r[0], buffer_rt_r[1],
|
||||
1, 0, -1, 21.07612);
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_rt_r_rev", buffer_rt_r[1], buffer_rt_r[0],
|
||||
@@ -578,10 +614,8 @@ int test_main(int, char* [])
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
test_all<bg::model::d2::point_xy<float> >();
|
||||
test_all<bg::model::d2::point_xy<long double> >();
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_TTMATH)
|
||||
std::cout << "Testing TTMATH" << std::endl;
|
||||
|
||||
@@ -403,12 +403,11 @@ void test_areal()
|
||||
test_one<Polygon, MultiPolygon, MultiPolygon>("ticket_11984",
|
||||
ticket_11984[0], ticket_11984[1],
|
||||
1, 2, 134, 60071.08077);
|
||||
|
||||
test_one<Polygon, MultiPolygon, MultiPolygon>("ticket_12118",
|
||||
ticket_12118[0], ticket_12118[1],
|
||||
1, 1, 27, 2221.38713);
|
||||
1, -1, 27, 2221.38713);
|
||||
|
||||
#if defined(BOOST_GEOMETRY_TEST_ENABLE_FAILING) || ! defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
#if defined(BOOST_GEOMETRY_TEST_FAILURES) || ! defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
// No output if rescaling is done
|
||||
test_one<Polygon, MultiPolygon, MultiPolygon>("ticket_12125",
|
||||
ticket_12125[0], ticket_12125[1],
|
||||
@@ -417,8 +416,13 @@ void test_areal()
|
||||
|
||||
TEST_UNION(ticket_12503, 42, 1, -1, 945.625);
|
||||
|
||||
// Generates two polygons, which should (without rescaling) be merged into one
|
||||
#if defined(BOOST_GEOMETRY_USE_KRAMER_RULE)
|
||||
// Two polygons, should ideally be merged
|
||||
TEST_UNION(mail_2019_01_21_johan, 2, 0, -1, 0.00058896);
|
||||
#else
|
||||
// Correct: one polygon
|
||||
TEST_UNION(mail_2019_01_21_johan, 1, 0, -1, 0.00058896);
|
||||
#endif
|
||||
|
||||
TEST_UNION(mysql_23023665_7, 1, 1, -1, 99.19494);
|
||||
TEST_UNION(mysql_23023665_8, 1, 2, -1, 1400.0);
|
||||
|
||||
Reference in New Issue
Block a user