mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-09 15:14:02 +00:00
Merge pull request #1370 from vissarion/fix/half_period_check
Relax half period check in spheroidal normalization
This commit is contained in:
commit
763683eaba
@ -1,7 +1,8 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2015-2020, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2015-2025, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
@ -123,7 +124,7 @@ struct assign_loop<1, DimensionCount>
|
||||
template <typename PointIn, typename PointOut, bool IsEquatorial = true>
|
||||
struct normalize_point
|
||||
{
|
||||
static inline void apply(PointIn const& point_in, PointOut& point_out)
|
||||
static inline void apply(PointIn const& point_in, PointOut& point_out, bool exact = true)
|
||||
{
|
||||
using in_coordinate_type = coordinate_type_t<PointIn>;
|
||||
|
||||
@ -135,7 +136,7 @@ struct normalize_point
|
||||
typename geometry::detail::cs_angular_units<PointIn>::type,
|
||||
IsEquatorial,
|
||||
in_coordinate_type
|
||||
>(longitude, latitude);
|
||||
>(longitude, latitude, exact);
|
||||
|
||||
assign_loop
|
||||
<
|
||||
@ -221,13 +222,13 @@ struct cartesian_box
|
||||
struct spherical_point
|
||||
{
|
||||
template <typename PointIn, typename PointOut>
|
||||
static inline void apply(PointIn const& point_in, PointOut& point_out)
|
||||
static inline void apply(PointIn const& point_in, PointOut& point_out, bool exact = true)
|
||||
{
|
||||
detail::normalize_point
|
||||
<
|
||||
PointIn, PointOut,
|
||||
(! std::is_same<cs_tag_t<PointIn>, spherical_polar_tag>::value)
|
||||
>::apply(point_in, point_out);
|
||||
>::apply(point_in, point_out, exact);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -5,11 +5,12 @@
|
||||
// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland
|
||||
|
||||
// This file was modified by Oracle on 2013-2020.
|
||||
// Modifications copyright (c) 2013-2020, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2013-2025.
|
||||
// Modifications copyright (c) 2013-2025, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
@ -67,13 +68,14 @@ private:
|
||||
{
|
||||
static inline bool apply(Point1 const& point1, Point2 const& point2)
|
||||
{
|
||||
typedef typename helper_geometry<Point1>::type helper_point_type1;
|
||||
typedef typename helper_geometry<Point2>::type helper_point_type2;
|
||||
using helper_point_type1 = typename helper_geometry<Point1>::type;
|
||||
using helper_point_type2 = typename helper_geometry<Point2>::type;
|
||||
|
||||
helper_point_type1 point1_normalized;
|
||||
strategy::normalize::spherical_point::apply(point1, point1_normalized);
|
||||
bool const exact_normalized = false;
|
||||
strategy::normalize::spherical_point::apply(point1, point1_normalized, exact_normalized);
|
||||
helper_point_type2 point2_normalized;
|
||||
strategy::normalize::spherical_point::apply(point2, point2_normalized);
|
||||
strategy::normalize::spherical_point::apply(point2, point2_normalized, exact_normalized);
|
||||
|
||||
return point_point_generic
|
||||
<
|
||||
@ -87,11 +89,11 @@ private:
|
||||
{
|
||||
static inline bool apply(Point1 const& point1, Point2 const& point2)
|
||||
{
|
||||
typedef typename geometry::select_most_precise
|
||||
using calculation_type = typename geometry::select_most_precise
|
||||
<
|
||||
typename fp_coordinate_type<Point1>::type,
|
||||
typename fp_coordinate_type<Point2>::type
|
||||
>::type calculation_type;
|
||||
>::type;
|
||||
|
||||
typename helper_geometry
|
||||
<
|
||||
@ -149,7 +151,7 @@ namespace services
|
||||
template <typename PointLike1, typename PointLike2, typename Tag1, typename Tag2>
|
||||
struct default_strategy<PointLike1, PointLike2, Tag1, Tag2, pointlike_tag, pointlike_tag, spherical_tag, spherical_tag>
|
||||
{
|
||||
typedef strategy::within::spherical_point_point type;
|
||||
using type = strategy::within::spherical_point_point;
|
||||
};
|
||||
|
||||
} // namespace services
|
||||
@ -166,7 +168,7 @@ namespace strategy { namespace covered_by { namespace services
|
||||
template <typename PointLike1, typename PointLike2, typename Tag1, typename Tag2>
|
||||
struct default_strategy<PointLike1, PointLike2, Tag1, Tag2, pointlike_tag, pointlike_tag, spherical_tag, spherical_tag>
|
||||
{
|
||||
typedef strategy::within::spherical_point_point type;
|
||||
using type = strategy::within::spherical_point_point;
|
||||
};
|
||||
|
||||
}}} // namespace strategy::covered_by::services
|
||||
|
@ -2,8 +2,9 @@
|
||||
|
||||
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// Copyright (c) 2015-2022, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2015-2025, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
// Contributed and/or modified by Adeel Ahmad, as part of Google Summer of Code 2018 program
|
||||
@ -151,11 +152,7 @@ struct constants_on_spheroid<CoordinateType, degree, false>
|
||||
template <typename Units, typename CoordinateType>
|
||||
inline CoordinateType latitude_convert_ep(CoordinateType const& lat)
|
||||
{
|
||||
typedef math::detail::constants_on_spheroid
|
||||
<
|
||||
CoordinateType,
|
||||
Units
|
||||
> constants;
|
||||
using constants = math::detail::constants_on_spheroid<CoordinateType, Units>;
|
||||
|
||||
return constants::quarter_period() - lat;
|
||||
}
|
||||
@ -164,31 +161,21 @@ inline CoordinateType latitude_convert_ep(CoordinateType const& lat)
|
||||
template <typename Units, bool IsEquatorial, typename T>
|
||||
static bool is_latitude_pole(T const& lat)
|
||||
{
|
||||
typedef math::detail::constants_on_spheroid
|
||||
<
|
||||
T,
|
||||
Units
|
||||
> constants;
|
||||
using constants = math::detail::constants_on_spheroid<T, Units>;
|
||||
|
||||
return math::equals(math::abs(IsEquatorial
|
||||
? lat
|
||||
: math::latitude_convert_ep<Units>(lat)),
|
||||
constants::quarter_period());
|
||||
|
||||
}
|
||||
|
||||
|
||||
template <typename Units, typename T>
|
||||
static bool is_longitude_antimeridian(T const& lon)
|
||||
{
|
||||
typedef math::detail::constants_on_spheroid
|
||||
<
|
||||
T,
|
||||
Units
|
||||
> constants;
|
||||
using constants = math::detail::constants_on_spheroid<T, Units>;
|
||||
|
||||
return math::equals(math::abs(lon), constants::half_period());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -218,7 +205,7 @@ struct latitude_convert_if_polar<Units, false>
|
||||
template <typename Units, typename CoordinateType, bool IsEquatorial = true>
|
||||
class normalize_spheroidal_coordinates
|
||||
{
|
||||
typedef constants_on_spheroid<CoordinateType, Units> constants;
|
||||
using constants = constants_on_spheroid<CoordinateType, Units>;
|
||||
|
||||
protected:
|
||||
static inline CoordinateType normalize_up(CoordinateType const& value)
|
||||
@ -236,17 +223,22 @@ protected:
|
||||
}
|
||||
|
||||
public:
|
||||
static inline void apply(CoordinateType& longitude)
|
||||
static inline void apply(CoordinateType& longitude, bool exact = true)
|
||||
{
|
||||
// normalize longitude
|
||||
if (math::equals(math::abs(longitude), constants::half_period()))
|
||||
CoordinateType const epsilon = std::numeric_limits<float>::epsilon();
|
||||
static constexpr bool is_integer = std::numeric_limits<CoordinateType>::is_integer;
|
||||
|
||||
if (exact || is_integer ? math::equals(math::abs(longitude), constants::half_period())
|
||||
: math::abs(math::abs(longitude) - constants::half_period()) <= epsilon)
|
||||
{
|
||||
longitude = constants::half_period();
|
||||
}
|
||||
else if (longitude > constants::half_period())
|
||||
{
|
||||
longitude = normalize_up(longitude);
|
||||
if (math::equals(longitude, -constants::half_period()))
|
||||
if (exact || is_integer ? math::equals(longitude, -constants::half_period())
|
||||
: math::abs(longitude + constants::half_period()) <= epsilon)
|
||||
{
|
||||
longitude = constants::half_period();
|
||||
}
|
||||
@ -259,7 +251,8 @@ public:
|
||||
|
||||
static inline void apply(CoordinateType& longitude,
|
||||
CoordinateType& latitude,
|
||||
bool normalize_poles = true)
|
||||
bool normalize_poles = true,
|
||||
bool exact = true)
|
||||
{
|
||||
latitude_convert_if_polar<Units, IsEquatorial>::apply(latitude);
|
||||
|
||||
@ -288,7 +281,7 @@ public:
|
||||
#endif // BOOST_GEOMETRY_NORMALIZE_LATITUDE
|
||||
|
||||
// normalize longitude
|
||||
apply(longitude);
|
||||
apply(longitude, exact);
|
||||
|
||||
// finally normalize poles
|
||||
if (normalize_poles)
|
||||
@ -317,7 +310,7 @@ public:
|
||||
template <typename Units, typename CoordinateType>
|
||||
inline void normalize_angle_loop(CoordinateType& angle)
|
||||
{
|
||||
typedef constants_on_spheroid<CoordinateType, Units> constants;
|
||||
using constants = constants_on_spheroid<CoordinateType, Units>;
|
||||
CoordinateType const pi = constants::half_period();
|
||||
CoordinateType const two_pi = constants::period();
|
||||
while (angle > pi)
|
||||
@ -329,7 +322,7 @@ inline void normalize_angle_loop(CoordinateType& angle)
|
||||
template <typename Units, typename CoordinateType>
|
||||
inline void normalize_angle_cond(CoordinateType& angle)
|
||||
{
|
||||
typedef constants_on_spheroid<CoordinateType, Units> constants;
|
||||
using constants = constants_on_spheroid<CoordinateType, Units>;
|
||||
CoordinateType const pi = constants::half_period();
|
||||
CoordinateType const two_pi = constants::period();
|
||||
if (angle > pi)
|
||||
@ -353,22 +346,24 @@ inline void normalize_angle_cond(CoordinateType& angle)
|
||||
*/
|
||||
template <typename Units, typename CoordinateType>
|
||||
inline void normalize_spheroidal_coordinates(CoordinateType& longitude,
|
||||
CoordinateType& latitude)
|
||||
CoordinateType& latitude,
|
||||
bool exact = true)
|
||||
{
|
||||
detail::normalize_spheroidal_coordinates
|
||||
<
|
||||
Units, CoordinateType
|
||||
>::apply(longitude, latitude);
|
||||
>::apply(longitude, latitude, true, exact);
|
||||
}
|
||||
|
||||
template <typename Units, bool IsEquatorial, typename CoordinateType>
|
||||
inline void normalize_spheroidal_coordinates(CoordinateType& longitude,
|
||||
CoordinateType& latitude)
|
||||
CoordinateType& latitude,
|
||||
bool exact = true)
|
||||
{
|
||||
detail::normalize_spheroidal_coordinates
|
||||
<
|
||||
Units, CoordinateType, IsEquatorial
|
||||
>::apply(longitude, latitude);
|
||||
>::apply(longitude, latitude, true, exact);
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -381,12 +376,12 @@ inline void normalize_spheroidal_coordinates(CoordinateType& longitude,
|
||||
\ingroup utility
|
||||
*/
|
||||
template <typename Units, typename CoordinateType>
|
||||
inline void normalize_longitude(CoordinateType& longitude)
|
||||
inline void normalize_longitude(CoordinateType& longitude, bool exact = true)
|
||||
{
|
||||
detail::normalize_spheroidal_coordinates
|
||||
<
|
||||
Units, CoordinateType
|
||||
>::apply(longitude);
|
||||
>::apply(longitude, exact);
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -400,7 +395,7 @@ inline void normalize_longitude(CoordinateType& longitude)
|
||||
template <typename Units, typename CoordinateType>
|
||||
inline void normalize_azimuth(CoordinateType& angle)
|
||||
{
|
||||
normalize_longitude<Units, CoordinateType>(angle);
|
||||
math::normalize_longitude<Units, CoordinateType>(angle, true);
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -435,7 +430,7 @@ inline CoordinateType longitude_distance_signed(CoordinateType const& longitude1
|
||||
CoordinateType const& longitude2)
|
||||
{
|
||||
CoordinateType diff = longitude2 - longitude1;
|
||||
math::normalize_longitude<Units, CoordinateType>(diff);
|
||||
math::normalize_longitude<Units, CoordinateType>(diff, true);
|
||||
return diff;
|
||||
}
|
||||
|
||||
@ -453,10 +448,7 @@ template <typename Units, typename CoordinateType>
|
||||
inline CoordinateType longitude_distance_unsigned(CoordinateType const& longitude1,
|
||||
CoordinateType const& longitude2)
|
||||
{
|
||||
typedef math::detail::constants_on_spheroid
|
||||
<
|
||||
CoordinateType, Units
|
||||
> constants;
|
||||
using constants = math::detail::constants_on_spheroid<CoordinateType, Units>;
|
||||
|
||||
CoordinateType const c0 = 0;
|
||||
CoordinateType diff = longitude_distance_signed<Units>(longitude1, longitude2);
|
||||
|
@ -101,16 +101,16 @@ struct coordinate_cast<rational<T> >
|
||||
template <typename T1, typename T2>
|
||||
struct select_most_precise<boost::rational<T1>, boost::rational<T2> >
|
||||
{
|
||||
typedef typename boost::rational
|
||||
using type = typename boost::rational
|
||||
<
|
||||
typename select_most_precise<T1, T2>::type
|
||||
> type;
|
||||
> ;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct select_most_precise<boost::rational<T>, double>
|
||||
{
|
||||
typedef typename boost::rational<T> type;
|
||||
using type = typename boost::rational<T>;
|
||||
};
|
||||
|
||||
namespace util
|
||||
|
@ -1,7 +1,8 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit test
|
||||
|
||||
// Copyright (c) 2015, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2015-2025, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
// http://www.boost.org/users/license.html
|
||||
@ -129,7 +130,7 @@ struct test_point_point_with_height
|
||||
template <typename P>
|
||||
void test_segment_segment(std::string const& header)
|
||||
{
|
||||
typedef bgm::segment<P> seg;
|
||||
using seg = bgm::segment<P>;
|
||||
|
||||
std::string const str = header + "-";
|
||||
|
||||
@ -158,7 +159,7 @@ void test_segment_segment(std::string const& header)
|
||||
|
||||
BOOST_AUTO_TEST_CASE( equals_point_point_se )
|
||||
{
|
||||
typedef bg::cs::spherical_equatorial<bg::degree> cs_type;
|
||||
using cs_type = bg::cs::spherical_equatorial<bg::degree>;
|
||||
|
||||
test_point_point<bgm::point<int, 2, cs_type> >::apply("se");
|
||||
test_point_point<bgm::point<double, 2, cs_type> >::apply("se");
|
||||
@ -176,9 +177,36 @@ BOOST_AUTO_TEST_CASE( equals_point_point_se )
|
||||
>::apply("se");
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
std::string to_string_with_precision(const T value, const int precision = 15)
|
||||
{
|
||||
std::ostringstream out;
|
||||
out << std::fixed << std::setprecision(precision) << value;
|
||||
return out.str();
|
||||
}
|
||||
|
||||
void test_pp_rad(double half_pi)
|
||||
{
|
||||
using cs_radian = bg::cs::spherical_equatorial<bg::radian>;
|
||||
using P = bgm::point<double, 2, cs_radian>;
|
||||
|
||||
test_geometry<P, P>("ser_pp_half_pi",
|
||||
"POINT(" + to_string_with_precision(-half_pi) + " 0)",
|
||||
"POINT(" + to_string_with_precision(half_pi) + " 0)", true);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( equals_point_point_radian )
|
||||
{
|
||||
test_pp_rad(bg::math::d2r<float>() * 180);
|
||||
// half pi value with less accuracy
|
||||
test_pp_rad(-3.14159265358979);
|
||||
// convert from degrees to radians with constant from epsg 4326 (WGS84)
|
||||
test_pp_rad(0.017453292519943278 * 180);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( equals_point_point_with_height_se )
|
||||
{
|
||||
typedef bg::cs::spherical_equatorial<bg::degree> cs_type;
|
||||
using cs_type = bg::cs::spherical_equatorial<bg::degree>;
|
||||
|
||||
test_point_point<bgm::point<int, 3, cs_type> >::apply("seh");
|
||||
test_point_point<bgm::point<double, 3, cs_type> >::apply("seh");
|
||||
@ -198,7 +226,7 @@ BOOST_AUTO_TEST_CASE( equals_point_point_with_height_se )
|
||||
|
||||
BOOST_AUTO_TEST_CASE( equals_point_point_geo )
|
||||
{
|
||||
typedef bg::cs::geographic<bg::degree> cs_type;
|
||||
using cs_type = bg::cs::geographic<bg::degree>;
|
||||
|
||||
test_point_point<bgm::point<int, 2, cs_type> >::apply("geo");
|
||||
test_point_point<bgm::point<double, 2, cs_type> >::apply("geo");
|
||||
@ -218,7 +246,7 @@ BOOST_AUTO_TEST_CASE( equals_point_point_geo )
|
||||
|
||||
BOOST_AUTO_TEST_CASE( equals_segment_segment_se )
|
||||
{
|
||||
typedef bg::cs::spherical_equatorial<bg::degree> cs_type;
|
||||
using cs_type = bg::cs::spherical_equatorial<bg::degree>;
|
||||
|
||||
test_segment_segment<bgm::point<int, 2, cs_type> >("se");
|
||||
test_segment_segment<bgm::point<double, 2, cs_type> >("se");
|
||||
@ -227,7 +255,7 @@ BOOST_AUTO_TEST_CASE( equals_segment_segment_se )
|
||||
|
||||
BOOST_AUTO_TEST_CASE( equals_segment_segment_geo )
|
||||
{
|
||||
typedef bg::cs::geographic<bg::degree> cs_type;
|
||||
using cs_type = bg::cs::geographic<bg::degree>;
|
||||
|
||||
test_segment_segment<bgm::point<int, 2, cs_type> >("geo");
|
||||
test_segment_segment<bgm::point<double, 2, cs_type> >("geo");
|
||||
|
@ -24,7 +24,7 @@ void test_radian()
|
||||
boost::geometry::strategies::relate::geographic<> wgs84(sph_wgs84);
|
||||
|
||||
test_geometry<ls, mls>(
|
||||
"LINESTRING(0 0, -3.14159265358979 0)",
|
||||
"LINESTRING(0 0,-3.14159265358979 0)",
|
||||
"MULTILINESTRING((-2.1467549799530232 -0.12217304763960295,"
|
||||
"-2.5481807079117185 -0.90757121103705041,"
|
||||
"-2.6529004630313784 0.85521133347722067,"
|
||||
|
@ -1,10 +1,11 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2014-2015, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2014-2025, Oracle and/or its affiliates.
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
// http://www.boost.org/users/license.html
|
||||
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
|
||||
#include <iostream>
|
||||
@ -26,11 +27,12 @@
|
||||
#include <boost/geometry/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/algorithms/difference.hpp>
|
||||
|
||||
typedef bg::model::point<double,2,bg::cs::cartesian> point_type;
|
||||
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;
|
||||
|
||||
using point_type = bg::model::point<double,2,bg::cs::cartesian>;
|
||||
using segment_type = bg::model::segment<point_type>;
|
||||
using linestring_type = bg::model::linestring<point_type>;
|
||||
using multi_linestring_type = bg::model::multi_linestring<linestring_type>;
|
||||
using L = linestring_type;
|
||||
using ML = multi_linestring_type;
|
||||
|
||||
|
||||
//===========================================================================
|
||||
@ -46,10 +48,7 @@ BOOST_AUTO_TEST_CASE( test_difference_linestring_linestring )
|
||||
std::cout << std::endl;
|
||||
#endif
|
||||
|
||||
typedef linestring_type L;
|
||||
typedef multi_linestring_type ML;
|
||||
|
||||
typedef test_difference_of_geometries<L, L, ML> tester;
|
||||
using tester = test_difference_of_geometries<L, L, ML>;
|
||||
|
||||
tester::apply
|
||||
(from_wkt<L>("LINESTRING(0 0,1 1,2 1,3 2)"),
|
||||
@ -565,10 +564,7 @@ BOOST_AUTO_TEST_CASE( test_difference_linestring_multilinestring )
|
||||
std::cout << std::endl;
|
||||
#endif
|
||||
|
||||
typedef linestring_type L;
|
||||
typedef multi_linestring_type ML;
|
||||
|
||||
typedef test_difference_of_geometries<L, ML, ML> tester;
|
||||
using tester = test_difference_of_geometries<L, ML, ML>;
|
||||
|
||||
// disjoint linestrings
|
||||
tester::apply
|
||||
@ -789,10 +785,7 @@ BOOST_AUTO_TEST_CASE( test_difference_multilinestring_linestring )
|
||||
std::cout << std::endl;
|
||||
#endif
|
||||
|
||||
typedef linestring_type L;
|
||||
typedef multi_linestring_type ML;
|
||||
|
||||
typedef test_difference_of_geometries<ML, L, ML> tester;
|
||||
using tester = test_difference_of_geometries<ML, L, ML>;
|
||||
|
||||
// disjoint linestrings
|
||||
tester::apply
|
||||
@ -874,9 +867,7 @@ BOOST_AUTO_TEST_CASE( test_difference_multilinestring_multilinestring )
|
||||
std::cout << std::endl;
|
||||
#endif
|
||||
|
||||
typedef multi_linestring_type ML;
|
||||
|
||||
typedef test_difference_of_geometries<ML, ML, ML> tester;
|
||||
using tester = test_difference_of_geometries<ML, ML, ML>;
|
||||
|
||||
// disjoint linestrings
|
||||
tester::apply
|
||||
@ -1160,15 +1151,13 @@ BOOST_AUTO_TEST_CASE( test_difference_ml_ml_degenerate )
|
||||
{
|
||||
#ifdef BOOST_GEOMETRY_TEST_DEBUG
|
||||
std::cout << std::endl << std::endl << std::endl;
|
||||
std::cout << "*** MULTILINESTRING / MULTILINESTRING DIFFERENCE"
|
||||
std::cout << "*** MULTILINESTRING / MULTILINESTRING DIFFERENCE"
|
||||
<< " (DEGENERATE) ***"
|
||||
<< std::endl;
|
||||
std::cout << std::endl;
|
||||
#endif
|
||||
|
||||
typedef multi_linestring_type ML;
|
||||
|
||||
typedef test_difference_of_geometries<ML, ML, ML> tester;
|
||||
using tester = test_difference_of_geometries<ML, ML, ML>;
|
||||
|
||||
// the following test cases concern linestrings with duplicate
|
||||
// points and possibly linestrings with zero length.
|
||||
@ -1247,15 +1236,13 @@ BOOST_AUTO_TEST_CASE( test_difference_ml_ml_spikes )
|
||||
{
|
||||
#ifdef BOOST_GEOMETRY_TEST_DEBUG
|
||||
std::cout << std::endl << std::endl << std::endl;
|
||||
std::cout << "*** MULTILINESTRING / MULTILINESTRING DIFFERENCE"
|
||||
std::cout << "*** MULTILINESTRING / MULTILINESTRING DIFFERENCE"
|
||||
<< " (WITH SPIKES) ***"
|
||||
<< std::endl;
|
||||
std::cout << std::endl;
|
||||
#endif
|
||||
|
||||
typedef multi_linestring_type ML;
|
||||
|
||||
typedef test_difference_of_geometries<ML, ML, ML> tester;
|
||||
using tester = test_difference_of_geometries<ML, ML, ML>;
|
||||
|
||||
// the following test cases concern linestrings with spikes
|
||||
|
||||
@ -1445,14 +1432,14 @@ BOOST_AUTO_TEST_CASE( test_difference_ml_ml_spikes )
|
||||
|
||||
BOOST_AUTO_TEST_CASE( test_difference_ls_mls_geo_rad )
|
||||
{
|
||||
typedef bg::model::point<double, 2, bg::cs::geographic<bg::radian> > pt;
|
||||
typedef bg::model::linestring<pt> ls;
|
||||
typedef bg::model::multi_linestring<ls> mls;
|
||||
using pt = bg::model::point<double, 2, bg::cs::geographic<bg::radian>>;
|
||||
using ls = bg::model::linestring<pt>;
|
||||
using mls = bg::model::multi_linestring<ls>;
|
||||
|
||||
bg::srs::spheroid<double> sph_wgs84(6378137.0, 6356752.3142451793);
|
||||
boost::geometry::strategy::intersection::geographic_segments<> wgs84(sph_wgs84);
|
||||
|
||||
ls g1 = from_wkt<ls>("LINESTRING(0 0, -3.14159265358979 0)");
|
||||
ls g1 = from_wkt<ls>("LINESTRING(0 0,-3.14159265358979 0)");
|
||||
mls g2 = from_wkt<mls>("MULTILINESTRING((-2.1467549799530232 -0.12217304763960295,"
|
||||
"-2.5481807079117185 -0.90757121103705041,"
|
||||
"-2.6529004630313784 0.85521133347722067,"
|
||||
|
@ -5,6 +5,10 @@
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2025.
|
||||
// Modifications copyright (c) 2025 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
@ -46,7 +50,6 @@ template <typename T>
|
||||
void test_bounds()
|
||||
{
|
||||
using coordinate_t = boost::rational<T>;
|
||||
using point_t = bg::model::point<coordinate_t, 2, bg::cs::cartesian>;
|
||||
|
||||
auto const lowest = bg::util::bounds<coordinate_t>::lowest();
|
||||
auto const highest = bg::util::bounds<coordinate_t>::highest();
|
||||
|
Loading…
x
Reference in New Issue
Block a user