mirror of
https://github.com/boostorg/geometry.git
synced 2026-02-02 08:52:10 +00:00
[test][algorithms][equals] deactivate test cases where latitude needs to be normalized as well;
add test cases with points on the spheroid that also have a third coordinate (possibly height);
This commit is contained in:
@@ -40,17 +40,25 @@ struct test_point_point
|
||||
test_geometry<P1, P2>(str + "pp_05", "POINT(10 0)", "POINT(-350 0)", true);
|
||||
test_geometry<P1, P2>(str + "pp_06", "POINT(180 10)", "POINT(-180 10)", true);
|
||||
test_geometry<P1, P2>(str + "pp_06a", "POINT(540 10)", "POINT(-540 10)", true);
|
||||
|
||||
#ifdef BOOST_GEOMETRY_NORMALIZE_LATITUDE
|
||||
test_geometry<P1, P2>(str + "pp_06b", "POINT(540 370)", "POINT(-540 -350)", true);
|
||||
test_geometry<P1, P2>(str + "pp_06c", "POINT(1260 370)", "POINT(-1260 -350)", true);
|
||||
test_geometry<P1, P2>(str + "pp_06d", "POINT(2340 370)", "POINT(-2340 -350)", true);
|
||||
#endif
|
||||
|
||||
test_geometry<P1, P2>(str + "pp_06e", "POINT(-180 10)", "POINT(-540 10)", true);
|
||||
test_geometry<P1, P2>(str + "pp_06f", "POINT(180 10)", "POINT(-540 10)", true);
|
||||
|
||||
// north & south pole
|
||||
test_geometry<P1, P2>(str + "pp_07", "POINT(0 90)", "POINT(0 90)", true);
|
||||
|
||||
#ifdef BOOST_GEOMETRY_NORMALIZE_LATITUDE
|
||||
test_geometry<P1, P2>(str + "pp_07a", "POINT(0 450)", "POINT(10 -270)", true);
|
||||
test_geometry<P1, P2>(str + "pp_07b", "POINT(0 270)", "POINT(10 90)", false);
|
||||
test_geometry<P1, P2>(str + "pp_07c", "POINT(0 -450)", "POINT(10 90)", false);
|
||||
#endif
|
||||
|
||||
test_geometry<P1, P2>(str + "pp_08", "POINT(0 90)", "POINT(10 90)", true);
|
||||
test_geometry<P1, P2>(str + "pp_09", "POINT(0 90)", "POINT(0 -90)", false);
|
||||
test_geometry<P1, P2>(str + "pp_10", "POINT(0 -90)", "POINT(0 -90)", true);
|
||||
@@ -68,12 +76,52 @@ struct test_point_point
|
||||
test_geometry<P1, P2>(str + "pp_17", "POINT(-10 45)", "POINT(10 -45)", false);
|
||||
test_geometry<P1, P2>(str + "pp_18", "POINT(-10 -45)", "POINT(10 45)", false);
|
||||
test_geometry<P1, P2>(str + "pp_19", "POINT(10 -135)", "POINT(10 45)", false);
|
||||
|
||||
#ifdef BOOST_GEOMETRY_NORMALIZE_LATITUDE
|
||||
test_geometry<P1, P2>(str + "pp_20", "POINT(190 135)", "POINT(10 45)", true);
|
||||
test_geometry<P1, P2>(str + "pp_21", "POINT(190 150)", "POINT(10 30)", true);
|
||||
test_geometry<P1, P2>(str + "pp_21a", "POINT(-170 150)", "POINT(10 30)", true);
|
||||
test_geometry<P1, P2>(str + "pp_22", "POINT(190 -135)", "POINT(10 -45)", true);
|
||||
test_geometry<P1, P2>(str + "pp_23", "POINT(190 -150)", "POINT(10 -30)", true);
|
||||
test_geometry<P1, P2>(str + "pp_23a", "POINT(-170 -150)", "POINT(10 -30)", true);
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <typename P1, typename P2 = P1>
|
||||
struct test_point_point_with_height
|
||||
{
|
||||
static inline void apply(std::string const& header)
|
||||
{
|
||||
std::string const str = header + "-";
|
||||
|
||||
test_geometry<P1, P2>(str + "pp_01",
|
||||
"POINT(0 0 10)",
|
||||
"POINT(0 0 20)",
|
||||
true);
|
||||
|
||||
test_geometry<P1, P2>(str + "pp_02",
|
||||
"POINT(0 0 10)",
|
||||
"POINT(10 0 10)",
|
||||
false);
|
||||
|
||||
// points whose longitudes differ by 360 degrees
|
||||
test_geometry<P1, P2>(str + "pp_03",
|
||||
"POINT(0 0 10)",
|
||||
"POINT(360 0 10)",
|
||||
true);
|
||||
|
||||
// points whose longitudes differ by 360 degrees
|
||||
test_geometry<P1, P2>(str + "pp_04",
|
||||
"POINT(10 0 10)",
|
||||
"POINT(370 0 10)",
|
||||
true);
|
||||
|
||||
test_geometry<P1, P2>(str + "pp_05",
|
||||
"POINT(10 0 10)",
|
||||
"POINT(10 0 370)",
|
||||
false);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -132,6 +180,30 @@ BOOST_AUTO_TEST_CASE( equals_point_point_se )
|
||||
#endif
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( equals_point_point_with_height_se )
|
||||
{
|
||||
typedef bg::cs::spherical_equatorial<bg::degree> cs_type;
|
||||
|
||||
test_point_point<bgm::point<int, 3, cs_type> >::apply("seh");
|
||||
test_point_point<bgm::point<double, 3, cs_type> >::apply("seh");
|
||||
test_point_point<bgm::point<long double, 3, cs_type> >::apply("seh");
|
||||
|
||||
// mixed point types
|
||||
test_point_point
|
||||
<
|
||||
bgm::point<double, 3, cs_type>, bgm::point<int, 3, cs_type>
|
||||
>::apply("seh");
|
||||
|
||||
test_point_point
|
||||
<
|
||||
bgm::point<double, 3, cs_type>, bgm::point<long double, 3, cs_type>
|
||||
>::apply("seh");
|
||||
|
||||
#if defined(HAVE_TTMATH)
|
||||
test_point_point<bgm::point<ttmath_big, 3, cs_type> >::apply("seh");
|
||||
#endif
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( equals_point_point_geo )
|
||||
{
|
||||
typedef bg::cs::geographic<bg::degree> cs_type;
|
||||
|
||||
Reference in New Issue
Block a user