From fb99e6f3e87f7e1332ae8274dcc5065612d193e8 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Tue, 4 Mar 2025 23:05:14 +0100 Subject: [PATCH 1/7] test: divide rtree_with_strategies test into multiple files --- index/test/rtree/CMakeLists.txt | 3 ++- index/test/rtree/Jamfile | 2 +- index/test/rtree/strategies/CMakeLists.txt | 21 ++++++++++++++++++ index/test/rtree/strategies/Jamfile | 20 +++++++++++++++++ .../rtree_with_strategies.hpp} | 22 +++++-------------- .../strategies/rtree_with_strategies_b_l.cpp | 17 ++++++++++++++ .../strategies/rtree_with_strategies_b_q.cpp | 17 ++++++++++++++ .../strategies/rtree_with_strategies_b_r.cpp | 17 ++++++++++++++ .../strategies/rtree_with_strategies_p_l.cpp | 17 ++++++++++++++ .../strategies/rtree_with_strategies_p_q.cpp | 17 ++++++++++++++ .../strategies/rtree_with_strategies_p_r.cpp | 17 ++++++++++++++ .../strategies/rtree_with_strategies_s_l.cpp | 17 ++++++++++++++ .../strategies/rtree_with_strategies_s_q.cpp | 17 ++++++++++++++ .../strategies/rtree_with_strategies_s_r.cpp | 17 ++++++++++++++ 14 files changed, 202 insertions(+), 19 deletions(-) create mode 100644 index/test/rtree/strategies/CMakeLists.txt create mode 100644 index/test/rtree/strategies/Jamfile rename index/test/rtree/{rtree_with_strategies.cpp => strategies/rtree_with_strategies.hpp} (94%) create mode 100644 index/test/rtree/strategies/rtree_with_strategies_b_l.cpp create mode 100644 index/test/rtree/strategies/rtree_with_strategies_b_q.cpp create mode 100644 index/test/rtree/strategies/rtree_with_strategies_b_r.cpp create mode 100644 index/test/rtree/strategies/rtree_with_strategies_p_l.cpp create mode 100644 index/test/rtree/strategies/rtree_with_strategies_p_q.cpp create mode 100644 index/test/rtree/strategies/rtree_with_strategies_p_r.cpp create mode 100644 index/test/rtree/strategies/rtree_with_strategies_s_l.cpp create mode 100644 index/test/rtree/strategies/rtree_with_strategies_s_q.cpp create mode 100644 index/test/rtree/strategies/rtree_with_strategies_s_r.cpp diff --git a/index/test/rtree/CMakeLists.txt b/index/test/rtree/CMakeLists.txt index 7c2ee72b8..636e177fc 100644 --- a/index/test/rtree/CMakeLists.txt +++ b/index/test/rtree/CMakeLists.txt @@ -14,8 +14,9 @@ foreach(item IN ITEMS rtree_move_pack rtree_non_cartesian rtree_values - rtree_with_strategies #compile-fail rtree_values_invalid ) boost_geometry_add_unit_test("index" ${item}) endforeach() + +add_subdirectory(strategies) diff --git a/index/test/rtree/Jamfile b/index/test/rtree/Jamfile index 0ea4a30d1..ee3a7a336 100644 --- a/index/test/rtree/Jamfile +++ b/index/test/rtree/Jamfile @@ -9,6 +9,7 @@ build-project exceptions ; build-project interprocess ; build-project generated ; +build-project strategies ; test-suite boost-geometry-index-rtree : @@ -19,6 +20,5 @@ test-suite boost-geometry-index-rtree [ run rtree_move_pack.cpp ] [ run rtree_non_cartesian.cpp ] [ run rtree_values.cpp ] - [ compile rtree_with_strategies.cpp ] [ compile-fail rtree_values_invalid.cpp ] ; diff --git a/index/test/rtree/strategies/CMakeLists.txt b/index/test/rtree/strategies/CMakeLists.txt new file mode 100644 index 000000000..01c44a4e5 --- /dev/null +++ b/index/test/rtree/strategies/CMakeLists.txt @@ -0,0 +1,21 @@ +# Boost.Geometry +# Copyright (c) 2025 Adam Wulkiewicz, Lodz, Poland. +# Copyright (c) 2024, Oracle and/or its affiliates. +# Contributed and/or modified by Vissarion Fysikopoulos, 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) + +foreach(item IN ITEMS + rtree_with_strategies_b_l + rtree_with_strategies_b_q + rtree_with_strategies_b_r + rtree_with_strategies_p_l + rtree_with_strategies_p_q + rtree_with_strategies_p_r + rtree_with_strategies_s_l + rtree_with_strategies_s_q + rtree_with_strategies_s_r + ) + boost_geometry_add_unit_test("index" ${item}) +endforeach() diff --git a/index/test/rtree/strategies/Jamfile b/index/test/rtree/strategies/Jamfile new file mode 100644 index 000000000..383a30c41 --- /dev/null +++ b/index/test/rtree/strategies/Jamfile @@ -0,0 +1,20 @@ +# Boost.Geometry Index +# +# Copyright (c) 2025 Adam Wulkiewicz, Lodz, Poland. +# +# 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) + +test-suite boost-geometry-index-rtree-strategies + : + [ compile rtree_with_strategies_b_l.cpp ] + [ compile rtree_with_strategies_b_q.cpp ] + [ compile rtree_with_strategies_b_r.cpp ] + [ compile rtree_with_strategies_p_l.cpp ] + [ compile rtree_with_strategies_p_q.cpp ] + [ compile rtree_with_strategies_p_r.cpp ] + [ compile rtree_with_strategies_s_l.cpp ] + [ compile rtree_with_strategies_s_q.cpp ] + [ compile rtree_with_strategies_s_r.cpp ] + ; diff --git a/index/test/rtree/rtree_with_strategies.cpp b/index/test/rtree/strategies/rtree_with_strategies.hpp similarity index 94% rename from index/test/rtree/rtree_with_strategies.cpp rename to index/test/rtree/strategies/rtree_with_strategies.hpp index 40abeb03e..54f513153 100644 --- a/index/test/rtree/rtree_with_strategies.cpp +++ b/index/test/rtree/strategies/rtree_with_strategies.hpp @@ -7,6 +7,9 @@ // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) +#ifndef BOOST_GEOMETRY_INDEX_TEST_RTREE_STRATEGIES_HPP +#define BOOST_GEOMETRY_INDEX_TEST_RTREE_STRATEGIES_HPP + #include #define BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL_PREDICATES @@ -132,7 +135,7 @@ void test_strategies() } template -void test_params() +void test_rtree() { test_strategies>(); test_strategies>(); @@ -142,19 +145,4 @@ void test_params() test_strategies>(); } -template -void test_value() -{ - test_params>(); - test_params>(); - test_params>(); -} - -int test_main(int, char* []) -{ - test_value(); - test_value(); - test_value(); - - return 0; -} +#endif // BOOST_GEOMETRY_INDEX_TEST_RTREE_STRATEGIES_HPP diff --git a/index/test/rtree/strategies/rtree_with_strategies_b_l.cpp b/index/test/rtree/strategies/rtree_with_strategies_b_l.cpp new file mode 100644 index 000000000..165213803 --- /dev/null +++ b/index/test/rtree/strategies/rtree_with_strategies_b_l.cpp @@ -0,0 +1,17 @@ +// Boost.Geometry Index +// Unit Test + +// Copyright (c) 2025 Adam Wulkiewicz, Lodz, Poland. + +// 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) + +#include "rtree_with_strategies.hpp" + +int test_main(int, char* []) +{ + test_rtree>(); + + return 0; +} diff --git a/index/test/rtree/strategies/rtree_with_strategies_b_q.cpp b/index/test/rtree/strategies/rtree_with_strategies_b_q.cpp new file mode 100644 index 000000000..f146520a0 --- /dev/null +++ b/index/test/rtree/strategies/rtree_with_strategies_b_q.cpp @@ -0,0 +1,17 @@ +// Boost.Geometry Index +// Unit Test + +// Copyright (c) 2025 Adam Wulkiewicz, Lodz, Poland. + +// 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) + +#include "rtree_with_strategies.hpp" + +int test_main(int, char* []) +{ + test_rtree>(); + + return 0; +} diff --git a/index/test/rtree/strategies/rtree_with_strategies_b_r.cpp b/index/test/rtree/strategies/rtree_with_strategies_b_r.cpp new file mode 100644 index 000000000..7e2684662 --- /dev/null +++ b/index/test/rtree/strategies/rtree_with_strategies_b_r.cpp @@ -0,0 +1,17 @@ +// Boost.Geometry Index +// Unit Test + +// Copyright (c) 2025 Adam Wulkiewicz, Lodz, Poland. + +// 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) + +#include "rtree_with_strategies.hpp" + +int test_main(int, char* []) +{ + test_rtree>(); + + return 0; +} diff --git a/index/test/rtree/strategies/rtree_with_strategies_p_l.cpp b/index/test/rtree/strategies/rtree_with_strategies_p_l.cpp new file mode 100644 index 000000000..6ae60e2bc --- /dev/null +++ b/index/test/rtree/strategies/rtree_with_strategies_p_l.cpp @@ -0,0 +1,17 @@ +// Boost.Geometry Index +// Unit Test + +// Copyright (c) 2025 Adam Wulkiewicz, Lodz, Poland. + +// 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) + +#include "rtree_with_strategies.hpp" + +int test_main(int, char* []) +{ + test_rtree>(); + + return 0; +} diff --git a/index/test/rtree/strategies/rtree_with_strategies_p_q.cpp b/index/test/rtree/strategies/rtree_with_strategies_p_q.cpp new file mode 100644 index 000000000..97b280449 --- /dev/null +++ b/index/test/rtree/strategies/rtree_with_strategies_p_q.cpp @@ -0,0 +1,17 @@ +// Boost.Geometry Index +// Unit Test + +// Copyright (c) 2025 Adam Wulkiewicz, Lodz, Poland. + +// 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) + +#include "rtree_with_strategies.hpp" + +int test_main(int, char* []) +{ + test_rtree>(); + + return 0; +} diff --git a/index/test/rtree/strategies/rtree_with_strategies_p_r.cpp b/index/test/rtree/strategies/rtree_with_strategies_p_r.cpp new file mode 100644 index 000000000..3ca887eb3 --- /dev/null +++ b/index/test/rtree/strategies/rtree_with_strategies_p_r.cpp @@ -0,0 +1,17 @@ +// Boost.Geometry Index +// Unit Test + +// Copyright (c) 2025 Adam Wulkiewicz, Lodz, Poland. + +// 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) + +#include "rtree_with_strategies.hpp" + +int test_main(int, char* []) +{ + test_rtree>(); + + return 0; +} diff --git a/index/test/rtree/strategies/rtree_with_strategies_s_l.cpp b/index/test/rtree/strategies/rtree_with_strategies_s_l.cpp new file mode 100644 index 000000000..b4dced5da --- /dev/null +++ b/index/test/rtree/strategies/rtree_with_strategies_s_l.cpp @@ -0,0 +1,17 @@ +// Boost.Geometry Index +// Unit Test + +// Copyright (c) 2025 Adam Wulkiewicz, Lodz, Poland. + +// 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) + +#include "rtree_with_strategies.hpp" + +int test_main(int, char* []) +{ + test_rtree>(); + + return 0; +} diff --git a/index/test/rtree/strategies/rtree_with_strategies_s_q.cpp b/index/test/rtree/strategies/rtree_with_strategies_s_q.cpp new file mode 100644 index 000000000..4f60ed1f4 --- /dev/null +++ b/index/test/rtree/strategies/rtree_with_strategies_s_q.cpp @@ -0,0 +1,17 @@ +// Boost.Geometry Index +// Unit Test + +// Copyright (c) 2025 Adam Wulkiewicz, Lodz, Poland. + +// 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) + +#include "rtree_with_strategies.hpp" + +int test_main(int, char* []) +{ + test_rtree>(); + + return 0; +} diff --git a/index/test/rtree/strategies/rtree_with_strategies_s_r.cpp b/index/test/rtree/strategies/rtree_with_strategies_s_r.cpp new file mode 100644 index 000000000..1b6de10bc --- /dev/null +++ b/index/test/rtree/strategies/rtree_with_strategies_s_r.cpp @@ -0,0 +1,17 @@ +// Boost.Geometry Index +// Unit Test + +// Copyright (c) 2025 Adam Wulkiewicz, Lodz, Poland. + +// 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) + +#include "rtree_with_strategies.hpp" + +int test_main(int, char* []) +{ + test_rtree>(); + + return 0; +} From b051ccdb1f28397c398494eb6a8fa8d23722c60c Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Wed, 5 Mar 2025 00:04:34 +0100 Subject: [PATCH 2/7] test: add cmake files for rtree tests --- index/test/rtree/CMakeLists.txt | 2 ++ index/test/rtree/exceptions/CMakeLists.txt | 15 +++++++++++++++ index/test/rtree/generated/CMakeLists.txt | 7 +++++++ index/test/rtree/generated/b2d/CMakeLists.txt | 19 +++++++++++++++++++ index/test/rtree/strategies/CMakeLists.txt | 2 -- 5 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 index/test/rtree/exceptions/CMakeLists.txt create mode 100644 index/test/rtree/generated/CMakeLists.txt create mode 100644 index/test/rtree/generated/b2d/CMakeLists.txt diff --git a/index/test/rtree/CMakeLists.txt b/index/test/rtree/CMakeLists.txt index 636e177fc..fd5e56cdc 100644 --- a/index/test/rtree/CMakeLists.txt +++ b/index/test/rtree/CMakeLists.txt @@ -19,4 +19,6 @@ foreach(item IN ITEMS boost_geometry_add_unit_test("index" ${item}) endforeach() +add_subdirectory(exceptions) +add_subdirectory(generated) add_subdirectory(strategies) diff --git a/index/test/rtree/exceptions/CMakeLists.txt b/index/test/rtree/exceptions/CMakeLists.txt new file mode 100644 index 000000000..2789f5bc8 --- /dev/null +++ b/index/test/rtree/exceptions/CMakeLists.txt @@ -0,0 +1,15 @@ +# Boost.Geometry +# Copyright (c) 2025 Adam Wulkiewicz, Lodz, Poland. +# Copyright (c) 2024, Oracle and/or its affiliates. +# Contributed and/or modified by Vissarion Fysikopoulos, 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) + +foreach(item IN ITEMS + rtree_exceptions_lin + rtree_exceptions_qua + rtree_exceptions_rst + ) + boost_geometry_add_unit_test("index" ${item}) +endforeach() diff --git a/index/test/rtree/generated/CMakeLists.txt b/index/test/rtree/generated/CMakeLists.txt new file mode 100644 index 000000000..6f5fb9ded --- /dev/null +++ b/index/test/rtree/generated/CMakeLists.txt @@ -0,0 +1,7 @@ +# Boost.Geometry +# Copyright (c) 2025 Adam Wulkiewicz, Lodz, Poland. +# 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) + +add_subdirectory(b2d) \ No newline at end of file diff --git a/index/test/rtree/generated/b2d/CMakeLists.txt b/index/test/rtree/generated/b2d/CMakeLists.txt new file mode 100644 index 000000000..a00c2c5e2 --- /dev/null +++ b/index/test/rtree/generated/b2d/CMakeLists.txt @@ -0,0 +1,19 @@ +# Boost.Geometry +# Copyright (c) 2025 Adam Wulkiewicz, Lodz, Poland. +# 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) + +foreach(item IN ITEMS + rtree_lin_add_b2d + rtree_lin_mod_b2d + rtree_lin_que_b2d + rtree_qua_add_b2d + rtree_qua_mod_b2d + rtree_qua_que_b2d + rtree_rst_add_b2d + rtree_rst_mod_b2d + rtree_rst_que_b2d + ) + boost_geometry_add_unit_test("index" ${item}) +endforeach() diff --git a/index/test/rtree/strategies/CMakeLists.txt b/index/test/rtree/strategies/CMakeLists.txt index 01c44a4e5..dcb236cec 100644 --- a/index/test/rtree/strategies/CMakeLists.txt +++ b/index/test/rtree/strategies/CMakeLists.txt @@ -1,7 +1,5 @@ # Boost.Geometry # Copyright (c) 2025 Adam Wulkiewicz, Lodz, Poland. -# Copyright (c) 2024, Oracle and/or its affiliates. -# Contributed and/or modified by Vissarion Fysikopoulos, 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) From ab495c3c0a2b2d7099af08a196835f74874caa65 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 15 Mar 2025 20:05:47 +0100 Subject: [PATCH 3/7] fix: avoid warnings for coordinate conversions and unused parameters Fixes: #629 --- .../detail/overlay/check_enrich.hpp | 3 +++ .../distance_cross_track_box_box.hpp | 3 +-- .../strategy/cartesian/side_by_triangle.hpp | 23 ++++++++++++------- .../boost/geometry/util/promote_integral.hpp | 6 ++--- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/overlay/check_enrich.hpp b/include/boost/geometry/algorithms/detail/overlay/check_enrich.hpp index 219549418..af5136593 100644 --- a/include/boost/geometry/algorithms/detail/overlay/check_enrich.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/check_enrich.hpp @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -66,6 +67,8 @@ inline void display(MetaTurn const& meta_turn, const char* reason = "") //<< " -> " << op_index << " " << reason << std::endl; +#else +boost::ignore_unused(meta_turn, reason); #endif } diff --git a/include/boost/geometry/strategies/geographic/distance_cross_track_box_box.hpp b/include/boost/geometry/strategies/geographic/distance_cross_track_box_box.hpp index 4c9b2a2ee..6a9d73cb3 100644 --- a/include/boost/geometry/strategies/geographic/distance_cross_track_box_box.hpp +++ b/include/boost/geometry/strategies/geographic/distance_cross_track_box_box.hpp @@ -189,8 +189,7 @@ private: public: template - static inline return_type apply(this_strategy const& strategy, - T const& distance) + static inline return_type apply(this_strategy const& , T const& distance) { return static_cast(distance); } diff --git a/include/boost/geometry/strategy/cartesian/side_by_triangle.hpp b/include/boost/geometry/strategy/cartesian/side_by_triangle.hpp index 3fdbd8019..bf8c0d64c 100644 --- a/include/boost/geometry/strategy/cartesian/side_by_triangle.hpp +++ b/include/boost/geometry/strategy/cartesian/side_by_triangle.hpp @@ -33,6 +33,7 @@ #include #include +#include #include #include @@ -205,23 +206,29 @@ public : template static inline int apply(P1 const& p1, P2 const& p2, P const& p) { - using coor_t = typename select_calculation_type_alt::type; - - // Promote float->double, small int->int - using promoted_t = typename select_most_precise::type; - - bool const are_all_integral_coordinates = + constexpr bool are_all_integral_coordinates = std::is_integral>::value && std::is_integral>::value && std::is_integral>::value; + // Promote float to double + // For integer: short -> int -> long + // For larger integers: long, long long, std::int64_t all stay as they are (on a Mac) + using coor_t = typename select_calculation_type_alt::type; + using promoted_t = std::conditional_t + < + are_all_integral_coordinates, + typename promote_integral::type, + typename select_most_precise::type + >; + eps_policy< math::detail::equals_factor_policy > epsp; - promoted_t s = compute_side_value + promoted_t const s = compute_side_value < coor_t, promoted_t, are_all_integral_coordinates >::apply(p1, p2, p, epsp); - promoted_t const zero = promoted_t(); + static promoted_t const zero = promoted_t(); return math::detail::equals_by_policy(s, zero, epsp.policy) ? 0 : s > zero ? 1 : -1; diff --git a/include/boost/geometry/util/promote_integral.hpp b/include/boost/geometry/util/promote_integral.hpp index 0566f4214..764ab0514 100644 --- a/include/boost/geometry/util/promote_integral.hpp +++ b/include/boost/geometry/util/promote_integral.hpp @@ -11,11 +11,11 @@ #ifndef BOOST_GEOMETRY_UTIL_PROMOTE_INTEGRAL_HPP #define BOOST_GEOMETRY_UTIL_PROMOTE_INTEGRAL_HPP -// For now deactivate the use of multiprecision integers -// TODO: activate it later +// Uncommenting this macro will use Boost.Multiprecision's cpp_int<> as a last resort +// TODO (#1380): change this to BOOST_GEOMETRY_PROMOTE_INTEGER_TO_BOOST_MULTI_PRECISION +// to be able to let users actively choose to use Boost.Multiprecision, but not enable it by default #define BOOST_GEOMETRY_NO_MULTIPRECISION_INTEGER - #include #include #include From 0091b636a1c146073955224d5c7f1bbafc57201b Mon Sep 17 00:00:00 2001 From: Vissarion Fisikopoulos Date: Tue, 17 Dec 2024 17:16:11 +0200 Subject: [PATCH 4/7] fix: relax half period checks in normalization of longitudes --- .../boost/geometry/strategies/normalize.hpp | 11 +++--- .../strategies/spherical/point_in_point.hpp | 12 +++--- .../util/normalize_spheroidal_coordinates.hpp | 37 ++++++++++++------- .../overlay/get_turns_linear_linear_geo.cpp | 2 +- .../difference/difference_linear_linear.cpp | 9 +++-- 5 files changed, 42 insertions(+), 29 deletions(-) diff --git a/include/boost/geometry/strategies/normalize.hpp b/include/boost/geometry/strategies/normalize.hpp index e9887d5ed..ec71a45f7 100644 --- a/include/boost/geometry/strategies/normalize.hpp +++ b/include/boost/geometry/strategies/normalize.hpp @@ -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 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; @@ -135,7 +136,7 @@ struct normalize_point typename geometry::detail::cs_angular_units::type, IsEquatorial, in_coordinate_type - >(longitude, latitude); + >(longitude, latitude, exact); assign_loop < @@ -221,13 +222,13 @@ struct cartesian_box struct spherical_point { template - 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, spherical_polar_tag>::value) - >::apply(point_in, point_out); + >::apply(point_in, point_out, exact); } }; diff --git a/include/boost/geometry/strategies/spherical/point_in_point.hpp b/include/boost/geometry/strategies/spherical/point_in_point.hpp index 7381cb0d5..3f6a81b46 100644 --- a/include/boost/geometry/strategies/spherical/point_in_point.hpp +++ b/include/boost/geometry/strategies/spherical/point_in_point.hpp @@ -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. @@ -71,9 +72,10 @@ private: typedef typename helper_geometry::type helper_point_type2; 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 < diff --git a/include/boost/geometry/util/normalize_spheroidal_coordinates.hpp b/include/boost/geometry/util/normalize_spheroidal_coordinates.hpp index 074acc8a2..8f5530a0f 100644 --- a/include/boost/geometry/util/normalize_spheroidal_coordinates.hpp +++ b/include/boost/geometry/util/normalize_spheroidal_coordinates.hpp @@ -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 @@ -236,17 +237,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::epsilon(); + static constexpr bool is_integer = std::numeric_limits::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 +265,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::apply(latitude); @@ -288,7 +295,7 @@ public: #endif // BOOST_GEOMETRY_NORMALIZE_LATITUDE // normalize longitude - apply(longitude); + apply(longitude, exact); // finally normalize poles if (normalize_poles) @@ -353,22 +360,24 @@ inline void normalize_angle_cond(CoordinateType& angle) */ template 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 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 +390,12 @@ inline void normalize_spheroidal_coordinates(CoordinateType& longitude, \ingroup utility */ template -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 +409,7 @@ inline void normalize_longitude(CoordinateType& longitude) template inline void normalize_azimuth(CoordinateType& angle) { - normalize_longitude(angle); + math::normalize_longitude(angle, true); } /*! @@ -435,7 +444,7 @@ inline CoordinateType longitude_distance_signed(CoordinateType const& longitude1 CoordinateType const& longitude2) { CoordinateType diff = longitude2 - longitude1; - math::normalize_longitude(diff); + math::normalize_longitude(diff, true); return diff; } diff --git a/test/algorithms/overlay/get_turns_linear_linear_geo.cpp b/test/algorithms/overlay/get_turns_linear_linear_geo.cpp index de0d82b7f..050071faf 100644 --- a/test/algorithms/overlay/get_turns_linear_linear_geo.cpp +++ b/test/algorithms/overlay/get_turns_linear_linear_geo.cpp @@ -24,7 +24,7 @@ void test_radian() boost::geometry::strategies::relate::geographic<> wgs84(sph_wgs84); test_geometry( - "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," diff --git a/test/algorithms/set_operations/difference/difference_linear_linear.cpp b/test/algorithms/set_operations/difference/difference_linear_linear.cpp index 18220f462..3e3c7105c 100644 --- a/test/algorithms/set_operations/difference/difference_linear_linear.cpp +++ b/test/algorithms/set_operations/difference/difference_linear_linear.cpp @@ -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 @@ -1160,7 +1161,7 @@ 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; @@ -1247,7 +1248,7 @@ 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; @@ -1452,7 +1453,7 @@ BOOST_AUTO_TEST_CASE( test_difference_ls_mls_geo_rad ) bg::srs::spheroid sph_wgs84(6378137.0, 6356752.3142451793); boost::geometry::strategy::intersection::geographic_segments<> wgs84(sph_wgs84); - ls g1 = from_wkt("LINESTRING(0 0, -3.14159265358979 0)"); + ls g1 = from_wkt("LINESTRING(0 0,-3.14159265358979 0)"); mls g2 = from_wkt("MULTILINESTRING((-2.1467549799530232 -0.12217304763960295," "-2.5481807079117185 -0.90757121103705041," "-2.6529004630313784 0.85521133347722067," From c08dcd4a53377b98911eda044d6cf87a08c75577 Mon Sep 17 00:00:00 2001 From: Vissarion Fisikopoulos Date: Thu, 30 Jan 2025 10:30:32 +0200 Subject: [PATCH 5/7] chore: Remove unused local typedef --- test/util/rational.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/util/rational.cpp b/test/util/rational.cpp index 1e3056edf..10d0df1f5 100644 --- a/test/util/rational.cpp +++ b/test/util/rational.cpp @@ -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 void test_bounds() { using coordinate_t = boost::rational; - using point_t = bg::model::point; auto const lowest = bg::util::bounds::lowest(); auto const highest = bg::util::bounds::highest(); From 3097cef82813b07fc66fd890655b06ae63dbf77f Mon Sep 17 00:00:00 2001 From: Vissarion Fisikopoulos Date: Thu, 30 Jan 2025 15:51:19 +0200 Subject: [PATCH 6/7] test: Add tests for equal points on antimeridian --- test/algorithms/equals/equals_on_spheroid.cpp | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/test/algorithms/equals/equals_on_spheroid.cpp b/test/algorithms/equals/equals_on_spheroid.cpp index ce87e0e9b..f0c35e684 100644 --- a/test/algorithms/equals/equals_on_spheroid.cpp +++ b/test/algorithms/equals/equals_on_spheroid.cpp @@ -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 @@ -176,6 +177,33 @@ BOOST_AUTO_TEST_CASE( equals_point_point_se ) >::apply("se"); } +template +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; + using P = bgm::point; + + test_geometry("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() * 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 cs_type; From 75c7dfded77422a36c22db1ec27fe3666108c745 Mon Sep 17 00:00:00 2001 From: Vissarion Fisikopoulos Date: Tue, 4 Feb 2025 17:22:04 +0200 Subject: [PATCH 7/7] chore: Replace typedefs by using --- .../strategies/spherical/point_in_point.hpp | 12 ++--- .../util/normalize_spheroidal_coordinates.hpp | 31 +++---------- include/boost/geometry/util/rational.hpp | 6 +-- test/algorithms/equals/equals_on_spheroid.cpp | 12 ++--- .../difference/difference_linear_linear.cpp | 44 +++++++------------ 5 files changed, 37 insertions(+), 68 deletions(-) diff --git a/include/boost/geometry/strategies/spherical/point_in_point.hpp b/include/boost/geometry/strategies/spherical/point_in_point.hpp index 3f6a81b46..21ed2066f 100644 --- a/include/boost/geometry/strategies/spherical/point_in_point.hpp +++ b/include/boost/geometry/strategies/spherical/point_in_point.hpp @@ -68,8 +68,8 @@ private: { static inline bool apply(Point1 const& point1, Point2 const& point2) { - typedef typename helper_geometry::type helper_point_type1; - typedef typename helper_geometry::type helper_point_type2; + using helper_point_type1 = typename helper_geometry::type; + using helper_point_type2 = typename helper_geometry::type; helper_point_type1 point1_normalized; bool const exact_normalized = false; @@ -89,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::type, typename fp_coordinate_type::type - >::type calculation_type; + >::type; typename helper_geometry < @@ -151,7 +151,7 @@ namespace services template struct default_strategy { - typedef strategy::within::spherical_point_point type; + using type = strategy::within::spherical_point_point; }; } // namespace services @@ -168,7 +168,7 @@ namespace strategy { namespace covered_by { namespace services template struct default_strategy { - typedef strategy::within::spherical_point_point type; + using type = strategy::within::spherical_point_point; }; }}} // namespace strategy::covered_by::services diff --git a/include/boost/geometry/util/normalize_spheroidal_coordinates.hpp b/include/boost/geometry/util/normalize_spheroidal_coordinates.hpp index 8f5530a0f..6fa52d738 100644 --- a/include/boost/geometry/util/normalize_spheroidal_coordinates.hpp +++ b/include/boost/geometry/util/normalize_spheroidal_coordinates.hpp @@ -152,11 +152,7 @@ struct constants_on_spheroid template inline CoordinateType latitude_convert_ep(CoordinateType const& lat) { - typedef math::detail::constants_on_spheroid - < - CoordinateType, - Units - > constants; + using constants = math::detail::constants_on_spheroid; return constants::quarter_period() - lat; } @@ -165,31 +161,21 @@ inline CoordinateType latitude_convert_ep(CoordinateType const& lat) template static bool is_latitude_pole(T const& lat) { - typedef math::detail::constants_on_spheroid - < - T, - Units - > constants; + using constants = math::detail::constants_on_spheroid; return math::equals(math::abs(IsEquatorial ? lat : math::latitude_convert_ep(lat)), constants::quarter_period()); - } template static bool is_longitude_antimeridian(T const& lon) { - typedef math::detail::constants_on_spheroid - < - T, - Units - > constants; + using constants = math::detail::constants_on_spheroid; return math::equals(math::abs(lon), constants::half_period()); - } @@ -219,7 +205,7 @@ struct latitude_convert_if_polar template class normalize_spheroidal_coordinates { - typedef constants_on_spheroid constants; + using constants = constants_on_spheroid; protected: static inline CoordinateType normalize_up(CoordinateType const& value) @@ -324,7 +310,7 @@ public: template inline void normalize_angle_loop(CoordinateType& angle) { - typedef constants_on_spheroid constants; + using constants = constants_on_spheroid; CoordinateType const pi = constants::half_period(); CoordinateType const two_pi = constants::period(); while (angle > pi) @@ -336,7 +322,7 @@ inline void normalize_angle_loop(CoordinateType& angle) template inline void normalize_angle_cond(CoordinateType& angle) { - typedef constants_on_spheroid constants; + using constants = constants_on_spheroid; CoordinateType const pi = constants::half_period(); CoordinateType const two_pi = constants::period(); if (angle > pi) @@ -462,10 +448,7 @@ template 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 const c0 = 0; CoordinateType diff = longitude_distance_signed(longitude1, longitude2); diff --git a/include/boost/geometry/util/rational.hpp b/include/boost/geometry/util/rational.hpp index bfe6161e7..e9a1244b9 100644 --- a/include/boost/geometry/util/rational.hpp +++ b/include/boost/geometry/util/rational.hpp @@ -101,16 +101,16 @@ struct coordinate_cast > template struct select_most_precise, boost::rational > { - typedef typename boost::rational + using type = typename boost::rational < typename select_most_precise::type - > type; + > ; }; template struct select_most_precise, double> { - typedef typename boost::rational type; + using type = typename boost::rational; }; namespace util diff --git a/test/algorithms/equals/equals_on_spheroid.cpp b/test/algorithms/equals/equals_on_spheroid.cpp index f0c35e684..04fc80fb4 100644 --- a/test/algorithms/equals/equals_on_spheroid.cpp +++ b/test/algorithms/equals/equals_on_spheroid.cpp @@ -130,7 +130,7 @@ struct test_point_point_with_height template void test_segment_segment(std::string const& header) { - typedef bgm::segment

seg; + using seg = bgm::segment

; std::string const str = header + "-"; @@ -159,7 +159,7 @@ void test_segment_segment(std::string const& header) BOOST_AUTO_TEST_CASE( equals_point_point_se ) { - typedef bg::cs::spherical_equatorial cs_type; + using cs_type = bg::cs::spherical_equatorial; test_point_point >::apply("se"); test_point_point >::apply("se"); @@ -206,7 +206,7 @@ BOOST_AUTO_TEST_CASE( equals_point_point_radian ) BOOST_AUTO_TEST_CASE( equals_point_point_with_height_se ) { - typedef bg::cs::spherical_equatorial cs_type; + using cs_type = bg::cs::spherical_equatorial; test_point_point >::apply("seh"); test_point_point >::apply("seh"); @@ -226,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 cs_type; + using cs_type = bg::cs::geographic; test_point_point >::apply("geo"); test_point_point >::apply("geo"); @@ -246,7 +246,7 @@ BOOST_AUTO_TEST_CASE( equals_point_point_geo ) BOOST_AUTO_TEST_CASE( equals_segment_segment_se ) { - typedef bg::cs::spherical_equatorial cs_type; + using cs_type = bg::cs::spherical_equatorial; test_segment_segment >("se"); test_segment_segment >("se"); @@ -255,7 +255,7 @@ BOOST_AUTO_TEST_CASE( equals_segment_segment_se ) BOOST_AUTO_TEST_CASE( equals_segment_segment_geo ) { - typedef bg::cs::geographic cs_type; + using cs_type = bg::cs::geographic; test_segment_segment >("geo"); test_segment_segment >("geo"); diff --git a/test/algorithms/set_operations/difference/difference_linear_linear.cpp b/test/algorithms/set_operations/difference/difference_linear_linear.cpp index 3e3c7105c..e448d60f9 100644 --- a/test/algorithms/set_operations/difference/difference_linear_linear.cpp +++ b/test/algorithms/set_operations/difference/difference_linear_linear.cpp @@ -27,11 +27,12 @@ #include #include -typedef bg::model::point point_type; -typedef bg::model::segment segment_type; -typedef bg::model::linestring linestring_type; -typedef bg::model::multi_linestring multi_linestring_type; - +using point_type = bg::model::point; +using segment_type = bg::model::segment; +using linestring_type = bg::model::linestring; +using multi_linestring_type = bg::model::multi_linestring; +using L = linestring_type; +using ML = multi_linestring_type; //=========================================================================== @@ -47,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 tester; + using tester = test_difference_of_geometries; tester::apply (from_wkt("LINESTRING(0 0,1 1,2 1,3 2)"), @@ -566,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 tester; + using tester = test_difference_of_geometries; // disjoint linestrings tester::apply @@ -790,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 tester; + using tester = test_difference_of_geometries; // disjoint linestrings tester::apply @@ -875,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 tester; + using tester = test_difference_of_geometries; // disjoint linestrings tester::apply @@ -1167,9 +1157,7 @@ BOOST_AUTO_TEST_CASE( test_difference_ml_ml_degenerate ) std::cout << std::endl; #endif - typedef multi_linestring_type ML; - - typedef test_difference_of_geometries tester; + using tester = test_difference_of_geometries; // the following test cases concern linestrings with duplicate // points and possibly linestrings with zero length. @@ -1254,9 +1242,7 @@ BOOST_AUTO_TEST_CASE( test_difference_ml_ml_spikes ) std::cout << std::endl; #endif - typedef multi_linestring_type ML; - - typedef test_difference_of_geometries tester; + using tester = test_difference_of_geometries; // the following test cases concern linestrings with spikes @@ -1446,9 +1432,9 @@ BOOST_AUTO_TEST_CASE( test_difference_ml_ml_spikes ) BOOST_AUTO_TEST_CASE( test_difference_ls_mls_geo_rad ) { - typedef bg::model::point > pt; - typedef bg::model::linestring ls; - typedef bg::model::multi_linestring mls; + using pt = bg::model::point>; + using ls = bg::model::linestring; + using mls = bg::model::multi_linestring; bg::srs::spheroid sph_wgs84(6378137.0, 6356752.3142451793); boost::geometry::strategy::intersection::geographic_segments<> wgs84(sph_wgs84);