From 3b43fe23e7c64d11eef49d9e70bafb2dbaaa4f14 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Tue, 18 Dec 2018 04:33:15 +0100 Subject: [PATCH 01/48] [algorithms] Fix includes and reduce dependencies in discrete frechet and hausdorff distance (and other things). --- .../algorithms/discrete_frechet_distance.hpp | 69 ++++++++++++------- .../discrete_hausdorff_distance.hpp | 35 +++++----- 2 files changed, 64 insertions(+), 40 deletions(-) diff --git a/include/boost/geometry/algorithms/discrete_frechet_distance.hpp b/include/boost/geometry/algorithms/discrete_frechet_distance.hpp index de8a5286e..70a0c1d11 100644 --- a/include/boost/geometry/algorithms/discrete_frechet_distance.hpp +++ b/include/boost/geometry/algorithms/discrete_frechet_distance.hpp @@ -1,8 +1,12 @@ // Boost.Geometry // Copyright (c) 2018 Yaghyavardhan Singh Khangarot, Hyderabad, India. +// Contributed and/or modified by Yaghyavardhan Singh Khangarot, +// as part of Google Summer of Code 2018 program. -// Contributed and/or modified by Yaghyavardhan Singh Khangarot, as part of Google Summer of Code 2018 program. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018 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 @@ -22,13 +26,15 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include #include +#include +#include +#include +#include +#include namespace boost { namespace geometry @@ -48,7 +54,7 @@ public: result_type & operator()(size_type1 i, size_type2 j) { - BOOST_ASSERT(i < m_width && j < m_height); + BOOST_GEOMETRY_ASSERT(i < m_width && j < m_height); return m_data[j * m_width + i]; } @@ -86,28 +92,31 @@ struct linestring_linestring //Coupling Matrix CoupMat(a,b,-1); - coup_mat coup_matrix(a,b); + coup_mat coup_matrix(a,b); result_type const not_feasible = -100; //findin the Coupling Measure - for(size_type1 i=0;i0) - coup_matrix(i,j)= - (std::max)(coup_matrix(i,j-1),dis); + coup_matrix(i,j) = + (std::max)(coup_matrix(i,j-1), dis); else if(i>0 && j==0) - coup_matrix(i,j)= - (std::max)(coup_matrix(i-1,j),dis); + coup_matrix(i,j) = + (std::max)(coup_matrix(i-1,j), dis); else if(i>0 && j>0) - coup_matrix(i,j)= - (std::max)((std::min)(coup_matrix(i,j-1),(std::min)(coup_matrix(i-1,j),coup_matrix(i-1,j-1))),dis); + coup_matrix(i,j) = + (std::max)((std::min)(coup_matrix(i,j-1), + (std::min)(coup_matrix(i-1,j), + coup_matrix(i-1,j-1))), + dis); else - coup_matrix(i,j)=not_feasible; + coup_matrix(i,j) = not_feasible; } } @@ -140,8 +149,15 @@ template > struct discrete_frechet_distance : not_implemented {}; + template -struct discrete_frechet_distance +struct discrete_frechet_distance + < + Linestring1, + Linestring2, + linestring_tag, + linestring_tag + > : detail::discrete_frechet_distance::linestring_linestring {}; @@ -151,7 +167,7 @@ struct discrete_frechet_distance::type, Strategy >::type -discrete_frechet_distance(Geometry1 const& geometry1, Geometry2 const& geometry2, Strategy const& strategy) +discrete_frechet_distance(Geometry1 const& geometry1, + Geometry2 const& geometry2, + Strategy const& strategy) { - return dispatch::discrete_frechet_distance::apply(geometry1, geometry2, strategy); + return dispatch::discrete_frechet_distance + < + Geometry1, Geometry2 + >::apply(geometry1, geometry2, strategy); } // Algorithm overload using default Pt-Pt distance strategy /*! \brief Calculate discrete Frechet distance between two geometries (currently - work for LineString-LineString). + work for LineString-LineString). \ingroup discrete_frechet_distance \tparam Geometry1 \tparam_geometry \tparam Geometry2 \tparam_geometry diff --git a/include/boost/geometry/algorithms/discrete_hausdorff_distance.hpp b/include/boost/geometry/algorithms/discrete_hausdorff_distance.hpp index f9daefe62..6b954737b 100644 --- a/include/boost/geometry/algorithms/discrete_hausdorff_distance.hpp +++ b/include/boost/geometry/algorithms/discrete_hausdorff_distance.hpp @@ -26,16 +26,18 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include #include -#include +#include +#include +#include +#include -namespace bgi = boost::geometry::index; +#ifdef BOOST_GEOMETRY_ENABLE_SIMILARITY_RTREE +#include +#endif // BOOST_GEOMETRY_ENABLE_SIMILARITY_RTREE namespace boost { namespace geometry { @@ -70,7 +72,7 @@ struct point_range for (size_type i = 0 ; i < n ; i++) { - result_type dis_temp = geometry::distance(pnt, range::at(rng, i), strategy); + result_type dis_temp = strategy.apply(pnt, range::at(rng, i)); if (! is_dis_min_set || dis_temp < dis_min) { dis_min = dis_temp; @@ -110,6 +112,7 @@ struct range_range result_type dis_max = 0; #ifdef BOOST_GEOMETRY_ENABLE_SIMILARITY_RTREE + namespace bgi = boost::geometry::index; typedef typename point_type::type point_t; typedef bgi::rtree > rtree_type; rtree_type rtree(boost::begin(r2), boost::end(r2)); @@ -120,7 +123,7 @@ struct range_range { #ifdef BOOST_GEOMETRY_ENABLE_SIMILARITY_RTREE size_type found = rtree.query(bgi::nearest(range::at(r1, i), 1), &res); - result_type dis_min = geometry::distance(range::at(r1,i), res); + result_type dis_min = strategy.apply(range::at(r1,i), res); #else result_type dis_min = point_range::apply(range::at(r1, i), r2, strategy); #endif @@ -246,15 +249,15 @@ struct discrete_hausdorff_distance -struct discrete_hausdorff_distance +// Specialization for Linestring and MultiLinestring +template +struct discrete_hausdorff_distance : detail::discrete_hausdorff_distance::range_multi_range {}; -// Specialization for multi_linestring and multi_linestring -template -struct discrete_hausdorff_distance +// Specialization for MultiLinestring and MultiLinestring +template +struct discrete_hausdorff_distance : detail::discrete_hausdorff_distance::multi_range_multi_range {}; From 5f39dfe6aff007e376003d73f393aca079397535 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Tue, 18 Dec 2018 04:33:42 +0100 Subject: [PATCH 02/48] [test][algorithms] Add missing includes in hausdorff distance test. --- .../similarity/discrete_hausdorff_distance.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/algorithms/similarity/discrete_hausdorff_distance.cpp b/test/algorithms/similarity/discrete_hausdorff_distance.cpp index 15659fc69..d5d98cdcb 100644 --- a/test/algorithms/similarity/discrete_hausdorff_distance.cpp +++ b/test/algorithms/similarity/discrete_hausdorff_distance.cpp @@ -2,7 +2,12 @@ // Copyright (c) 2018 Yaghyavardhan Singh Khangarot, Hyderabad, India. -// Contributed and/or modified by Yaghyavardhan Singh Khangarot, as part of Google Summer of Code 2018 program. +// Contributed and/or modified by Yaghyavardhan Singh Khangarot, +// as part of Google Summer of Code 2018 program. + +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018 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 @@ -13,6 +18,8 @@ #include #include #include +#include +#include #include "test_hausdorff_distance.hpp" From c668c217f777cba07fe379b4b350f6bf213ba759 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Tue, 18 Dec 2018 04:34:29 +0100 Subject: [PATCH 03/48] [algorithms] Add missing includes. --- .../detail/buffer/buffer_policies.hpp | 5 ++-- .../detail/distance/segment_to_box.hpp | 27 ++++++++++--------- .../detail/is_valid/complement_graph.hpp | 6 ++++- .../is_valid/debug_complement_graph.hpp | 5 +++- .../algorithms/detail/is_valid/ring.hpp | 4 ++- .../detail/overlay/check_enrich.hpp | 16 +++++++++-- .../detail/overlay/get_turn_info.hpp | 5 ++-- .../detail/overlay/get_turn_info_helpers.hpp | 14 +++++++--- .../algorithms/detail/overlay/stream_info.hpp | 11 +++++--- .../detail/overlay/traversal_ring_creator.hpp | 5 ++-- .../overlay/traversal_switch_detector.hpp | 6 +++++ .../detail/relate/follow_helpers.hpp | 11 ++++++-- .../detail/relate/topology_check.hpp | 1 + .../geometry/algorithms/detail/sub_range.hpp | 16 ++++++++--- 14 files changed, 95 insertions(+), 37 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/buffer/buffer_policies.hpp b/include/boost/geometry/algorithms/detail/buffer/buffer_policies.hpp index 0374b53a9..732c1d32c 100644 --- a/include/boost/geometry/algorithms/detail/buffer/buffer_policies.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/buffer_policies.hpp @@ -2,8 +2,8 @@ // Copyright (c) 2012-2014 Barend Gehrels, Amsterdam, the Netherlands. -// 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, 2018. +// Modifications copyright (c) 2017-2018, 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, @@ -26,6 +26,7 @@ #include #include +#include #include #include diff --git a/include/boost/geometry/algorithms/detail/distance/segment_to_box.hpp b/include/boost/geometry/algorithms/detail/distance/segment_to_box.hpp index bfe52c7b1..863d88726 100644 --- a/include/boost/geometry/algorithms/detail/distance/segment_to_box.hpp +++ b/include/boost/geometry/algorithms/detail/distance/segment_to_box.hpp @@ -4,12 +4,14 @@ // 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 // Licensed under the Boost Software License version 1.0. // http://www.boost.org/users/license.html #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISTANCE_SEGMENT_TO_BOX_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISTANCE_SEGMENT_TO_BOX_HPP + #include #include @@ -27,6 +29,18 @@ #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + #include #include #include @@ -34,19 +48,6 @@ #include #include -#include - -#include -#include -#include - -#include -#include -#include -#include - -#include - namespace boost { namespace geometry { diff --git a/include/boost/geometry/algorithms/detail/is_valid/complement_graph.hpp b/include/boost/geometry/algorithms/detail/is_valid/complement_graph.hpp index f08e70242..1d3bda191 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/complement_graph.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/complement_graph.hpp @@ -1,8 +1,9 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2014, Oracle and/or its affiliates. +// Copyright (c) 2014, 2018, 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 @@ -19,6 +20,7 @@ #include +#include #include #include @@ -221,9 +223,11 @@ public: return false; } +#ifdef BOOST_GEOMETRY_TEST_DEBUG template friend inline void debug_print_complement_graph(OStream&, complement_graph const&); +#endif // BOOST_GEOMETRY_TEST_DEBUG private: std::size_t m_num_rings, m_num_turns; diff --git a/include/boost/geometry/algorithms/detail/is_valid/debug_complement_graph.hpp b/include/boost/geometry/algorithms/detail/is_valid/debug_complement_graph.hpp index 60f597e29..749dd3fc2 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/debug_complement_graph.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/debug_complement_graph.hpp @@ -1,8 +1,9 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2014, Oracle and/or its affiliates. +// Copyright (c) 2014, 2018, 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 @@ -14,6 +15,8 @@ #include #endif +#include + namespace boost { namespace geometry { diff --git a/include/boost/geometry/algorithms/detail/is_valid/ring.hpp b/include/boost/geometry/algorithms/detail/is_valid/ring.hpp index 40698155b..5a55d998e 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/ring.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/ring.hpp @@ -2,7 +2,7 @@ // Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. -// Copyright (c) 2014-2017, Oracle and/or its affiliates. +// Copyright (c) 2014-2018, 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 @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -36,6 +37,7 @@ #include #include #include +#include #include diff --git a/include/boost/geometry/algorithms/detail/overlay/check_enrich.hpp b/include/boost/geometry/algorithms/detail/overlay/check_enrich.hpp index 25e442982..e07e056c3 100644 --- a/include/boost/geometry/algorithms/detail/overlay/check_enrich.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/check_enrich.hpp @@ -2,6 +2,11 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018 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) @@ -9,11 +14,18 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_CHECK_ENRICH_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_CHECK_ENRICH_HPP +#ifdef BOOST_GEOMETRY_DEBUG_ENRICH +#include +#endif // BOOST_GEOMETRY_DEBUG_ENRICH #include +#include -#include +#include +#include +#include +#include #include @@ -42,7 +54,7 @@ struct meta_turn template -inline void display(MetaTurn const& meta_turn, std::string const& reason = "") +inline void display(MetaTurn const& meta_turn, const char* reason = "") { #ifdef BOOST_GEOMETRY_DEBUG_ENRICH std::cout << meta_turn.index diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp index 815bcb928..edb05f97b 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp @@ -3,8 +3,8 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2015, 2017. -// Modifications copyright (c) 2015-2017 Oracle and/or its affiliates. +// This file was modified by Oracle on 2015, 2017, 2018. +// Modifications copyright (c) 2015-2018 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -21,6 +21,7 @@ #include #include +#include #include #include diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_helpers.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_helpers.hpp index 6640fdd1e..d02f18d96 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_helpers.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_helpers.hpp @@ -2,8 +2,8 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2013, 2014, 2015, 2017. -// Modifications copyright (c) 2013-2017 Oracle and/or its affiliates. +// This file was modified by Oracle on 2013, 2014, 2015, 2017, 2018. +// Modifications copyright (c) 2013-2018 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -14,9 +14,15 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_GET_TURN_INFO_HELPERS_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_GET_TURN_INFO_HELPERS_HPP -#include -#include #include +#include +#include +#include // referring_segment +#include +#include +#include +#include +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/algorithms/detail/overlay/stream_info.hpp b/include/boost/geometry/algorithms/detail/overlay/stream_info.hpp index 51fd1b3dc..f86771a0e 100644 --- a/include/boost/geometry/algorithms/detail/overlay/stream_info.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/stream_info.hpp @@ -2,6 +2,11 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018 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) @@ -12,7 +17,7 @@ #include -#include +#include namespace boost { namespace geometry @@ -32,8 +37,8 @@ namespace detail { namespace overlay return h == 0 ? "-" : (h == 1 ? "A" : "D"); } - template - std::ostream& operator<<(std::ostream &os, turn_info

const& info) + template + std::ostream& operator<<(std::ostream &os, turn_info const& info) { os << "\t" << " src " << info.seg_id.source_index diff --git a/include/boost/geometry/algorithms/detail/overlay/traversal_ring_creator.hpp b/include/boost/geometry/algorithms/detail/overlay/traversal_ring_creator.hpp index 7f80c8313..1c23b9afb 100644 --- a/include/boost/geometry/algorithms/detail/overlay/traversal_ring_creator.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/traversal_ring_creator.hpp @@ -2,8 +2,8 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// 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, 2018. +// Modifications copyright (c) 2017-2018, 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, @@ -17,6 +17,7 @@ #include +#include #include #include #include diff --git a/include/boost/geometry/algorithms/detail/overlay/traversal_switch_detector.hpp b/include/boost/geometry/algorithms/detail/overlay/traversal_switch_detector.hpp index 8bdb03df5..273253132 100644 --- a/include/boost/geometry/algorithms/detail/overlay/traversal_switch_detector.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/traversal_switch_detector.hpp @@ -2,6 +2,11 @@ // Copyright (c) 2015-2016 Barend Gehrels, Amsterdam, the Netherlands. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018 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) @@ -10,6 +15,7 @@ #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_TRAVERSAL_SWITCH_DETECTOR_HPP #include +#include #include diff --git a/include/boost/geometry/algorithms/detail/relate/follow_helpers.hpp b/include/boost/geometry/algorithms/detail/relate/follow_helpers.hpp index fc858fc87..ecaf17b14 100644 --- a/include/boost/geometry/algorithms/detail/relate/follow_helpers.hpp +++ b/include/boost/geometry/algorithms/detail/relate/follow_helpers.hpp @@ -5,22 +5,29 @@ // This file was modified by Oracle on 2013, 2014, 2018. // Modifications copyright (c) 2013-2018 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) -// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_FOLLOW_HELPERS_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_FOLLOW_HELPERS_HPP +#include + #include +#include +#include +#include +#include + #include #include #include -//#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/algorithms/detail/relate/topology_check.hpp b/include/boost/geometry/algorithms/detail/relate/topology_check.hpp index 2dff68fe5..a12acaf42 100644 --- a/include/boost/geometry/algorithms/detail/relate/topology_check.hpp +++ b/include/boost/geometry/algorithms/detail/relate/topology_check.hpp @@ -13,6 +13,7 @@ #include +#include #include diff --git a/include/boost/geometry/algorithms/detail/sub_range.hpp b/include/boost/geometry/algorithms/detail/sub_range.hpp index 29edc94e6..099de426a 100644 --- a/include/boost/geometry/algorithms/detail/sub_range.hpp +++ b/include/boost/geometry/algorithms/detail/sub_range.hpp @@ -2,21 +2,29 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2013, 2014. -// Modifications copyright (c) 2013-2014, Oracle and/or its affiliates. +// This file was modified by Oracle on 2013, 2014, 2018. +// Modifications copyright (c) 2013-2018, 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) -// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle - #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_SUB_RANGE_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_SUB_RANGE_HPP #include +#include + +#include #include +#include +#include +#include +#include + #include namespace boost { namespace geometry { From f224f369838f1cdffbad381683ac88cf5feec3ad Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Tue, 18 Dec 2018 04:35:09 +0100 Subject: [PATCH 04/48] [geometries] Add missing includes. --- .../geometries/adapted/boost_polygon/ring_proxy.hpp | 11 +++++++++-- .../boost/geometry/geometries/adapted/boost_tuple.hpp | 6 ++++++ include/boost/geometry/geometries/variant.hpp | 9 ++++++++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/include/boost/geometry/geometries/adapted/boost_polygon/ring_proxy.hpp b/include/boost/geometry/geometries/adapted/boost_polygon/ring_proxy.hpp index 84f72aadc..ca54ec6af 100644 --- a/include/boost/geometry/geometries/adapted/boost_polygon/ring_proxy.hpp +++ b/include/boost/geometry/geometries/adapted/boost_polygon/ring_proxy.hpp @@ -2,6 +2,11 @@ // Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018, 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) @@ -14,9 +19,11 @@ // pair{begin_points, end_points} -> ring_proxy #include -#include - +#include +#include +#include +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/geometries/adapted/boost_tuple.hpp b/include/boost/geometry/geometries/adapted/boost_tuple.hpp index 58065fe9a..88d1af37b 100644 --- a/include/boost/geometry/geometries/adapted/boost_tuple.hpp +++ b/include/boost/geometry/geometries/adapted/boost_tuple.hpp @@ -4,6 +4,11 @@ // Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018, Oracle and/or its affiliates. + +// 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. @@ -19,6 +24,7 @@ #include +#include #include #include #include diff --git a/include/boost/geometry/geometries/variant.hpp b/include/boost/geometry/geometries/variant.hpp index 881eab9c8..6b19c113d 100644 --- a/include/boost/geometry/geometries/variant.hpp +++ b/include/boost/geometry/geometries/variant.hpp @@ -4,6 +4,11 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018, Oracle and/or its affiliates. + +// 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. @@ -15,8 +20,10 @@ #define BOOST_GEOMETRY_GEOMETRIES_VARIANT_GEOMETRY_HPP -#include #include +#include + +#include namespace boost { namespace geometry { From 2891ee3d62fbbc1eed0eac0f66cc9e5cf740b77f Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Tue, 18 Dec 2018 04:36:05 +0100 Subject: [PATCH 05/48] [iterators][policies][util][views] Add missing includes. --- .../iterators/detail/point_iterator/iterator_type.hpp | 4 +++- .../geometry/policies/robustness/rescale_policy.hpp | 5 ++++- include/boost/geometry/util/calculation_type.hpp | 6 ++++++ include/boost/geometry/util/combine_if.hpp | 11 ++++++----- .../views/detail/boundary_view/implementation.hpp | 5 +++-- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/include/boost/geometry/iterators/detail/point_iterator/iterator_type.hpp b/include/boost/geometry/iterators/detail/point_iterator/iterator_type.hpp index a7805b127..92c0c093c 100644 --- a/include/boost/geometry/iterators/detail/point_iterator/iterator_type.hpp +++ b/include/boost/geometry/iterators/detail/point_iterator/iterator_type.hpp @@ -1,8 +1,9 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2014, Oracle and/or its affiliates. +// Copyright (c) 2014, 2018, 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 @@ -12,6 +13,7 @@ #include +#include #include #include diff --git a/include/boost/geometry/policies/robustness/rescale_policy.hpp b/include/boost/geometry/policies/robustness/rescale_policy.hpp index b92f6e1ec..e4a909056 100644 --- a/include/boost/geometry/policies/robustness/rescale_policy.hpp +++ b/include/boost/geometry/policies/robustness/rescale_policy.hpp @@ -5,7 +5,8 @@ // Copyright (c) 2014-2015 Mateusz Loskot, London, UK. // Copyright (c) 2014-2015 Adam Wulkiewicz, Lodz, Poland. -// Copyright (c) 2015, Oracle and/or its affiliates. +// This file was modified by Oracle on 2015, 2018. +// Modifications copyright (c) 2015-2018, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -18,6 +19,8 @@ #include +#include + #include #include #include diff --git a/include/boost/geometry/util/calculation_type.hpp b/include/boost/geometry/util/calculation_type.hpp index 18eac4fbb..cff4b9421 100644 --- a/include/boost/geometry/util/calculation_type.hpp +++ b/include/boost/geometry/util/calculation_type.hpp @@ -4,6 +4,11 @@ // Copyright (c) 2012 Bruno Lalande, Paris, France. // Copyright (c) 2012 Mateusz Loskot, London, UK. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018, 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) @@ -13,6 +18,7 @@ #include #include +#include #include #include #include diff --git a/include/boost/geometry/util/combine_if.hpp b/include/boost/geometry/util/combine_if.hpp index 5d94c3446..11050e4e5 100644 --- a/include/boost/geometry/util/combine_if.hpp +++ b/include/boost/geometry/util/combine_if.hpp @@ -2,10 +2,11 @@ // Copyright (c) 2014-2015 Samuel Debionne, Grenoble, France. -// This file was modified by Oracle on 2015. -// Modifications copyright (c) 2015, Oracle and/or its affiliates. +// This file was modified by Oracle on 2015, 2018. +// Modifications copyright (c) 2015-2018, 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 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -17,13 +18,13 @@ #ifndef BOOST_GEOMETRY_UTIL_COMBINE_IF_HPP #define BOOST_GEOMETRY_UTIL_COMBINE_IF_HPP +#include #include #include -#include -#include #include +#include #include - +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/views/detail/boundary_view/implementation.hpp b/include/boost/geometry/views/detail/boundary_view/implementation.hpp index 971a6fe00..fb5c119fb 100644 --- a/include/boost/geometry/views/detail/boundary_view/implementation.hpp +++ b/include/boost/geometry/views/detail/boundary_view/implementation.hpp @@ -1,8 +1,9 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2015, Oracle and/or its affiliates. +// Copyright (c) 2015, 2018, 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 @@ -23,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -40,6 +40,7 @@ #include #include +#include #include From 1487a86a0e7d09c1377b52aaedcd6b1d28b60d52 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Tue, 18 Dec 2018 04:36:19 +0100 Subject: [PATCH 06/48] [srs] Add missing includes. --- include/boost/geometry/srs/projections/dpar.hpp | 7 ++++++- .../boost/geometry/srs/projections/impl/pj_gridlist.hpp | 1 + .../boost/geometry/srs/projections/impl/pj_transform.hpp | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/boost/geometry/srs/projections/dpar.hpp b/include/boost/geometry/srs/projections/dpar.hpp index 641a4fc6e..0cfb2e210 100644 --- a/include/boost/geometry/srs/projections/dpar.hpp +++ b/include/boost/geometry/srs/projections/dpar.hpp @@ -22,11 +22,16 @@ #include #include +#include +#include +#include +#include #include -#include #include +#include #include #include +#include #include #include diff --git a/include/boost/geometry/srs/projections/impl/pj_gridlist.hpp b/include/boost/geometry/srs/projections/impl/pj_gridlist.hpp index 18a215b50..0c5a24047 100644 --- a/include/boost/geometry/srs/projections/impl/pj_gridlist.hpp +++ b/include/boost/geometry/srs/projections/impl/pj_gridlist.hpp @@ -43,6 +43,7 @@ #include #include +#include namespace boost { namespace geometry { namespace projections diff --git a/include/boost/geometry/srs/projections/impl/pj_transform.hpp b/include/boost/geometry/srs/projections/impl/pj_transform.hpp index 1be984556..02291649e 100644 --- a/include/boost/geometry/srs/projections/impl/pj_transform.hpp +++ b/include/boost/geometry/srs/projections/impl/pj_transform.hpp @@ -41,6 +41,7 @@ #include +#include #include #include From 321f01c5dd1fed56717028a707ae0cc4b459cc46 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Tue, 18 Dec 2018 04:36:45 +0100 Subject: [PATCH 07/48] [strategies] Add missing includes. --- include/boost/geometry/strategies/cartesian/azimuth.hpp | 4 +++- .../geometry/strategies/cartesian/distance_segment_box.hpp | 3 +++ include/boost/geometry/strategies/geographic/area.hpp | 1 + .../strategies/geographic/distance_cross_track_box_box.hpp | 2 ++ include/boost/geometry/strategies/side.hpp | 7 +++++++ .../geometry/strategies/spherical/distance_segment_box.hpp | 1 + 6 files changed, 17 insertions(+), 1 deletion(-) diff --git a/include/boost/geometry/strategies/cartesian/azimuth.hpp b/include/boost/geometry/strategies/cartesian/azimuth.hpp index 62f804e8f..2ff16e945 100644 --- a/include/boost/geometry/strategies/cartesian/azimuth.hpp +++ b/include/boost/geometry/strategies/cartesian/azimuth.hpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2016-2017 Oracle and/or its affiliates. +// Copyright (c) 2016-2018 Oracle and/or its affiliates. // Contributed and/or modified by Vissarion Fisikopoulos, on behalf of Oracle // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -13,6 +13,8 @@ #include +#include + namespace boost { namespace geometry { diff --git a/include/boost/geometry/strategies/cartesian/distance_segment_box.hpp b/include/boost/geometry/strategies/cartesian/distance_segment_box.hpp index 80f5094a5..1fe3498b0 100644 --- a/include/boost/geometry/strategies/cartesian/distance_segment_box.hpp +++ b/include/boost/geometry/strategies/cartesian/distance_segment_box.hpp @@ -2,6 +2,7 @@ // Copyright (c) 2018 Oracle and/or its affiliates. // Contributed and/or modified by Vissarion Fisikopoulos, on behalf of Oracle +// 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 @@ -12,6 +13,8 @@ #include +#include + namespace boost { namespace geometry { diff --git a/include/boost/geometry/strategies/geographic/area.hpp b/include/boost/geometry/strategies/geographic/area.hpp index ac7d933ce..d40a30cf2 100644 --- a/include/boost/geometry/strategies/geographic/area.hpp +++ b/include/boost/geometry/strategies/geographic/area.hpp @@ -20,6 +20,7 @@ #include #include +#include #include 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 8e48fbf19..b32df6587 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 @@ -25,6 +25,8 @@ #include #include +#include +#include #include #include diff --git a/include/boost/geometry/strategies/side.hpp b/include/boost/geometry/strategies/side.hpp index 9aaa2bddd..ea8e5fd22 100644 --- a/include/boost/geometry/strategies/side.hpp +++ b/include/boost/geometry/strategies/side.hpp @@ -4,6 +4,11 @@ // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018, Oracle and/or its affiliates. + +// 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. @@ -15,6 +20,8 @@ #define BOOST_GEOMETRY_STRATEGIES_SIDE_HPP +#include + #include diff --git a/include/boost/geometry/strategies/spherical/distance_segment_box.hpp b/include/boost/geometry/strategies/spherical/distance_segment_box.hpp index 25adbeb46..49d032b18 100644 --- a/include/boost/geometry/strategies/spherical/distance_segment_box.hpp +++ b/include/boost/geometry/strategies/spherical/distance_segment_box.hpp @@ -16,6 +16,7 @@ #include #include #include +#include #include // spherical namespace boost { namespace geometry From bb6421a1b46dd5e68a386651214f427b0ea1ee14 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Tue, 18 Dec 2018 04:37:29 +0100 Subject: [PATCH 08/48] [extensions] Add missing includes, move traits, fix namespaces, hide debugging code behind #ifdefs etc. --- .../extensions/algebra/algorithms/detail.hpp | 33 +++++++++----- .../algebra/algorithms/rotation.hpp | 5 +++ .../algorithms/transform_geometrically.hpp | 9 +++- .../algebra/algorithms/translation.hpp | 8 +++- .../algebra/core/coordinate_dimension.hpp | 30 ++++++++++++- .../algebra/geometries/concepts/check.hpp | 11 +++++ .../geometries/concepts/matrix_concept.hpp | 18 +++++--- .../concepts/quaternion_concept.hpp | 6 ++- .../concepts/rotation_matrix_concept.hpp | 16 +++++-- .../concepts/rotation_quaternion_concept.hpp | 12 +++++- .../geometries/concepts/vector_concept.hpp | 11 ++++- .../extensions/algebra/geometries/matrix.hpp | 17 +++----- .../algebra/geometries/rotation_matrix.hpp | 7 +++ .../geometries/rotation_quaternion.hpp | 7 +++ .../extensions/algorithms/connect.hpp | 19 +++++++- .../geometry/extensions/algorithms/parse.hpp | 43 ++++++++++++------- .../extensions/algorithms/remove_marked.hpp | 5 +++ .../strategies/cartesian/distance_info.hpp | 6 +++ 18 files changed, 208 insertions(+), 55 deletions(-) diff --git a/include/boost/geometry/extensions/algebra/algorithms/detail.hpp b/include/boost/geometry/extensions/algebra/algorithms/detail.hpp index 63c5bd9fa..41d08b741 100644 --- a/include/boost/geometry/extensions/algebra/algorithms/detail.hpp +++ b/include/boost/geometry/extensions/algebra/algorithms/detail.hpp @@ -2,6 +2,10 @@ // Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018 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) @@ -12,7 +16,14 @@ // TODO - for multiplication of coordinates // if coordinate_type is_integral - use double as the result type +#include +#include +#include + #include +#include + +#include namespace boost { namespace geometry { @@ -37,8 +48,8 @@ struct dot_impl BOOST_STATIC_ASSERT(0 < N); typedef typename geometry::select_most_precise< - typename traits::coordinate_type::type, - typename traits::coordinate_type::type + typename geometry::coordinate_type::type, + typename geometry::coordinate_type::type >::type coordinate_type; static inline coordinate_type apply(S1 const& s1, S2 const& s2) @@ -51,8 +62,8 @@ template struct dot_impl { typedef typename geometry::select_most_precise< - typename traits::coordinate_type::type, - typename traits::coordinate_type::type + typename geometry::coordinate_type::type, + typename geometry::coordinate_type::type >::type coordinate_type; static inline coordinate_type apply(S1 const& s1, S2 const& s2) @@ -64,8 +75,8 @@ struct dot_impl template inline static typename geometry::select_most_precise< - typename traits::coordinate_type::type, - typename traits::coordinate_type::type + typename geometry::coordinate_type::type, + typename geometry::coordinate_type::type >::type dot(S1 const& s1, S2 const& s2) { @@ -143,7 +154,7 @@ struct matrix_mul_row_impl { BOOST_STATIC_ASSERT(0 < N); - static const std::size_t dimension = traits::dimension::value; + static const std::size_t dimension = geometry::dimension::value; static inline typename traits::coordinate_type::type @@ -156,7 +167,7 @@ struct matrix_mul_row_impl template struct matrix_mul_row_impl { - static const std::size_t dimension = traits::dimension::value; + static const std::size_t dimension = geometry::dimension::value; static inline typename traits::coordinate_type::type @@ -187,7 +198,7 @@ struct matrix_mul_impl template inline static void matrix_rotate(M const& m, V const& v, VD & vd) { - static const std::size_t dimension = traits::dimension::value; + static const std::size_t dimension = geometry::dimension::value; matrix_mul_impl::apply(m, v, vd); } @@ -200,8 +211,8 @@ inline static void quaternion_rotate(V & v, Q const& r) // TODO - choose more precise type? typedef typename geometry::select_most_precise< - typename traits::coordinate_type::type, - typename traits::coordinate_type::type + typename geometry::coordinate_type::type, + typename geometry::coordinate_type::type >::type T; // Hamilton product T=Q*V diff --git a/include/boost/geometry/extensions/algebra/algorithms/rotation.hpp b/include/boost/geometry/extensions/algebra/algorithms/rotation.hpp index dc9e2db2f..e4d83cc78 100644 --- a/include/boost/geometry/extensions/algebra/algorithms/rotation.hpp +++ b/include/boost/geometry/extensions/algebra/algorithms/rotation.hpp @@ -2,6 +2,10 @@ // Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018 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) @@ -14,6 +18,7 @@ #include #include +#include // TODO - for multiplication of coordinates // if coordinate_type is_integral - use double as the result type diff --git a/include/boost/geometry/extensions/algebra/algorithms/transform_geometrically.hpp b/include/boost/geometry/extensions/algebra/algorithms/transform_geometrically.hpp index a5fdb86af..a51275dea 100644 --- a/include/boost/geometry/extensions/algebra/algorithms/transform_geometrically.hpp +++ b/include/boost/geometry/extensions/algebra/algorithms/transform_geometrically.hpp @@ -2,6 +2,10 @@ // Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018 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) @@ -9,10 +13,13 @@ #ifndef BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_ALGORITHMS_TRANSFORM_HPP #define BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_ALGORITHMS_TRANSFORM_HPP +#include +#include +#include #include #include #include -#include +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/extensions/algebra/algorithms/translation.hpp b/include/boost/geometry/extensions/algebra/algorithms/translation.hpp index 282616b52..40f3b35f1 100644 --- a/include/boost/geometry/extensions/algebra/algorithms/translation.hpp +++ b/include/boost/geometry/extensions/algebra/algorithms/translation.hpp @@ -2,6 +2,10 @@ // Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018 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) @@ -9,11 +13,11 @@ #ifndef BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_ALGORITHMS_TRANSLATION_HPP #define BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_ALGORITHMS_TRANSLATION_HPP +#include #include - +#include //#include //#include -#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/extensions/algebra/core/coordinate_dimension.hpp b/include/boost/geometry/extensions/algebra/core/coordinate_dimension.hpp index ff1f3c96e..dff17bc6f 100644 --- a/include/boost/geometry/extensions/algebra/core/coordinate_dimension.hpp +++ b/include/boost/geometry/extensions/algebra/core/coordinate_dimension.hpp @@ -5,6 +5,10 @@ // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. // Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018 Oracle and/or its affiliates. +// 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. @@ -15,12 +19,28 @@ #ifndef BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_CORE_COORDINATE_DIMENSION_HPP #define BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_CORE_COORDINATE_DIMENSION_HPP -#include +#include #include +#include + +#include + namespace boost { namespace geometry { +namespace traits { + +template +struct indexed_dimension +{ + BOOST_MPL_ASSERT_MSG(false, + NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_OR_INDEX, + (Geometry, boost::integral_constant)); +}; + +} // namespace traits + #ifndef DOXYGEN_NO_DISPATCH namespace core_dispatch { @@ -34,6 +54,14 @@ struct dimension : traits::dimension::type> {}; +template +struct indexed_dimension +{ + BOOST_MPL_ASSERT_MSG(false, + NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_OR_INDEX, + (G, boost::integral_constant)); +}; + template struct indexed_dimension : traits::indexed_dimension::type, Index> diff --git a/include/boost/geometry/extensions/algebra/geometries/concepts/check.hpp b/include/boost/geometry/extensions/algebra/geometries/concepts/check.hpp index df0bcb2a6..c8952aea1 100644 --- a/include/boost/geometry/extensions/algebra/geometries/concepts/check.hpp +++ b/include/boost/geometry/extensions/algebra/geometries/concepts/check.hpp @@ -5,6 +5,10 @@ // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. // Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018 Oracle and/or its affiliates. +// 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. @@ -17,6 +21,13 @@ #define BOOST_GEOMETRY_EXTENSIONS_ALGEBRA_GEOMETRIES_CONCEPTS_CHECK_HPP +#include +#include +#include +#include +#include +#include + #include diff --git a/include/boost/geometry/extensions/algebra/geometries/concepts/matrix_concept.hpp b/include/boost/geometry/extensions/algebra/geometries/concepts/matrix_concept.hpp index 8e85639da..1422266a9 100644 --- a/include/boost/geometry/extensions/algebra/geometries/concepts/matrix_concept.hpp +++ b/include/boost/geometry/extensions/algebra/geometries/concepts/matrix_concept.hpp @@ -5,6 +5,10 @@ // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. // Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018 Oracle and/or its affiliates. +// 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. @@ -17,8 +21,12 @@ #include #include -#include -#include +#include +#include +#include +#include +#include +#include namespace boost { namespace geometry { namespace concepts { @@ -54,7 +62,7 @@ class Matrix { static void apply() { - dimension_checker_row; + dimension_checker_row::apply(); dimension_checker::apply(); } }; @@ -95,7 +103,7 @@ class ConstMatrix static void apply() { const G* g = 0; - ctype coord(geometry::get(*g)); + typename coordinate_type::type coord(geometry::get(*g)); boost::ignore_unused(coord); dimension_checker_row::apply(); } @@ -112,7 +120,7 @@ class ConstMatrix { static void apply() { - dimension_checker_row; + dimension_checker_row::apply(); dimension_checker::apply(); } }; diff --git a/include/boost/geometry/extensions/algebra/geometries/concepts/quaternion_concept.hpp b/include/boost/geometry/extensions/algebra/geometries/concepts/quaternion_concept.hpp index 010c74632..5bb32c0b3 100644 --- a/include/boost/geometry/extensions/algebra/geometries/concepts/quaternion_concept.hpp +++ b/include/boost/geometry/extensions/algebra/geometries/concepts/quaternion_concept.hpp @@ -5,6 +5,10 @@ // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. // Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018 Oracle and/or its affiliates. +// 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. @@ -78,7 +82,7 @@ class ConstQuaternion static void apply() { const G* g = 0; - ctype coord(geometry::get(*g)); + typename coordinate_type::type coord(geometry::get(*g)); boost::ignore_unused(coord); dimension_checker::apply(); } diff --git a/include/boost/geometry/extensions/algebra/geometries/concepts/rotation_matrix_concept.hpp b/include/boost/geometry/extensions/algebra/geometries/concepts/rotation_matrix_concept.hpp index a8df8ad22..e8371e864 100644 --- a/include/boost/geometry/extensions/algebra/geometries/concepts/rotation_matrix_concept.hpp +++ b/include/boost/geometry/extensions/algebra/geometries/concepts/rotation_matrix_concept.hpp @@ -5,6 +5,10 @@ // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. // Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018 Oracle and/or its affiliates. +// 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. @@ -17,8 +21,12 @@ #include #include -#include -#include +#include +#include +#include +#include +#include +#include namespace boost { namespace geometry { namespace concepts { @@ -54,7 +62,7 @@ class RotationMatrix { static void apply() { - dimension_checker_row; + dimension_checker_row::apply(); dimension_checker::apply(); } }; @@ -112,7 +120,7 @@ class ConstRotationMatrix { static void apply() { - dimension_checker_row; + dimension_checker_row::apply(); dimension_checker::apply(); } }; diff --git a/include/boost/geometry/extensions/algebra/geometries/concepts/rotation_quaternion_concept.hpp b/include/boost/geometry/extensions/algebra/geometries/concepts/rotation_quaternion_concept.hpp index 9432153b6..b7b273e9a 100644 --- a/include/boost/geometry/extensions/algebra/geometries/concepts/rotation_quaternion_concept.hpp +++ b/include/boost/geometry/extensions/algebra/geometries/concepts/rotation_quaternion_concept.hpp @@ -5,6 +5,10 @@ // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. // Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018 Oracle and/or its affiliates. +// 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. @@ -17,8 +21,12 @@ #include #include -#include -#include +#include +#include +#include +#include +#include +#include namespace boost { namespace geometry { namespace concepts { diff --git a/include/boost/geometry/extensions/algebra/geometries/concepts/vector_concept.hpp b/include/boost/geometry/extensions/algebra/geometries/concepts/vector_concept.hpp index 795993ae0..76e7e198d 100644 --- a/include/boost/geometry/extensions/algebra/geometries/concepts/vector_concept.hpp +++ b/include/boost/geometry/extensions/algebra/geometries/concepts/vector_concept.hpp @@ -5,6 +5,10 @@ // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. // Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018 Oracle and/or its affiliates. +// 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. @@ -17,8 +21,11 @@ #include #include -#include -#include +#include +#include +#include +#include +#include namespace boost { namespace geometry { namespace concepts { diff --git a/include/boost/geometry/extensions/algebra/geometries/matrix.hpp b/include/boost/geometry/extensions/algebra/geometries/matrix.hpp index 1e5356bba..c51a3fc17 100644 --- a/include/boost/geometry/extensions/algebra/geometries/matrix.hpp +++ b/include/boost/geometry/extensions/algebra/geometries/matrix.hpp @@ -5,6 +5,10 @@ // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. // Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018 Oracle and/or its affiliates. +// 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. @@ -17,6 +21,8 @@ #include +#include +#include #include #include @@ -88,15 +94,6 @@ struct coordinate_type > // typedef cs::cartesian type; //}; -// TODO - move this class to traits.hpp -template -struct indexed_dimension -{ - BOOST_MPL_ASSERT_MSG(false, - NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_OR_INDEX, - (Geometry, boost::integral_constant)); -}; - template struct indexed_dimension, 0> : boost::integral_constant @@ -108,7 +105,7 @@ struct indexed_dimension, 1> {}; template -struct indexed_access, I, J> +struct indexed_access, I, J> { typedef CoordinateType coordinate_type; diff --git a/include/boost/geometry/extensions/algebra/geometries/rotation_matrix.hpp b/include/boost/geometry/extensions/algebra/geometries/rotation_matrix.hpp index be426a0ac..45235baf1 100644 --- a/include/boost/geometry/extensions/algebra/geometries/rotation_matrix.hpp +++ b/include/boost/geometry/extensions/algebra/geometries/rotation_matrix.hpp @@ -5,6 +5,10 @@ // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. // Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018 Oracle and/or its affiliates. +// 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. @@ -17,6 +21,9 @@ #include +#include + +#include #include #include diff --git a/include/boost/geometry/extensions/algebra/geometries/rotation_quaternion.hpp b/include/boost/geometry/extensions/algebra/geometries/rotation_quaternion.hpp index 05482858a..88df4146f 100644 --- a/include/boost/geometry/extensions/algebra/geometries/rotation_quaternion.hpp +++ b/include/boost/geometry/extensions/algebra/geometries/rotation_quaternion.hpp @@ -5,6 +5,10 @@ // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. // Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018 Oracle and/or its affiliates. +// 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. @@ -17,6 +21,9 @@ #include +#include + +#include #include #include diff --git a/include/boost/geometry/extensions/algorithms/connect.hpp b/include/boost/geometry/extensions/algorithms/connect.hpp index a969ef4c7..b7a598ae9 100644 --- a/include/boost/geometry/extensions/algorithms/connect.hpp +++ b/include/boost/geometry/extensions/algorithms/connect.hpp @@ -2,6 +2,10 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018 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) @@ -11,6 +15,9 @@ #include +#ifdef BOOST_GEOMETRY_DEBUG_CONNECT +#include +#endif #include @@ -144,7 +151,9 @@ struct map_policy // Alternatively, we might look for the closest points if (boost::size(range) == 0) { +#ifdef BOOST_GEOMETRY_DEBUG_CONNECT std::cout << "nothing found" << std::endl; +#endif return closest; } @@ -318,7 +327,9 @@ struct fuzzy_policy // Alternatively, we might look for the closest points if (boost::size(range) == 0) { +#ifdef BOOST_GEOMETRY_DEBUG_CONNECT std::cout << "nothing found" << std::endl; +#endif return closest; } @@ -339,7 +350,9 @@ struct fuzzy_policy closest = *it; min_dist = d; +#ifdef BOOST_GEOMETRY_DEBUG_CONNECT //std::cout << "TO " << geometry::wkt(p2) << std::endl; +#endif } } } @@ -347,9 +360,12 @@ struct fuzzy_policy } }; + template inline void debug(Policy const& policy) { +#ifdef BOOST_GEOMETRY_DEBUG_CONNECT + std::cout << "MAP" << std::endl; typedef typename Policy::map_type::const_iterator iterator; typedef typename Policy::point_type point_type; @@ -369,8 +385,9 @@ inline void debug(Policy const& policy) } std::cout << std::endl; } -} +#endif // BOOST_GEOMETRY_DEBUG_CONNECT +} diff --git a/include/boost/geometry/extensions/algorithms/parse.hpp b/include/boost/geometry/extensions/algorithms/parse.hpp index 4edba604d..d9354435d 100644 --- a/include/boost/geometry/extensions/algorithms/parse.hpp +++ b/include/boost/geometry/extensions/algorithms/parse.hpp @@ -4,6 +4,10 @@ // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018 Oracle and/or its affiliates. +// 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. @@ -16,13 +20,13 @@ #include - +#include #include #include -#include -#include +#include +//#include namespace boost { namespace geometry @@ -51,30 +55,39 @@ struct parsing static inline void parse(Point& point, std::string const& c1, std::string const& c2, S const& strategy) { assert_dimension(); - dms_result r1 = strategy(c1.c_str()); - dms_result r2 = strategy(c2.c_str()); + + typedef typename coordinate_type::type coord_t; + typedef boost::geometry::projections::detail::dms_result dms_result_t; + dms_result_t r1 = strategy(c1.c_str()); + dms_result_t r2 = strategy(c2.c_str()); if (0 == r1.axis()) - set<0>(point, r1); + set<0>(point, r1.angle()); else - set<1>(point, r1); + set<1>(point, r1.angle()); if (0 == r2.axis()) - set<0>(point, r2); + set<0>(point, r2.angle()); else - set<1>(point, r2); + set<1>(point, r2.angle()); } static inline void parse(Point& point, std::string const& c1, std::string const& c2) { + typedef typename coordinate_type::type coord_t; // strategy-parser corresponding to degree/radian - typename strategy_parse - < - typename cs_tag::type, - typename coordinate_system::type - >::type strategy; + //typename strategy_parse + // < + // typename cs_tag::type, + // typename coordinate_system::type + // >::type strategy; + typedef boost::geometry::projections::detail::dms_parser + < + coord_t/*, + as_radian*/ + > dms_parser_t; - parse(point, c1, c2, strategy); + parse(point, c1, c2, dms_parser_t()); } }; diff --git a/include/boost/geometry/extensions/algorithms/remove_marked.hpp b/include/boost/geometry/extensions/algorithms/remove_marked.hpp index 9a91e4d82..3dffe6bc0 100644 --- a/include/boost/geometry/extensions/algorithms/remove_marked.hpp +++ b/include/boost/geometry/extensions/algorithms/remove_marked.hpp @@ -2,6 +2,10 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018 Oracle and/or its affiliates. +// 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. @@ -16,6 +20,7 @@ // as mark_spikes is now replaced by remove_spikes #include +#include #include #include diff --git a/include/boost/geometry/extensions/strategies/cartesian/distance_info.hpp b/include/boost/geometry/extensions/strategies/cartesian/distance_info.hpp index 0c99e92b7..14766e9b6 100644 --- a/include/boost/geometry/extensions/strategies/cartesian/distance_info.hpp +++ b/include/boost/geometry/extensions/strategies/cartesian/distance_info.hpp @@ -5,6 +5,10 @@ // Copyright (c) 2009-2013 Mateusz Loskot, London, UK. // Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018 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) @@ -22,6 +26,8 @@ #include #include +#include + #include #include #include From 73c1eed9477cec968b18e78e7611fda59ea46909 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Tue, 18 Dec 2018 20:29:41 +0100 Subject: [PATCH 09/48] [algorithm][formulas][geometries][util] Add missing includes. --- .../detail/envelope/range_of_boxes.hpp | 9 ++++++--- .../boost/geometry/formulas/area_formulas.hpp | 1 + .../boost/geometry/formulas/eccentricity_sqr.hpp | 6 ++++-- .../boost/geometry/formulas/karney_direct.hpp | 16 +++++++++++----- .../boost/geometry/formulas/meridian_direct.hpp | 10 ++++++---- .../boost/geometry/formulas/quarter_meridian.hpp | 7 ++++++- .../geometry/geometries/adapted/std_array.hpp | 15 +++++++++++++++ .../geometries/concepts/multi_point_concept.hpp | 1 + .../util/is_inverse_spheroidal_coordinates.hpp | 5 +++++ 9 files changed, 55 insertions(+), 15 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/envelope/range_of_boxes.hpp b/include/boost/geometry/algorithms/detail/envelope/range_of_boxes.hpp index 111441036..28e76c445 100644 --- a/include/boost/geometry/algorithms/detail/envelope/range_of_boxes.hpp +++ b/include/boost/geometry/algorithms/detail/envelope/range_of_boxes.hpp @@ -20,17 +20,20 @@ #include +#include +#include +#include + #include #include #include #include #include +#include #include -#include -#include -#include +#include namespace boost { namespace geometry diff --git a/include/boost/geometry/formulas/area_formulas.hpp b/include/boost/geometry/formulas/area_formulas.hpp index 66d90a725..c670f831a 100644 --- a/include/boost/geometry/formulas/area_formulas.hpp +++ b/include/boost/geometry/formulas/area_formulas.hpp @@ -12,6 +12,7 @@ #ifndef BOOST_GEOMETRY_FORMULAS_AREA_FORMULAS_HPP #define BOOST_GEOMETRY_FORMULAS_AREA_FORMULAS_HPP +#include #include #include #include diff --git a/include/boost/geometry/formulas/eccentricity_sqr.hpp b/include/boost/geometry/formulas/eccentricity_sqr.hpp index 01a9beacb..1608a8570 100644 --- a/include/boost/geometry/formulas/eccentricity_sqr.hpp +++ b/include/boost/geometry/formulas/eccentricity_sqr.hpp @@ -1,6 +1,6 @@ // Boost.Geometry -// Copyright (c) 2016 Oracle and/or its affiliates. +// Copyright (c) 2016, 2018 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -11,11 +11,13 @@ #ifndef BOOST_GEOMETRY_FORMULAS_ECCENCRICITY_SQR_HPP #define BOOST_GEOMETRY_FORMULAS_ECCENCRICITY_SQR_HPP +#include + #include #include #include -#include +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/formulas/karney_direct.hpp b/include/boost/geometry/formulas/karney_direct.hpp index 1e6add7d4..404068400 100644 --- a/include/boost/geometry/formulas/karney_direct.hpp +++ b/include/boost/geometry/formulas/karney_direct.hpp @@ -2,7 +2,12 @@ // Copyright (c) 2018 Adeel Ahmad, Islamabad, Pakistan. -// Contributed and/or modified by Adeel Ahmad, as part of Google Summer of Code 2018 program. +// Contributed and/or modified by Adeel Ahmad, +// as part of Google Summer of Code 2018 program. + +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018 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 @@ -30,13 +35,14 @@ #include #include -#include -#include -#include - #include #include +#include +#include +#include +#include + namespace boost { namespace geometry { namespace formula { diff --git a/include/boost/geometry/formulas/meridian_direct.hpp b/include/boost/geometry/formulas/meridian_direct.hpp index e55b35e88..f8e73f57c 100644 --- a/include/boost/geometry/formulas/meridian_direct.hpp +++ b/include/boost/geometry/formulas/meridian_direct.hpp @@ -3,6 +3,7 @@ // Copyright (c) 2018 Oracle and/or its affiliates. // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle +// 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 @@ -15,14 +16,15 @@ #include -#include -#include - -#include +#include #include +#include #include #include +#include +#include + namespace boost { namespace geometry { namespace formula { diff --git a/include/boost/geometry/formulas/quarter_meridian.hpp b/include/boost/geometry/formulas/quarter_meridian.hpp index 2f93f53cf..5aa10cc87 100644 --- a/include/boost/geometry/formulas/quarter_meridian.hpp +++ b/include/boost/geometry/formulas/quarter_meridian.hpp @@ -3,6 +3,7 @@ // Copyright (c) 2018 Oracle and/or its affiliates. // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle +// 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 @@ -11,11 +12,15 @@ #ifndef BOOST_GEOMETRY_FORMULAS_QUARTER_MERIDIAN_HPP #define BOOST_GEOMETRY_FORMULAS_QUARTER_MERIDIAN_HPP +#include + #include #include #include -#include +#include + +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/geometries/adapted/std_array.hpp b/include/boost/geometry/geometries/adapted/std_array.hpp index 4f5cbe0d3..ede9fe997 100644 --- a/include/boost/geometry/geometries/adapted/std_array.hpp +++ b/include/boost/geometry/geometries/adapted/std_array.hpp @@ -12,6 +12,12 @@ #define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_STD_ARRAY_HPP +#include + + +#ifndef BOOST_NO_CXX11_HDR_ARRAY + + #define BOOST_GEOMETRY_ADAPTED_STD_ARRAY_TAG_DEFINED @@ -111,5 +117,14 @@ struct access, Dimension> }}} +#else + + +#warning "This file requires compiler and library support for the ISO C++ 2011 standard." + + +#endif // BOOST_NO_CXX11_HDR_ARRAY + + #endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_STD_ARRAY_HPP diff --git a/include/boost/geometry/geometries/concepts/multi_point_concept.hpp b/include/boost/geometry/geometries/concepts/multi_point_concept.hpp index 9e205f163..9dffdb1c4 100644 --- a/include/boost/geometry/geometries/concepts/multi_point_concept.hpp +++ b/include/boost/geometry/geometries/concepts/multi_point_concept.hpp @@ -20,6 +20,7 @@ #include #include +#include #include diff --git a/include/boost/geometry/util/is_inverse_spheroidal_coordinates.hpp b/include/boost/geometry/util/is_inverse_spheroidal_coordinates.hpp index d67251254..59746653a 100644 --- a/include/boost/geometry/util/is_inverse_spheroidal_coordinates.hpp +++ b/include/boost/geometry/util/is_inverse_spheroidal_coordinates.hpp @@ -3,6 +3,7 @@ // Copyright (c) 2018 Oracle and/or its affiliates. // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle +// 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 @@ -11,6 +12,10 @@ #ifndef BOOST_GEOMETRY_UTIL_IS_INVERSE_SPHEROIDAL_COORDINATES_HPP #define BOOST_GEOMETRY_UTIL_IS_INVERSE_SPHEROIDAL_COORDINATES_HPP +#include +#include +#include + #include namespace boost { namespace geometry From 2d4bc1e21bc9c4bbfa7fc6291b437ae41db102ef Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Tue, 18 Dec 2018 20:29:58 +0100 Subject: [PATCH 10/48] [strategies] Add missing includes. --- .../strategies/agnostic/hull_graham_andrew.hpp | 17 ++++++++--------- .../agnostic/point_in_box_by_side.hpp | 1 + .../geometry/strategies/cartesian/area.hpp | 5 +++-- .../strategies/cartesian/buffer_end_flat.hpp | 12 +++++++----- .../cartesian/buffer_point_circle.hpp | 12 ++++++++---- .../cartesian/buffer_point_square.hpp | 14 ++++++++++---- .../cartesian/centroid_bashein_detmer.hpp | 5 +++-- .../geometry/strategies/cartesian/densify.hpp | 1 + .../strategies/cartesian/disjoint_box_box.hpp | 1 + .../cartesian/distance_pythagoras.hpp | 7 +++++++ .../cartesian/distance_pythagoras_box_box.hpp | 9 ++++++--- .../cartesian/distance_pythagoras_point_box.hpp | 8 ++++++-- .../point_in_poly_crossings_multiply.hpp | 6 ++++++ .../cartesian/point_in_poly_franklin.hpp | 6 ++++++ .../strategies/concepts/area_concept.hpp | 7 +++++++ .../strategies/concepts/distance_concept.hpp | 6 ++++-- .../strategies/concepts/within_concept.hpp | 3 +++ .../boost/geometry/strategies/convex_hull.hpp | 6 ++++++ .../geographic/distance_cross_track.hpp | 4 +++- .../geometry/strategies/spherical/compare.hpp | 5 +++-- .../geometry/strategies/spherical/densify.hpp | 1 + .../spherical/distance_cross_track.hpp | 2 ++ 22 files changed, 102 insertions(+), 36 deletions(-) diff --git a/include/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp b/include/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp index 0cd0cdc4d..85d60ab85 100644 --- a/include/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp +++ b/include/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp @@ -2,8 +2,8 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2014. -// Modifications copyright (c) 2014 Oracle and/or its affiliates. +// This file was modified by Oracle on 2014, 2018. +// Modifications copyright (c) 2014, 2018 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -22,18 +22,17 @@ #include #include -#include +#include +#include +#include #include #include #include -#include - -#include - #include - -#include +#include +#include +#include #include diff --git a/include/boost/geometry/strategies/agnostic/point_in_box_by_side.hpp b/include/boost/geometry/strategies/agnostic/point_in_box_by_side.hpp index 80cad8523..f87656dbc 100644 --- a/include/boost/geometry/strategies/agnostic/point_in_box_by_side.hpp +++ b/include/boost/geometry/strategies/agnostic/point_in_box_by_side.hpp @@ -24,6 +24,7 @@ #include #include #include +#include #include diff --git a/include/boost/geometry/strategies/cartesian/area.hpp b/include/boost/geometry/strategies/cartesian/area.hpp index 27708424c..070e8f56b 100644 --- a/include/boost/geometry/strategies/cartesian/area.hpp +++ b/include/boost/geometry/strategies/cartesian/area.hpp @@ -5,8 +5,8 @@ // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. // 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, 2018. +// Modifications copyright (c) 2016-2018, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -24,6 +24,7 @@ #include //#include +#include #include #include #include diff --git a/include/boost/geometry/strategies/cartesian/buffer_end_flat.hpp b/include/boost/geometry/strategies/cartesian/buffer_end_flat.hpp index c01cf4df8..dfbc19e98 100644 --- a/include/boost/geometry/strategies/cartesian/buffer_end_flat.hpp +++ b/include/boost/geometry/strategies/cartesian/buffer_end_flat.hpp @@ -2,6 +2,11 @@ // Copyright (c) 2012-2014 Barend Gehrels, Amsterdam, the Netherlands. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018, 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) @@ -9,16 +14,13 @@ #ifndef BOOST_GEOMETRY_STRATEGIES_CARTESIAN_BUFFER_END_FLAT_HPP #define BOOST_GEOMETRY_STRATEGIES_CARTESIAN_BUFFER_END_FLAT_HPP -#include +#include +#include #include #include #include #include -#include - - - namespace boost { namespace geometry { diff --git a/include/boost/geometry/strategies/cartesian/buffer_point_circle.hpp b/include/boost/geometry/strategies/cartesian/buffer_point_circle.hpp index f28985717..f3f9c0ae1 100644 --- a/include/boost/geometry/strategies/cartesian/buffer_point_circle.hpp +++ b/include/boost/geometry/strategies/cartesian/buffer_point_circle.hpp @@ -2,10 +2,11 @@ // Copyright (c) 2012-2015 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2015. -// Modifications copyright (c) 2015, Oracle and/or its affiliates. +// This file was modified by Oracle on 2015, 2018. +// Modifications copyright (c) 2015, 2018, 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 // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -16,12 +17,15 @@ #include -#include +#include -#include +#include +#include #include +#include +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/strategies/cartesian/buffer_point_square.hpp b/include/boost/geometry/strategies/cartesian/buffer_point_square.hpp index 37a90c013..2ed17887b 100644 --- a/include/boost/geometry/strategies/cartesian/buffer_point_square.hpp +++ b/include/boost/geometry/strategies/cartesian/buffer_point_square.hpp @@ -1,5 +1,12 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) + // Copyright (c) 2012-2014 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018, 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) @@ -9,12 +16,11 @@ #include -#include - -#include +#include +#include #include - +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/strategies/cartesian/centroid_bashein_detmer.hpp b/include/boost/geometry/strategies/cartesian/centroid_bashein_detmer.hpp index d081173a3..edb2c8a71 100644 --- a/include/boost/geometry/strategies/cartesian/centroid_bashein_detmer.hpp +++ b/include/boost/geometry/strategies/cartesian/centroid_bashein_detmer.hpp @@ -4,8 +4,8 @@ // Copyright (c) 2008-2015 Bruno Lalande, Paris, France. // Copyright (c) 2009-2015 Mateusz Loskot, London, UK. -// This file was modified by Oracle on 2015. -// Modifications copyright (c) 2015 Oracle and/or its affiliates. +// This file was modified by Oracle on 2015, 2018. +// Modifications copyright (c) 2015, 2018, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -31,6 +31,7 @@ #include #include #include +#include #include diff --git a/include/boost/geometry/strategies/cartesian/densify.hpp b/include/boost/geometry/strategies/cartesian/densify.hpp index 23651637b..9e6dd39b5 100644 --- a/include/boost/geometry/strategies/cartesian/densify.hpp +++ b/include/boost/geometry/strategies/cartesian/densify.hpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include diff --git a/include/boost/geometry/strategies/cartesian/disjoint_box_box.hpp b/include/boost/geometry/strategies/cartesian/disjoint_box_box.hpp index da8ae7b1d..706c93ec7 100644 --- a/include/boost/geometry/strategies/cartesian/disjoint_box_box.hpp +++ b/include/boost/geometry/strategies/cartesian/disjoint_box_box.hpp @@ -24,6 +24,7 @@ #include #include +#include #include #include diff --git a/include/boost/geometry/strategies/cartesian/distance_pythagoras.hpp b/include/boost/geometry/strategies/cartesian/distance_pythagoras.hpp index 8a8889dc9..8d8b95436 100644 --- a/include/boost/geometry/strategies/cartesian/distance_pythagoras.hpp +++ b/include/boost/geometry/strategies/cartesian/distance_pythagoras.hpp @@ -4,6 +4,11 @@ // Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018, Oracle and/or its affiliates. + +// 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. @@ -17,6 +22,8 @@ #include +#include + #include #include diff --git a/include/boost/geometry/strategies/cartesian/distance_pythagoras_box_box.hpp b/include/boost/geometry/strategies/cartesian/distance_pythagoras_box_box.hpp index 4c1b6539b..85ee4b78f 100644 --- a/include/boost/geometry/strategies/cartesian/distance_pythagoras_box_box.hpp +++ b/include/boost/geometry/strategies/cartesian/distance_pythagoras_box_box.hpp @@ -4,10 +4,11 @@ // Copyright (c) 2008-2014 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2009-2014 Mateusz Loskot, London, UK. -// This file was modified by Oracle on 2014. -// Modifications copyright (c) 2014, Oracle and/or its affiliates. +// This file was modified by Oracle on 2014, 2018. +// Modifications copyright (c) 2014, 2018, 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 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -21,6 +22,9 @@ #include +#include + +#include #include @@ -29,7 +33,6 @@ - namespace boost { namespace geometry { diff --git a/include/boost/geometry/strategies/cartesian/distance_pythagoras_point_box.hpp b/include/boost/geometry/strategies/cartesian/distance_pythagoras_point_box.hpp index 8423d16a6..d5f62c9ef 100644 --- a/include/boost/geometry/strategies/cartesian/distance_pythagoras_point_box.hpp +++ b/include/boost/geometry/strategies/cartesian/distance_pythagoras_point_box.hpp @@ -4,10 +4,11 @@ // Copyright (c) 2008-2014 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2009-2014 Mateusz Loskot, London, UK. -// This file was modified by Oracle on 2014. -// Modifications copyright (c) 2014, Oracle and/or its affiliates. +// This file was modified by Oracle on 2014, 2018. +// Modifications copyright (c) 2014, 2018, 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 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -21,6 +22,9 @@ #include +#include + +#include #include diff --git a/include/boost/geometry/strategies/cartesian/point_in_poly_crossings_multiply.hpp b/include/boost/geometry/strategies/cartesian/point_in_poly_crossings_multiply.hpp index 94da5cc67..a8e0de7b7 100644 --- a/include/boost/geometry/strategies/cartesian/point_in_poly_crossings_multiply.hpp +++ b/include/boost/geometry/strategies/cartesian/point_in_poly_crossings_multiply.hpp @@ -4,6 +4,11 @@ // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018, Oracle and/or its affiliates. + +// 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. @@ -15,6 +20,7 @@ #define BOOST_GEOMETRY_STRATEGIES_CARTESIAN_POINT_IN_POLY_CROSSINGS_MULTIPLY_HPP +#include #include #include diff --git a/include/boost/geometry/strategies/cartesian/point_in_poly_franklin.hpp b/include/boost/geometry/strategies/cartesian/point_in_poly_franklin.hpp index a774d3c52..16e798747 100644 --- a/include/boost/geometry/strategies/cartesian/point_in_poly_franklin.hpp +++ b/include/boost/geometry/strategies/cartesian/point_in_poly_franklin.hpp @@ -4,6 +4,11 @@ // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018, Oracle and/or its affiliates. + +// 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. @@ -15,6 +20,7 @@ #define BOOST_GEOMETRY_STRATEGIES_CARTESIAN_POINT_IN_POLY_FRANKLIN_HPP +#include #include #include diff --git a/include/boost/geometry/strategies/concepts/area_concept.hpp b/include/boost/geometry/strategies/concepts/area_concept.hpp index 6edc516f9..da983bac5 100644 --- a/include/boost/geometry/strategies/concepts/area_concept.hpp +++ b/include/boost/geometry/strategies/concepts/area_concept.hpp @@ -5,6 +5,10 @@ // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. // Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018 Oracle and/or its affiliates. +// 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. @@ -19,6 +23,9 @@ #include #include +#include + + namespace boost { namespace geometry { namespace concepts { diff --git a/include/boost/geometry/strategies/concepts/distance_concept.hpp b/include/boost/geometry/strategies/concepts/distance_concept.hpp index 0064d438d..ea811d921 100644 --- a/include/boost/geometry/strategies/concepts/distance_concept.hpp +++ b/include/boost/geometry/strategies/concepts/distance_concept.hpp @@ -4,10 +4,11 @@ // Copyright (c) 2008-2014 Bruno Lalande, Paris, France. // Copyright (c) 2009-2014 Mateusz Loskot, London, UK. -// This file was modified by Oracle on 2014. -// Modifications copyright (c) 2014, Oracle and/or its affiliates. +// This file was modified by Oracle on 2014, 2018. +// Modifications copyright (c) 2014, 2018, 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 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -33,6 +34,7 @@ #include #include +#include #include diff --git a/include/boost/geometry/strategies/concepts/within_concept.hpp b/include/boost/geometry/strategies/concepts/within_concept.hpp index 93680f693..e8b0b767a 100644 --- a/include/boost/geometry/strategies/concepts/within_concept.hpp +++ b/include/boost/geometry/strategies/concepts/within_concept.hpp @@ -28,6 +28,9 @@ #include #include +#include +#include + #include diff --git a/include/boost/geometry/strategies/convex_hull.hpp b/include/boost/geometry/strategies/convex_hull.hpp index f4edc5ba3..8208a4eb9 100644 --- a/include/boost/geometry/strategies/convex_hull.hpp +++ b/include/boost/geometry/strategies/convex_hull.hpp @@ -4,6 +4,11 @@ // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018, Oracle and/or its affiliates. + +// 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. @@ -14,6 +19,7 @@ #ifndef BOOST_GEOMETRY_STRATEGIES_CONVEX_HULL_HPP #define BOOST_GEOMETRY_STRATEGIES_CONVEX_HULL_HPP +#include #include diff --git a/include/boost/geometry/strategies/geographic/distance_cross_track.hpp b/include/boost/geometry/strategies/geographic/distance_cross_track.hpp index eddd50302..03eba63d4 100644 --- a/include/boost/geometry/strategies/geographic/distance_cross_track.hpp +++ b/include/boost/geometry/strategies/geographic/distance_cross_track.hpp @@ -1,8 +1,9 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2016-2017, Oracle and/or its affiliates. +// Copyright (c) 2016-2018, Oracle and/or its affiliates. // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle +// 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 @@ -27,6 +28,7 @@ #include #include +#include #include #include #include diff --git a/include/boost/geometry/strategies/spherical/compare.hpp b/include/boost/geometry/strategies/spherical/compare.hpp index 26163f740..bf28fe75a 100644 --- a/include/boost/geometry/strategies/spherical/compare.hpp +++ b/include/boost/geometry/strategies/spherical/compare.hpp @@ -2,8 +2,8 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// 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, 2018. +// Modifications copyright (c) 2017-2018, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -25,6 +25,7 @@ #include #include #include +#include #include #include diff --git a/include/boost/geometry/strategies/spherical/densify.hpp b/include/boost/geometry/strategies/spherical/densify.hpp index 97f4605a9..3fffe070a 100644 --- a/include/boost/geometry/strategies/spherical/densify.hpp +++ b/include/boost/geometry/strategies/spherical/densify.hpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include diff --git a/include/boost/geometry/strategies/spherical/distance_cross_track.hpp b/include/boost/geometry/strategies/spherical/distance_cross_track.hpp index d9f1ac350..280bf76b4 100644 --- a/include/boost/geometry/strategies/spherical/distance_cross_track.hpp +++ b/include/boost/geometry/strategies/spherical/distance_cross_track.hpp @@ -28,6 +28,8 @@ #include #include +#include + #include #include #include From e0a4c6b81e20a0905b9c38be0c0db6d41ca9cc5d Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Tue, 18 Dec 2018 20:30:19 +0100 Subject: [PATCH 11/48] [srs] Add missing includes. --- .../boost/geometry/srs/projections/impl/aasincos.hpp | 2 ++ .../srs/projections/impl/pj_apply_gridshift.hpp | 3 +++ .../boost/geometry/srs/projections/impl/pj_ellps.hpp | 2 -- .../boost/geometry/srs/projections/impl/pj_gauss.hpp | 3 ++- .../geometry/srs/projections/impl/pj_gridinfo.hpp | 1 + .../geometry/srs/projections/impl/pj_gridlist.hpp | 2 ++ .../srs/projections/impl/pj_gridlist_shared.hpp | 1 + .../boost/geometry/srs/projections/impl/pj_mlfn.hpp | 2 ++ .../boost/geometry/srs/projections/impl/pj_phi2.hpp | 2 ++ .../geometry/srs/projections/impl/proj_mdist.hpp | 2 ++ include/boost/geometry/srs/projections/par_data.hpp | 1 + include/boost/geometry/srs/projections/proj/aeqd.hpp | 12 ++++++++---- include/boost/geometry/srs/projections/proj/airy.hpp | 7 ++++--- .../boost/geometry/srs/projections/proj/aitoff.hpp | 7 ++++--- include/boost/geometry/srs/projections/proj/bipc.hpp | 10 ++++++---- .../boost/geometry/srs/projections/proj/bonne.hpp | 10 ++++++---- include/boost/geometry/srs/projections/proj/cea.hpp | 7 ++++--- .../boost/geometry/srs/projections/proj/chamb.hpp | 8 +++++--- include/boost/geometry/srs/projections/proj/eqc.hpp | 3 ++- include/boost/geometry/srs/projections/proj/eqdc.hpp | 10 ++++++---- .../boost/geometry/srs/projections/proj/etmerc.hpp | 7 ++++--- .../boost/geometry/srs/projections/proj/fouc_s.hpp | 9 +++++---- .../boost/geometry/srs/projections/proj/gn_sinu.hpp | 9 +++++---- .../boost/geometry/srs/projections/proj/hammer.hpp | 3 ++- .../boost/geometry/srs/projections/proj/healpix.hpp | 7 ++++--- .../boost/geometry/srs/projections/proj/imw_p.hpp | 7 ++++--- include/boost/geometry/srs/projections/proj/isea.hpp | 6 ++++-- .../boost/geometry/srs/projections/proj/krovak.hpp | 3 ++- .../boost/geometry/srs/projections/proj/labrd.hpp | 3 ++- .../boost/geometry/srs/projections/proj/lagrng.hpp | 7 ++++--- include/boost/geometry/srs/projections/proj/lcc.hpp | 9 +++++---- .../boost/geometry/srs/projections/proj/loxim.hpp | 7 ++++--- include/boost/geometry/srs/projections/proj/lsat.hpp | 9 +++++---- include/boost/geometry/srs/projections/proj/merc.hpp | 7 ++++--- .../boost/geometry/srs/projections/proj/nsper.hpp | 9 ++++++--- include/boost/geometry/srs/projections/proj/ocea.hpp | 3 ++- include/boost/geometry/srs/projections/proj/oea.hpp | 5 +++-- .../boost/geometry/srs/projections/proj/omerc.hpp | 3 ++- .../boost/geometry/srs/projections/proj/rpoly.hpp | 3 ++- .../boost/geometry/srs/projections/proj/sconics.hpp | 3 ++- .../boost/geometry/srs/projections/proj/stere.hpp | 3 ++- .../boost/geometry/srs/projections/proj/tpeqd.hpp | 5 +++-- include/boost/geometry/srs/projections/proj/urm5.hpp | 5 +++-- .../boost/geometry/srs/projections/proj/urmfps.hpp | 5 +++-- include/boost/geometry/srs/projections/proj/wag3.hpp | 3 ++- .../boost/geometry/srs/projections/proj/wink1.hpp | 3 ++- .../boost/geometry/srs/projections/proj/wink2.hpp | 3 ++- 47 files changed, 151 insertions(+), 90 deletions(-) diff --git a/include/boost/geometry/srs/projections/impl/aasincos.hpp b/include/boost/geometry/srs/projections/impl/aasincos.hpp index de064f6a0..b12b5f65b 100644 --- a/include/boost/geometry/srs/projections/impl/aasincos.hpp +++ b/include/boost/geometry/srs/projections/impl/aasincos.hpp @@ -42,6 +42,8 @@ #include +#include +#include #include diff --git a/include/boost/geometry/srs/projections/impl/pj_apply_gridshift.hpp b/include/boost/geometry/srs/projections/impl/pj_apply_gridshift.hpp index ee3aa6ed2..2b3c8c2a7 100644 --- a/include/boost/geometry/srs/projections/impl/pj_apply_gridshift.hpp +++ b/include/boost/geometry/srs/projections/impl/pj_apply_gridshift.hpp @@ -44,8 +44,11 @@ #include #include +#include #include +#include + namespace boost { namespace geometry { namespace projections { diff --git a/include/boost/geometry/srs/projections/impl/pj_ellps.hpp b/include/boost/geometry/srs/projections/impl/pj_ellps.hpp index ae6c55457..1a6f824ee 100644 --- a/include/boost/geometry/srs/projections/impl/pj_ellps.hpp +++ b/include/boost/geometry/srs/projections/impl/pj_ellps.hpp @@ -39,8 +39,6 @@ #ifndef BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_ELLPS_HPP #define BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_ELLPS_HPP -#include - #include namespace boost { namespace geometry { namespace projections { diff --git a/include/boost/geometry/srs/projections/impl/pj_gauss.hpp b/include/boost/geometry/srs/projections/impl/pj_gauss.hpp index 94b8f8986..54d177822 100644 --- a/include/boost/geometry/srs/projections/impl/pj_gauss.hpp +++ b/include/boost/geometry/srs/projections/impl/pj_gauss.hpp @@ -40,7 +40,8 @@ #define BOOST_GEOMETRY_PROJECTIONS_IMPL_PJ_GAUSS_HPP -#include +#include +#include namespace boost { namespace geometry { namespace projections { diff --git a/include/boost/geometry/srs/projections/impl/pj_gridinfo.hpp b/include/boost/geometry/srs/projections/impl/pj_gridinfo.hpp index 8f244dc3c..a2b364e12 100644 --- a/include/boost/geometry/srs/projections/impl/pj_gridinfo.hpp +++ b/include/boost/geometry/srs/projections/impl/pj_gridinfo.hpp @@ -44,6 +44,7 @@ #include #include +#include #include diff --git a/include/boost/geometry/srs/projections/impl/pj_gridlist.hpp b/include/boost/geometry/srs/projections/impl/pj_gridlist.hpp index 0c5a24047..deccdd39f 100644 --- a/include/boost/geometry/srs/projections/impl/pj_gridlist.hpp +++ b/include/boost/geometry/srs/projections/impl/pj_gridlist.hpp @@ -41,8 +41,10 @@ #define BOOST_GEOMETRY_SRS_PROJECTIONS_IMPL_PJ_GRIDLIST_HPP +#include #include #include +#include #include diff --git a/include/boost/geometry/srs/projections/impl/pj_gridlist_shared.hpp b/include/boost/geometry/srs/projections/impl/pj_gridlist_shared.hpp index 88753d034..cb41eaf68 100644 --- a/include/boost/geometry/srs/projections/impl/pj_gridlist_shared.hpp +++ b/include/boost/geometry/srs/projections/impl/pj_gridlist_shared.hpp @@ -43,6 +43,7 @@ #include #include +#include namespace boost { namespace geometry { namespace projections diff --git a/include/boost/geometry/srs/projections/impl/pj_mlfn.hpp b/include/boost/geometry/srs/projections/impl/pj_mlfn.hpp index 04f0d1944..92621875b 100644 --- a/include/boost/geometry/srs/projections/impl/pj_mlfn.hpp +++ b/include/boost/geometry/srs/projections/impl/pj_mlfn.hpp @@ -48,6 +48,8 @@ #include +#include +#include #include diff --git a/include/boost/geometry/srs/projections/impl/pj_phi2.hpp b/include/boost/geometry/srs/projections/impl/pj_phi2.hpp index 868a8c659..dacd4e16d 100644 --- a/include/boost/geometry/srs/projections/impl/pj_phi2.hpp +++ b/include/boost/geometry/srs/projections/impl/pj_phi2.hpp @@ -39,6 +39,8 @@ #ifndef BOOST_GEOMETRY_PROJECTIONS_PHI2_HPP #define BOOST_GEOMETRY_PROJECTIONS_PHI2_HPP +#include +#include #include namespace boost { namespace geometry { namespace projections { diff --git a/include/boost/geometry/srs/projections/impl/proj_mdist.hpp b/include/boost/geometry/srs/projections/impl/proj_mdist.hpp index 5f67546f5..65fc41a4c 100644 --- a/include/boost/geometry/srs/projections/impl/proj_mdist.hpp +++ b/include/boost/geometry/srs/projections/impl/proj_mdist.hpp @@ -40,6 +40,8 @@ #define BOOST_GEOMETRY_PROJECTIONS_PROJ_MDIST_HPP +#include +#include #include diff --git a/include/boost/geometry/srs/projections/par_data.hpp b/include/boost/geometry/srs/projections/par_data.hpp index 83082fe0f..c86767612 100644 --- a/include/boost/geometry/srs/projections/par_data.hpp +++ b/include/boost/geometry/srs/projections/par_data.hpp @@ -13,6 +13,7 @@ #include #include +#include #include namespace boost { namespace geometry { namespace srs diff --git a/include/boost/geometry/srs/projections/proj/aeqd.hpp b/include/boost/geometry/srs/projections/proj/aeqd.hpp index b45146eac..73ce9aac4 100644 --- a/include/boost/geometry/srs/projections/proj/aeqd.hpp +++ b/include/boost/geometry/srs/projections/proj/aeqd.hpp @@ -45,17 +45,21 @@ #define BOOST_GEOMETRY_PROJECTIONS_AEQD_HPP #include + #include #include -#include -#include +#include #include #include -#include #include -#include #include +#include +#include + +#include + +#include #include diff --git a/include/boost/geometry/srs/projections/proj/airy.hpp b/include/boost/geometry/srs/projections/proj/airy.hpp index 235a120d0..fc2ea57de 100644 --- a/include/boost/geometry/srs/projections/proj/airy.hpp +++ b/include/boost/geometry/srs/projections/proj/airy.hpp @@ -45,12 +45,13 @@ #ifndef BOOST_GEOMETRY_PROJECTIONS_AIRY_HPP #define BOOST_GEOMETRY_PROJECTIONS_AIRY_HPP -#include - #include #include -#include #include +#include +#include + +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/aitoff.hpp b/include/boost/geometry/srs/projections/proj/aitoff.hpp index 6d64ea358..a7ad3b086 100644 --- a/include/boost/geometry/srs/projections/proj/aitoff.hpp +++ b/include/boost/geometry/srs/projections/proj/aitoff.hpp @@ -47,14 +47,15 @@ #ifndef BOOST_GEOMETRY_PROJECTIONS_AITOFF_HPP #define BOOST_GEOMETRY_PROJECTIONS_AITOFF_HPP - #include -#include #include #include -#include #include +#include +#include + +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/bipc.hpp b/include/boost/geometry/srs/projections/proj/bipc.hpp index 647a07ad3..9d531f87a 100644 --- a/include/boost/geometry/srs/projections/proj/bipc.hpp +++ b/include/boost/geometry/srs/projections/proj/bipc.hpp @@ -40,13 +40,15 @@ #ifndef BOOST_GEOMETRY_PROJECTIONS_BIPC_HPP #define BOOST_GEOMETRY_PROJECTIONS_BIPC_HPP -#include -#include - #include #include -#include #include +#include +#include + +#include + +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/bonne.hpp b/include/boost/geometry/srs/projections/proj/bonne.hpp index 4016d0322..70bdc87fd 100644 --- a/include/boost/geometry/srs/projections/proj/bonne.hpp +++ b/include/boost/geometry/srs/projections/proj/bonne.hpp @@ -40,14 +40,16 @@ #ifndef BOOST_GEOMETRY_PROJECTIONS_BONNE_HPP #define BOOST_GEOMETRY_PROJECTIONS_BONNE_HPP -#include -#include - #include #include -#include #include #include +#include +#include + +#include + +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/cea.hpp b/include/boost/geometry/srs/projections/proj/cea.hpp index a440ec3f8..467330e56 100644 --- a/include/boost/geometry/srs/projections/proj/cea.hpp +++ b/include/boost/geometry/srs/projections/proj/cea.hpp @@ -40,14 +40,15 @@ #ifndef BOOST_GEOMETRY_PROJECTIONS_CEA_HPP #define BOOST_GEOMETRY_PROJECTIONS_CEA_HPP -#include - #include #include -#include #include #include +#include #include +#include + +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/chamb.hpp b/include/boost/geometry/srs/projections/proj/chamb.hpp index 1f397b33c..0200a565c 100644 --- a/include/boost/geometry/srs/projections/proj/chamb.hpp +++ b/include/boost/geometry/srs/projections/proj/chamb.hpp @@ -40,14 +40,16 @@ #ifndef BOOST_GEOMETRY_PROJECTIONS_CHAMB_HPP #define BOOST_GEOMETRY_PROJECTIONS_CHAMB_HPP -#include #include +#include #include #include -#include #include -#include +#include +#include + +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/eqc.hpp b/include/boost/geometry/srs/projections/proj/eqc.hpp index 21b655d2d..5a19f39ec 100644 --- a/include/boost/geometry/srs/projections/proj/eqc.hpp +++ b/include/boost/geometry/srs/projections/proj/eqc.hpp @@ -42,8 +42,9 @@ #include #include -#include #include +#include +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/eqdc.hpp b/include/boost/geometry/srs/projections/proj/eqdc.hpp index d5aa8f2e1..986e258e2 100644 --- a/include/boost/geometry/srs/projections/proj/eqdc.hpp +++ b/include/boost/geometry/srs/projections/proj/eqdc.hpp @@ -40,15 +40,17 @@ #ifndef BOOST_GEOMETRY_PROJECTIONS_EQDC_HPP #define BOOST_GEOMETRY_PROJECTIONS_EQDC_HPP -#include -#include - #include #include -#include #include #include #include +#include +#include + +#include + +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/etmerc.hpp b/include/boost/geometry/srs/projections/proj/etmerc.hpp index 0bedbf247..86e2a506f 100644 --- a/include/boost/geometry/srs/projections/proj/etmerc.hpp +++ b/include/boost/geometry/srs/projections/proj/etmerc.hpp @@ -54,13 +54,14 @@ #ifndef BOOST_GEOMETRY_PROJECTIONS_ETMERC_HPP #define BOOST_GEOMETRY_PROJECTIONS_ETMERC_HPP -#include - #include #include -#include #include #include +#include +#include + +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/fouc_s.hpp b/include/boost/geometry/srs/projections/proj/fouc_s.hpp index 10a252ec2..f6a8c5ed4 100644 --- a/include/boost/geometry/srs/projections/proj/fouc_s.hpp +++ b/include/boost/geometry/srs/projections/proj/fouc_s.hpp @@ -40,13 +40,14 @@ #ifndef BOOST_GEOMETRY_PROJECTIONS_FOUC_S_HPP #define BOOST_GEOMETRY_PROJECTIONS_FOUC_S_HPP -#include - +#include #include #include -#include #include -#include +#include +#include + +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/gn_sinu.hpp b/include/boost/geometry/srs/projections/proj/gn_sinu.hpp index b4218cc83..2ef7df509 100644 --- a/include/boost/geometry/srs/projections/proj/gn_sinu.hpp +++ b/include/boost/geometry/srs/projections/proj/gn_sinu.hpp @@ -40,14 +40,15 @@ #ifndef BOOST_GEOMETRY_PROJECTIONS_GN_SINU_HPP #define BOOST_GEOMETRY_PROJECTIONS_GN_SINU_HPP -#include - +#include #include #include -#include #include -#include #include +#include +#include + +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/hammer.hpp b/include/boost/geometry/srs/projections/proj/hammer.hpp index 6518fd824..f9e1ae4e7 100644 --- a/include/boost/geometry/srs/projections/proj/hammer.hpp +++ b/include/boost/geometry/srs/projections/proj/hammer.hpp @@ -42,8 +42,9 @@ #include #include -#include #include +#include +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/healpix.hpp b/include/boost/geometry/srs/projections/proj/healpix.hpp index 414935c04..2084ae82f 100644 --- a/include/boost/geometry/srs/projections/proj/healpix.hpp +++ b/include/boost/geometry/srs/projections/proj/healpix.hpp @@ -49,14 +49,15 @@ #ifndef BOOST_GEOMETRY_PROJECTIONS_HEALPIX_HPP #define BOOST_GEOMETRY_PROJECTIONS_HEALPIX_HPP -#include - #include #include -#include #include #include +#include #include +#include + +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/imw_p.hpp b/include/boost/geometry/srs/projections/proj/imw_p.hpp index f5f662406..d86c3c8f7 100644 --- a/include/boost/geometry/srs/projections/proj/imw_p.hpp +++ b/include/boost/geometry/srs/projections/proj/imw_p.hpp @@ -40,13 +40,14 @@ #ifndef BOOST_GEOMETRY_PROJECTIONS_IMW_P_HPP #define BOOST_GEOMETRY_PROJECTIONS_IMW_P_HPP -#include - #include #include -#include #include #include +#include +#include + +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/isea.hpp b/include/boost/geometry/srs/projections/proj/isea.hpp index d3f53a775..d8a48041d 100644 --- a/include/boost/geometry/srs/projections/proj/isea.hpp +++ b/include/boost/geometry/srs/projections/proj/isea.hpp @@ -48,12 +48,14 @@ #include #include -#include #include #include -#include #include +#include +#include + +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/krovak.hpp b/include/boost/geometry/srs/projections/proj/krovak.hpp index 5e4d08a84..75771b49e 100644 --- a/include/boost/geometry/srs/projections/proj/krovak.hpp +++ b/include/boost/geometry/srs/projections/proj/krovak.hpp @@ -47,8 +47,9 @@ #include #include -#include #include +#include +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/labrd.hpp b/include/boost/geometry/srs/projections/proj/labrd.hpp index a66d0c63a..1b86fe74e 100644 --- a/include/boost/geometry/srs/projections/proj/labrd.hpp +++ b/include/boost/geometry/srs/projections/proj/labrd.hpp @@ -42,8 +42,9 @@ #include #include -#include #include +#include +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/lagrng.hpp b/include/boost/geometry/srs/projections/proj/lagrng.hpp index 6f40bb280..6df445962 100644 --- a/include/boost/geometry/srs/projections/proj/lagrng.hpp +++ b/include/boost/geometry/srs/projections/proj/lagrng.hpp @@ -40,12 +40,13 @@ #ifndef BOOST_GEOMETRY_PROJECTIONS_LAGRNG_HPP #define BOOST_GEOMETRY_PROJECTIONS_LAGRNG_HPP -#include - #include #include -#include #include +#include +#include + +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/lcc.hpp b/include/boost/geometry/srs/projections/proj/lcc.hpp index 1b261cb70..ebd9c3bb6 100644 --- a/include/boost/geometry/srs/projections/proj/lcc.hpp +++ b/include/boost/geometry/srs/projections/proj/lcc.hpp @@ -40,17 +40,18 @@ #ifndef BOOST_GEOMETRY_PROJECTIONS_LCC_HPP #define BOOST_GEOMETRY_PROJECTIONS_LCC_HPP -#include -#include - #include #include -#include #include #include +#include #include #include +#include +#include + +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/loxim.hpp b/include/boost/geometry/srs/projections/proj/loxim.hpp index 3736a11cf..927cab157 100644 --- a/include/boost/geometry/srs/projections/proj/loxim.hpp +++ b/include/boost/geometry/srs/projections/proj/loxim.hpp @@ -40,12 +40,13 @@ #ifndef BOOST_GEOMETRY_PROJECTIONS_LOXIM_HPP #define BOOST_GEOMETRY_PROJECTIONS_LOXIM_HPP -#include - #include #include -#include #include +#include +#include + +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/lsat.hpp b/include/boost/geometry/srs/projections/proj/lsat.hpp index 65dbe97f6..3a20d96cb 100644 --- a/include/boost/geometry/srs/projections/proj/lsat.hpp +++ b/include/boost/geometry/srs/projections/proj/lsat.hpp @@ -40,13 +40,14 @@ #ifndef BOOST_GEOMETRY_PROJECTIONS_LSAT_HPP #define BOOST_GEOMETRY_PROJECTIONS_LSAT_HPP -#include - +#include #include #include -#include #include -#include +#include +#include + +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/merc.hpp b/include/boost/geometry/srs/projections/proj/merc.hpp index e2fba5072..5ec1e1f84 100644 --- a/include/boost/geometry/srs/projections/proj/merc.hpp +++ b/include/boost/geometry/srs/projections/proj/merc.hpp @@ -40,15 +40,16 @@ #ifndef BOOST_GEOMETRY_PROJECTIONS_MERC_HPP #define BOOST_GEOMETRY_PROJECTIONS_MERC_HPP -#include - #include #include -#include #include #include +#include #include #include +#include + +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/nsper.hpp b/include/boost/geometry/srs/projections/proj/nsper.hpp index 89dc6a8a1..6366e100d 100644 --- a/include/boost/geometry/srs/projections/proj/nsper.hpp +++ b/include/boost/geometry/srs/projections/proj/nsper.hpp @@ -41,13 +41,16 @@ #define BOOST_GEOMETRY_PROJECTIONS_NSPER_HPP #include -#include -#include #include #include -#include #include +#include +#include + +#include + +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/ocea.hpp b/include/boost/geometry/srs/projections/proj/ocea.hpp index af8be1ca0..c7f531745 100644 --- a/include/boost/geometry/srs/projections/proj/ocea.hpp +++ b/include/boost/geometry/srs/projections/proj/ocea.hpp @@ -44,8 +44,9 @@ #include #include -#include #include +#include +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/oea.hpp b/include/boost/geometry/srs/projections/proj/oea.hpp index f78037d2c..10399ec1a 100644 --- a/include/boost/geometry/srs/projections/proj/oea.hpp +++ b/include/boost/geometry/srs/projections/proj/oea.hpp @@ -42,11 +42,12 @@ #include +#include #include #include -#include #include -#include +#include +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/omerc.hpp b/include/boost/geometry/srs/projections/proj/omerc.hpp index 1e041e2ac..0bec0cacc 100644 --- a/include/boost/geometry/srs/projections/proj/omerc.hpp +++ b/include/boost/geometry/srs/projections/proj/omerc.hpp @@ -46,10 +46,11 @@ #include #include -#include #include +#include #include #include +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/rpoly.hpp b/include/boost/geometry/srs/projections/proj/rpoly.hpp index 87a5d482b..fc59a0397 100644 --- a/include/boost/geometry/srs/projections/proj/rpoly.hpp +++ b/include/boost/geometry/srs/projections/proj/rpoly.hpp @@ -42,8 +42,9 @@ #include #include -#include #include +#include +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/sconics.hpp b/include/boost/geometry/srs/projections/proj/sconics.hpp index 5499f1a7c..44d606cab 100644 --- a/include/boost/geometry/srs/projections/proj/sconics.hpp +++ b/include/boost/geometry/srs/projections/proj/sconics.hpp @@ -46,8 +46,9 @@ #include #include -#include #include +#include +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/stere.hpp b/include/boost/geometry/srs/projections/proj/stere.hpp index 7b287383f..7c2de3fcc 100644 --- a/include/boost/geometry/srs/projections/proj/stere.hpp +++ b/include/boost/geometry/srs/projections/proj/stere.hpp @@ -46,9 +46,10 @@ #include #include -#include #include +#include #include +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/tpeqd.hpp b/include/boost/geometry/srs/projections/proj/tpeqd.hpp index 9b9687fae..06f9cc0a0 100644 --- a/include/boost/geometry/srs/projections/proj/tpeqd.hpp +++ b/include/boost/geometry/srs/projections/proj/tpeqd.hpp @@ -43,11 +43,12 @@ #include #include +#include #include #include -#include #include -#include +#include +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/urm5.hpp b/include/boost/geometry/srs/projections/proj/urm5.hpp index 4cec4cdd1..b1682332a 100644 --- a/include/boost/geometry/srs/projections/proj/urm5.hpp +++ b/include/boost/geometry/srs/projections/proj/urm5.hpp @@ -40,11 +40,12 @@ #ifndef BOOST_GEOMETRY_PROJECTIONS_URM5_HPP #define BOOST_GEOMETRY_PROJECTIONS_URM5_HPP +#include #include #include -#include #include -#include +#include +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/urmfps.hpp b/include/boost/geometry/srs/projections/proj/urmfps.hpp index aa7982758..8f608619a 100644 --- a/include/boost/geometry/srs/projections/proj/urmfps.hpp +++ b/include/boost/geometry/srs/projections/proj/urmfps.hpp @@ -40,11 +40,12 @@ #ifndef BOOST_GEOMETRY_PROJECTIONS_URMFPS_HPP #define BOOST_GEOMETRY_PROJECTIONS_URMFPS_HPP +#include #include #include -#include #include -#include +#include +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/wag3.hpp b/include/boost/geometry/srs/projections/proj/wag3.hpp index 825ead353..c69eca7b7 100644 --- a/include/boost/geometry/srs/projections/proj/wag3.hpp +++ b/include/boost/geometry/srs/projections/proj/wag3.hpp @@ -42,8 +42,9 @@ #include #include -#include #include +#include +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/wink1.hpp b/include/boost/geometry/srs/projections/proj/wink1.hpp index b920daa97..d05f9458f 100644 --- a/include/boost/geometry/srs/projections/proj/wink1.hpp +++ b/include/boost/geometry/srs/projections/proj/wink1.hpp @@ -42,8 +42,9 @@ #include #include -#include #include +#include +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/srs/projections/proj/wink2.hpp b/include/boost/geometry/srs/projections/proj/wink2.hpp index 06f077036..71bc147ab 100644 --- a/include/boost/geometry/srs/projections/proj/wink2.hpp +++ b/include/boost/geometry/srs/projections/proj/wink2.hpp @@ -44,8 +44,9 @@ #include #include -#include #include +#include +#include namespace boost { namespace geometry { From 821221ce26ea14e94fda8207e57d04083d1840b8 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Tue, 18 Dec 2018 23:17:36 +0100 Subject: [PATCH 12/48] [algorithms] Add missing includes. --- include/boost/geometry/algorithms/densify.hpp | 1 + .../buffer/turn_in_original_visitor.hpp | 1 + .../detail/disjoint/linear_areal.hpp | 7 ++++--- .../algorithms/detail/extreme_points.hpp | 5 +++-- .../algorithms/detail/get_left_turns.hpp | 9 ++++++--- .../algorithms/detail/get_max_size.hpp | 7 ++++++- .../detail/is_valid/debug_validity_phase.hpp | 6 +++--- .../is_valid/has_invalid_coordinate.hpp | 12 ++++++----- .../detail/is_valid/has_valid_self_turns.hpp | 14 ++++++------- .../overlay/append_no_dups_or_spikes.hpp | 2 ++ .../detail/overlay/convert_ring.hpp | 15 ++++++++------ .../detail/overlay/copy_segments.hpp | 20 +++++++++++-------- .../overlay/get_turn_info_for_endpoint.hpp | 4 +++- .../detail/overlay/get_turn_info_helpers.hpp | 1 + .../algorithms/detail/overlay/stream_info.hpp | 8 ++++---- .../algorithms/detail/overlay/traversal.hpp | 6 ++++-- .../detail/relate/boundary_checker.hpp | 9 +++++---- .../detail/relate/follow_helpers.hpp | 1 + .../detail/relate/multi_point_geometry.hpp | 1 + .../algorithms/detail/relate/result.hpp | 5 +++-- .../detail/sections/section_functions.hpp | 2 ++ .../geometry/algorithms/dispatch/disjoint.hpp | 5 +++-- .../geometry/algorithms/dispatch/distance.hpp | 8 +++++--- .../boost/geometry/algorithms/simplify.hpp | 1 + 24 files changed, 94 insertions(+), 56 deletions(-) diff --git a/include/boost/geometry/algorithms/densify.hpp b/include/boost/geometry/algorithms/densify.hpp index ed948b346..80dd5c5c8 100644 --- a/include/boost/geometry/algorithms/densify.hpp +++ b/include/boost/geometry/algorithms/densify.hpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/include/boost/geometry/algorithms/detail/buffer/turn_in_original_visitor.hpp b/include/boost/geometry/algorithms/detail/buffer/turn_in_original_visitor.hpp index 665d4e4be..5236da1da 100644 --- a/include/boost/geometry/algorithms/detail/buffer/turn_in_original_visitor.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/turn_in_original_visitor.hpp @@ -16,6 +16,7 @@ #include +#include #include #include #include diff --git a/include/boost/geometry/algorithms/detail/disjoint/linear_areal.hpp b/include/boost/geometry/algorithms/detail/disjoint/linear_areal.hpp index e6077d3e7..55e3fe07f 100644 --- a/include/boost/geometry/algorithms/detail/disjoint/linear_areal.hpp +++ b/include/boost/geometry/algorithms/detail/disjoint/linear_areal.hpp @@ -5,8 +5,8 @@ // Copyright (c) 2009-2014 Mateusz Loskot, London, UK. // Copyright (c) 2013-2014 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2013-2017. -// Modifications copyright (c) 2013-2017, Oracle and/or its affiliates. +// This file was modified by Oracle on 2013-2018. +// Modifications copyright (c) 2013-2018, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle @@ -41,8 +41,9 @@ #include #include -#include +#include #include +#include #include #include diff --git a/include/boost/geometry/algorithms/detail/extreme_points.hpp b/include/boost/geometry/algorithms/detail/extreme_points.hpp index 607997813..842c441f4 100644 --- a/include/boost/geometry/algorithms/detail/extreme_points.hpp +++ b/include/boost/geometry/algorithms/detail/extreme_points.hpp @@ -5,8 +5,8 @@ // Copyright (c) 2009-2013 Mateusz Loskot, London, UK. // Copyright (c) 2013-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, 2018. +// Modifications copyright (c) 2017-2018 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -25,6 +25,7 @@ #include #include +#include #include #include #include diff --git a/include/boost/geometry/algorithms/detail/get_left_turns.hpp b/include/boost/geometry/algorithms/detail/get_left_turns.hpp index e9f6a5085..1fec47a01 100644 --- a/include/boost/geometry/algorithms/detail/get_left_turns.hpp +++ b/include/boost/geometry/algorithms/detail/get_left_turns.hpp @@ -2,8 +2,8 @@ // Copyright (c) 2012-2014 Barend Gehrels, Amsterdam, the Netherlands. -// 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, 2018. +// Modifications copyright (c) 2017-2018, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -14,11 +14,14 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_GET_LEFT_TURNS_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_GET_LEFT_TURNS_HPP +#include +#include + #include -#include #include #include +#include #include #include #include diff --git a/include/boost/geometry/algorithms/detail/get_max_size.hpp b/include/boost/geometry/algorithms/detail/get_max_size.hpp index 8ac43e78b..f4741824a 100644 --- a/include/boost/geometry/algorithms/detail/get_max_size.hpp +++ b/include/boost/geometry/algorithms/detail/get_max_size.hpp @@ -5,6 +5,11 @@ // Copyright (c) 2014 Mateusz Loskot, London, UK. // Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018, 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) @@ -12,10 +17,10 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_GET_MAX_SIZE_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_GET_MAX_SIZE_HPP - #include #include +#include #include namespace boost { namespace geometry diff --git a/include/boost/geometry/algorithms/detail/is_valid/debug_validity_phase.hpp b/include/boost/geometry/algorithms/detail/is_valid/debug_validity_phase.hpp index a10e0fe59..b072f7ad4 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/debug_validity_phase.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/debug_validity_phase.hpp @@ -1,8 +1,9 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2014, Oracle and/or its affiliates. +// Copyright (c) 2014, 2018, 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 @@ -12,11 +13,10 @@ #ifdef GEOMETRY_TEST_DEBUG #include +#endif #include #include -#endif - namespace boost { namespace geometry { diff --git a/include/boost/geometry/algorithms/detail/is_valid/has_invalid_coordinate.hpp b/include/boost/geometry/algorithms/detail/is_valid/has_invalid_coordinate.hpp index 6e6823d62..cf3a41069 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/has_invalid_coordinate.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/has_invalid_coordinate.hpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2014-2015, Oracle and/or its affiliates. +// Copyright (c) 2014-2018, 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 @@ -15,15 +15,17 @@ #include +#include +#include + #include #include -#include - #include -#include -#include +#include + +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/algorithms/detail/is_valid/has_valid_self_turns.hpp b/include/boost/geometry/algorithms/detail/is_valid/has_valid_self_turns.hpp index b36e9f38b..82818b099 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/has_valid_self_turns.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/has_valid_self_turns.hpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2014-2017, Oracle and/or its affiliates. +// Copyright (c) 2014-2018, 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 @@ -16,6 +16,12 @@ #include #include +#include +#include +#include +#include +#include + #include #include @@ -23,12 +29,6 @@ #include #include -#include -#include -#include - -#include - namespace boost { namespace geometry { diff --git a/include/boost/geometry/algorithms/detail/overlay/append_no_dups_or_spikes.hpp b/include/boost/geometry/algorithms/detail/overlay/append_no_dups_or_spikes.hpp index bc9db32f8..aac39df14 100644 --- a/include/boost/geometry/algorithms/detail/overlay/append_no_dups_or_spikes.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/append_no_dups_or_spikes.hpp @@ -21,6 +21,8 @@ #include #include +#include + #include #include diff --git a/include/boost/geometry/algorithms/detail/overlay/convert_ring.hpp b/include/boost/geometry/algorithms/detail/overlay/convert_ring.hpp index 51955b515..e2b3cfe06 100644 --- a/include/boost/geometry/algorithms/detail/overlay/convert_ring.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/convert_ring.hpp @@ -2,6 +2,11 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018, 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) @@ -9,18 +14,16 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_CONVERT_RING_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_CONVERT_RING_HPP - #include -#include #include +#include +#include +#include + #include #include #include -#include - -#include - namespace boost { namespace geometry { diff --git a/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp b/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp index 286ac4b71..d5bdf7eb8 100644 --- a/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp @@ -23,23 +23,27 @@ #include #include +#include +#include +#include +#include +#include + #include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include + +#include #include +#include +#include + namespace boost { namespace geometry { diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_for_endpoint.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_for_endpoint.hpp index 58126fd96..521744df8 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_for_endpoint.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_for_endpoint.hpp @@ -15,8 +15,10 @@ #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_GET_TURN_INFO_FOR_ENDPOINT_HPP #include -#include + +#include #include +#include #include namespace boost { namespace geometry { diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_helpers.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_helpers.hpp index d02f18d96..c87c92e1d 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_helpers.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_helpers.hpp @@ -16,6 +16,7 @@ #include #include +#include #include #include // referring_segment #include diff --git a/include/boost/geometry/algorithms/detail/overlay/stream_info.hpp b/include/boost/geometry/algorithms/detail/overlay/stream_info.hpp index f86771a0e..307d9ff80 100644 --- a/include/boost/geometry/algorithms/detail/overlay/stream_info.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/stream_info.hpp @@ -51,10 +51,10 @@ namespace detail { namespace overlay << (info.opposite ? " o" : "") << "]" << " sd " - << dir(info.sides.get<0,0>()) - << dir(info.sides.get<0,1>()) - << dir(info.sides.get<1,0>()) - << dir(info.sides.get<1,1>()) + << dir(info.sides.template get<0,0>()) + << dir(info.sides.template get<0,1>()) + << dir(info.sides.template get<1,0>()) + << dir(info.sides.template get<1,1>()) << " nxt seg " << info.travels_to_vertex_index << " , ip " << info.travels_to_ip_index << " , or " << info.next_ip_index diff --git a/include/boost/geometry/algorithms/detail/overlay/traversal.hpp b/include/boost/geometry/algorithms/detail/overlay/traversal.hpp index 90ee24013..95f57941b 100644 --- a/include/boost/geometry/algorithms/detail/overlay/traversal.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/traversal.hpp @@ -2,8 +2,8 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// 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, 2018. +// Modifications copyright (c) 2017-2018 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -15,9 +15,11 @@ #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_TRAVERSAL_HPP #include +#include #include +#include #include #include #include diff --git a/include/boost/geometry/algorithms/detail/relate/boundary_checker.hpp b/include/boost/geometry/algorithms/detail/relate/boundary_checker.hpp index 775b14f45..dc927d902 100644 --- a/include/boost/geometry/algorithms/detail/relate/boundary_checker.hpp +++ b/include/boost/geometry/algorithms/detail/relate/boundary_checker.hpp @@ -13,13 +13,14 @@ #include -#include -#include -#include - #include +#include +#include + +#include #include +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/algorithms/detail/relate/follow_helpers.hpp b/include/boost/geometry/algorithms/detail/relate/follow_helpers.hpp index ecaf17b14..139664cc7 100644 --- a/include/boost/geometry/algorithms/detail/relate/follow_helpers.hpp +++ b/include/boost/geometry/algorithms/detail/relate/follow_helpers.hpp @@ -19,6 +19,7 @@ #include +#include #include #include #include diff --git a/include/boost/geometry/algorithms/detail/relate/multi_point_geometry.hpp b/include/boost/geometry/algorithms/detail/relate/multi_point_geometry.hpp index 471dfe66e..8dec5ccda 100644 --- a/include/boost/geometry/algorithms/detail/relate/multi_point_geometry.hpp +++ b/include/boost/geometry/algorithms/detail/relate/multi_point_geometry.hpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/include/boost/geometry/algorithms/detail/relate/result.hpp b/include/boost/geometry/algorithms/detail/relate/result.hpp index 92bc160a6..43592b981 100644 --- a/include/boost/geometry/algorithms/detail/relate/result.hpp +++ b/include/boost/geometry/algorithms/detail/relate/result.hpp @@ -3,8 +3,8 @@ // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2013-2016. -// Modifications copyright (c) 2013-2016 Oracle and/or its affiliates. +// This file was modified by Oracle on 2013-2018. +// Modifications copyright (c) 2013-2018 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include diff --git a/include/boost/geometry/algorithms/detail/sections/section_functions.hpp b/include/boost/geometry/algorithms/detail/sections/section_functions.hpp index 33deb9474..bd72ff48a 100644 --- a/include/boost/geometry/algorithms/detail/sections/section_functions.hpp +++ b/include/boost/geometry/algorithms/detail/sections/section_functions.hpp @@ -22,6 +22,8 @@ // For spherical/geographic longitudes covered_by point/box #include +#include + namespace boost { namespace geometry { diff --git a/include/boost/geometry/algorithms/dispatch/disjoint.hpp b/include/boost/geometry/algorithms/dispatch/disjoint.hpp index 78015f1a5..ef7499188 100644 --- a/include/boost/geometry/algorithms/dispatch/disjoint.hpp +++ b/include/boost/geometry/algorithms/dispatch/disjoint.hpp @@ -5,8 +5,8 @@ // Copyright (c) 2009-2014 Mateusz Loskot, London, UK. // Copyright (c) 2013-2014 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2013-2017. -// Modifications copyright (c) 2013-2017, Oracle and/or its affiliates. +// This file was modified by Oracle on 2013-2018. +// Modifications copyright (c) 2013-2018, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle @@ -23,6 +23,7 @@ #include +#include #include #include #include diff --git a/include/boost/geometry/algorithms/dispatch/distance.hpp b/include/boost/geometry/algorithms/dispatch/distance.hpp index cae3ebd0c..b12fc0ce9 100644 --- a/include/boost/geometry/algorithms/dispatch/distance.hpp +++ b/include/boost/geometry/algorithms/dispatch/distance.hpp @@ -5,10 +5,11 @@ // Copyright (c) 2009-2014 Mateusz Loskot, London, UK. // Copyright (c) 2013-2014 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2014. -// Modifications copyright (c) 2014, Oracle and/or its affiliates. +// This file was modified by Oracle on 2014, 2018. +// Modifications copyright (c) 2014-2018, 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 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -25,8 +26,9 @@ #include #include #include -#include +#include #include +#include namespace boost { namespace geometry diff --git a/include/boost/geometry/algorithms/simplify.hpp b/include/boost/geometry/algorithms/simplify.hpp index 8daac6dda..b5276878e 100644 --- a/include/boost/geometry/algorithms/simplify.hpp +++ b/include/boost/geometry/algorithms/simplify.hpp @@ -20,6 +20,7 @@ #define BOOST_GEOMETRY_ALGORITHMS_SIMPLIFY_HPP #include +#include #include #include From ea1a1fd5a4cec55560a9078a0e9bae234e2ef62c Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Wed, 19 Dec 2018 23:02:20 +0100 Subject: [PATCH 13/48] [formulas] Remove unneeded and heavy dependency (srs/projections). --- include/boost/geometry/formulas/meridian_segment.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/geometry/formulas/meridian_segment.hpp b/include/boost/geometry/formulas/meridian_segment.hpp index 535e31e3d..0aa7542f9 100644 --- a/include/boost/geometry/formulas/meridian_segment.hpp +++ b/include/boost/geometry/formulas/meridian_segment.hpp @@ -1,8 +1,9 @@ // Boost.Geometry -// Copyright (c) 2017 Oracle and/or its affiliates. +// Copyright (c) 2017-2018 Oracle and/or its affiliates. // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle +// 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 @@ -14,7 +15,6 @@ #include #include -#include #include #include From 335d25dd45239b4c23bef29d586314cce64de962 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Thu, 3 Jan 2019 15:49:25 +0100 Subject: [PATCH 14/48] [algorithms][strategies] Decrease distance() strategies dependencies. Include only required parts of other algorithms. This removes the rtree dependency from strategies. --- .../detail/covered_by/implementation.hpp | 6 ++-- .../detail/distance/point_to_geometry.hpp | 20 +++++++------ .../detail/distance/segment_to_box.hpp | 28 +++++++++++++++---- .../detail/within/implementation.hpp | 6 ++-- .../detail/within/point_in_geometry.hpp | 28 +++++++++++++++++-- .../cartesian/distance_segment_box.hpp | 10 ++++++- .../geographic/distance_segment_box.hpp | 10 ++++++- .../spherical/distance_segment_box.hpp | 10 ++++++- 8 files changed, 93 insertions(+), 25 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/covered_by/implementation.hpp b/include/boost/geometry/algorithms/detail/covered_by/implementation.hpp index c5a02b976..b180a3d5a 100644 --- a/include/boost/geometry/algorithms/detail/covered_by/implementation.hpp +++ b/include/boost/geometry/algorithms/detail/covered_by/implementation.hpp @@ -4,8 +4,8 @@ // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. -// This file was modified by Oracle on 2013, 2014, 2017. -// Modifications copyright (c) 2013-2017 Oracle and/or its affiliates. +// This file was modified by Oracle on 2013, 2014, 2017, 2019. +// Modifications copyright (c) 2013-2019 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -36,7 +36,7 @@ struct use_point_in_geometry template static inline bool apply(Geometry1 const& geometry1, Geometry2 const& geometry2, Strategy const& strategy) { - return detail::within::point_in_geometry(geometry1, geometry2, strategy) >= 0; + return detail::within::covered_by_point_geometry(geometry1, geometry2, strategy); } }; diff --git a/include/boost/geometry/algorithms/detail/distance/point_to_geometry.hpp b/include/boost/geometry/algorithms/detail/distance/point_to_geometry.hpp index 9596799cb..f41cf5c76 100644 --- a/include/boost/geometry/algorithms/detail/distance/point_to_geometry.hpp +++ b/include/boost/geometry/algorithms/detail/distance/point_to_geometry.hpp @@ -5,10 +5,11 @@ // Copyright (c) 2009-2014 Mateusz Loskot, London, UK. // Copyright (c) 2013-2014 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2014. -// Modifications copyright (c) 2014, Oracle and/or its affiliates. +// This file was modified by Oracle on 2014, 2019. +// Modifications 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 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -39,13 +40,12 @@ #include #include -#include -#include #include #include #include #include +#include #include @@ -160,7 +160,8 @@ struct point_to_ring Ring const& ring, Strategy const& strategy) { - if (geometry::within(point, ring)) + // TODO: pass strategy + if (within::within_point_geometry(point, ring)) { return return_type(0); } @@ -204,7 +205,8 @@ private: { for (InteriorRingIterator it = first; it != last; ++it) { - if (geometry::within(point, *it)) + // TODO: pass strategy + if (within::within_point_geometry(point, *it)) { // the point is inside a polygon hole, so its distance // to the polygon its distance to the polygon's @@ -233,7 +235,8 @@ public: Polygon const& polygon, Strategy const& strategy) { - if (!geometry::covered_by(point, exterior_ring(polygon))) + // TODO: pass strategy + if (! within::covered_by_point_geometry(point, exterior_ring(polygon))) { // the point is outside the exterior ring, so its distance // to the polygon is its distance to the polygon's exterior ring @@ -330,7 +333,8 @@ struct point_to_multigeometry MultiPolygon const& multipolygon, Strategy const& strategy) { - if (geometry::covered_by(point, multipolygon)) + // TODO: pass strategy + if (within::covered_by_point_geometry(point, multipolygon)) { return 0; } diff --git a/include/boost/geometry/algorithms/detail/distance/segment_to_box.hpp b/include/boost/geometry/algorithms/detail/distance/segment_to_box.hpp index 863d88726..71e82e0f8 100644 --- a/include/boost/geometry/algorithms/detail/distance/segment_to_box.hpp +++ b/include/boost/geometry/algorithms/detail/distance/segment_to_box.hpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2014-2018 Oracle and/or its affiliates. +// Copyright (c) 2014-2019 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 @@ -32,11 +32,11 @@ #include #include #include +#include #include #include +#include #include -#include -#include #include #include @@ -45,6 +45,7 @@ #include #include +#include #include #include @@ -58,6 +59,20 @@ namespace detail { namespace distance { +// TODO: Take strategy +template +inline bool intersects_segment_box(Segment const& segment, Box const& box) +{ + typedef typename strategy::disjoint::services::default_strategy + < + Segment, Box + >::type strategy_type; + + return ! detail::disjoint::disjoint_segment_box::apply(segment, box, + strategy_type()); +} + + template < typename Segment, @@ -100,7 +115,7 @@ public: Strategy const& strategy, bool check_intersection = true) { - if (check_intersection && geometry::intersects(segment, box)) + if (check_intersection && intersects_segment_box(segment, box)) { return 0; } @@ -215,7 +230,7 @@ public: Strategy const& strategy, bool check_intersection = true) { - if (check_intersection && geometry::intersects(segment, box)) + if (check_intersection && intersects_segment_box(segment, box)) { return 0; } @@ -754,7 +769,8 @@ public: detail::assign_point_from_index<0>(segment, p[0]); detail::assign_point_from_index<1>(segment, p[1]); - if (geometry::equals(p[0], p[1])) + if (detail::equals::equals_point_point(p[0], p[1], + sb_strategy.get_equals_point_point_strategy())) { typedef typename boost::mpl::if_ < diff --git a/include/boost/geometry/algorithms/detail/within/implementation.hpp b/include/boost/geometry/algorithms/detail/within/implementation.hpp index a1fae421e..163092b2c 100644 --- a/include/boost/geometry/algorithms/detail/within/implementation.hpp +++ b/include/boost/geometry/algorithms/detail/within/implementation.hpp @@ -4,8 +4,8 @@ // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. -// This file was modified by Oracle on 2013, 2014, 2017. -// Modifications copyright (c) 2013-2017 Oracle and/or its affiliates. +// This file was modified by Oracle on 2013, 2014, 2017, 2019. +// Modifications copyright (c) 2013-2019 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -61,7 +61,7 @@ struct use_point_in_geometry template static inline bool apply(Geometry1 const& geometry1, Geometry2 const& geometry2, Strategy const& strategy) { - return detail::within::point_in_geometry(geometry1, geometry2, strategy) == 1; + return detail::within::within_point_geometry(geometry1, geometry2, strategy); } }; diff --git a/include/boost/geometry/algorithms/detail/within/point_in_geometry.hpp b/include/boost/geometry/algorithms/detail/within/point_in_geometry.hpp index 1509528d7..45449eb19 100644 --- a/include/boost/geometry/algorithms/detail/within/point_in_geometry.hpp +++ b/include/boost/geometry/algorithms/detail/within/point_in_geometry.hpp @@ -5,8 +5,8 @@ // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. // Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2013, 2014, 2015, 2017, 2018. -// Modifications copyright (c) 2013-2018, Oracle and/or its affiliates. +// This file was modified by Oracle on 2013, 2014, 2015, 2017, 2018, 2019. +// Modifications copyright (c) 2013-2019, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -382,6 +382,30 @@ inline int point_in_geometry(Point const& point, Geometry const& geometry) return point_in_geometry(point, geometry, strategy_type()); } +template +inline bool within_point_geometry(Point const& point, Geometry const& geometry, Strategy const& strategy) +{ + return point_in_geometry(point, geometry, strategy) > 0; +} + +template +inline bool within_point_geometry(Point const& point, Geometry const& geometry) +{ + return point_in_geometry(point, geometry) > 0; +} + +template +inline bool covered_by_point_geometry(Point const& point, Geometry const& geometry, Strategy const& strategy) +{ + return point_in_geometry(point, geometry, strategy) >= 0; +} + +template +inline bool covered_by_point_geometry(Point const& point, Geometry const& geometry) +{ + return point_in_geometry(point, geometry) >= 0; +} + }} // namespace detail::within #endif // DOXYGEN_NO_DETAIL diff --git a/include/boost/geometry/strategies/cartesian/distance_segment_box.hpp b/include/boost/geometry/strategies/cartesian/distance_segment_box.hpp index 1fe3498b0..b623822ec 100644 --- a/include/boost/geometry/strategies/cartesian/distance_segment_box.hpp +++ b/include/boost/geometry/strategies/cartesian/distance_segment_box.hpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2018 Oracle and/or its affiliates. +// Copyright (c) 2018-2019 Oracle and/or its affiliates. // Contributed and/or modified by Vissarion Fisikopoulos, on behalf of Oracle // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -14,6 +14,7 @@ #include #include +#include namespace boost { namespace geometry { @@ -63,6 +64,13 @@ struct cartesian_segment_box return typename distance_ps_strategy::type(); } + typedef within::cartesian_point_point equals_point_point_strategy_type; + + static inline equals_point_point_strategy_type get_equals_point_point_strategy() + { + return equals_point_point_strategy_type(); + } + template inline ReturnType segment_below_of_box(SegmentPoint const& p0, diff --git a/include/boost/geometry/strategies/geographic/distance_segment_box.hpp b/include/boost/geometry/strategies/geographic/distance_segment_box.hpp index 02168e649..615f93873 100644 --- a/include/boost/geometry/strategies/geographic/distance_segment_box.hpp +++ b/include/boost/geometry/strategies/geographic/distance_segment_box.hpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2018 Oracle and/or its affiliates. +// Copyright (c) 2018-2019 Oracle and/or its affiliates. // Contributed and/or modified by Vissarion Fisikopoulos, on behalf of Oracle // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -82,6 +83,13 @@ struct geographic_segment_box return distance_type(m_spheroid); } + typedef within::spherical_point_point equals_point_point_strategy_type; + + static inline equals_point_point_strategy_type get_equals_point_point_strategy() + { + return equals_point_point_strategy_type(); + } + //constructor explicit geographic_segment_box(Spheroid const& spheroid = Spheroid()) diff --git a/include/boost/geometry/strategies/spherical/distance_segment_box.hpp b/include/boost/geometry/strategies/spherical/distance_segment_box.hpp index 49d032b18..73f518896 100644 --- a/include/boost/geometry/strategies/spherical/distance_segment_box.hpp +++ b/include/boost/geometry/strategies/spherical/distance_segment_box.hpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2018 Oracle and/or its affiliates. +// Copyright (c) 2018-2019 Oracle and/or its affiliates. // Contributed and/or modified by Vissarion Fisikopoulos, on behalf of Oracle // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -17,6 +17,7 @@ #include #include #include +#include #include // spherical namespace boost { namespace geometry @@ -212,6 +213,13 @@ struct spherical_segment_box return typename distance_ps_strategy::type(); } + typedef within::spherical_point_point equals_point_point_strategy_type; + + static inline equals_point_point_strategy_type get_equals_point_point_strategy() + { + return equals_point_point_strategy_type(); + } + // methods template Date: Thu, 3 Jan 2019 15:50:56 +0100 Subject: [PATCH 15/48] [test][within] Add missing include. --- test/algorithms/within/test_within.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/algorithms/within/test_within.hpp b/test/algorithms/within/test_within.hpp index 58254d63f..f4df47527 100644 --- a/test/algorithms/within/test_within.hpp +++ b/test/algorithms/within/test_within.hpp @@ -4,8 +4,8 @@ // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2014, 2015, 2017. -// Modifications copyright (c) 2014-2017 Oracle and/or its affiliates. +// This file was modified by Oracle on 2014, 2015, 2017, 2019. +// Modifications copyright (c) 2014-2019 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -21,6 +21,7 @@ #include +#include #include #include #include From 0ee5b554a906ce9eea89089b953848356ce88a71 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Thu, 3 Jan 2019 22:02:50 +0100 Subject: [PATCH 16/48] [distance] Add missing include. --- .../boost/geometry/algorithms/detail/distance/segment_to_box.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/boost/geometry/algorithms/detail/distance/segment_to_box.hpp b/include/boost/geometry/algorithms/detail/distance/segment_to_box.hpp index 71e82e0f8..d88a6699c 100644 --- a/include/boost/geometry/algorithms/detail/distance/segment_to_box.hpp +++ b/include/boost/geometry/algorithms/detail/distance/segment_to_box.hpp @@ -43,6 +43,7 @@ #include #include +#include #include #include From e090c027d0e3ef622c65296313cab4ba74133821 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Wed, 23 Jan 2019 01:31:36 +0100 Subject: [PATCH 17/48] [index] Fix reference to temporary returned by index::indexable<> for types convertible to ValueType. --- include/boost/geometry/index/indexable.hpp | 207 ++++++++++++++++++++- 1 file changed, 197 insertions(+), 10 deletions(-) diff --git a/include/boost/geometry/index/indexable.hpp b/include/boost/geometry/index/indexable.hpp index 831e17f6d..ee0b6d610 100644 --- a/include/boost/geometry/index/indexable.hpp +++ b/include/boost/geometry/index/indexable.hpp @@ -1,6 +1,6 @@ // Boost.Geometry Index // -// Copyright (c) 2011-2017 Adam Wulkiewicz, Lodz, Poland. +// Copyright (c) 2011-2019 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 @@ -11,11 +11,43 @@ #include #include +#include +#include +#include +#include #include namespace boost { namespace geometry { namespace index { namespace detail { +template +struct remove_cr + : boost::remove_const + < + typename boost::remove_reference::type + > +{}; + +template +struct is_referencable + : boost::is_same + < + typename remove_cr::type, + typename remove_cr::type + > +{}; + +template +inline Indexable const& indexable_prevent_any_type(V const& ) +{ + BOOST_MPL_ASSERT_MSG( + (false), + UNEXPECTED_TYPE, + (V) + ); + return Indexable(); +}; + /*! \brief The function object extracting Indexable from Value. @@ -48,6 +80,15 @@ struct indexable { return v; } + + /*! + \brief Prevent reference to temporary for types convertible to Value. + */ + template + inline result_type operator()(V const& v) const + { + return indexable_prevent_any_type(v); + } }; /*! @@ -56,11 +97,13 @@ struct indexable This specialization translates from std::pair. \tparam Indexable The Indexable type. -\tparam T2 The second type. +\tparam Second The second type. */ -template -struct indexable, false> +template +struct indexable, false> { + typedef std::pair value_type; + BOOST_MPL_ASSERT_MSG( (detail::is_indexable::value), NOT_VALID_INDEXABLE_TYPE, @@ -76,24 +119,51 @@ struct indexable, false> \param v The value. \return The indexable. */ - inline result_type operator()(std::pair const& v) const + inline result_type operator()(value_type const& v) const { return v.first; } + + /*! + \brief Return indexable extracted from compatible type different than value_type. + + \param v The value. + \return The indexable. + */ + template + inline result_type operator()(std::pair const& v) const + { + BOOST_MPL_ASSERT_MSG( + (is_referencable::value), + UNEXPECTED_TYPE, + (std::pair) + ); + return v.first; + } + + /*! + \brief Prevent reference to temporary for types convertible to Value. + */ + template + inline result_type operator()(V const& v) const + { + return indexable_prevent_any_type(v); + } }; /*! \brief The function object extracting Indexable from Value. -This specialization translates from boost::tuple. +This specialization translates from boost::tuple + or boost::tuples::cons. +\tparam Value The Value type. \tparam Indexable The Indexable type. */ -template -struct indexable, false> +template +struct indexable_boost_tuple { - typedef boost::tuple value_type; + typedef Value value_type; BOOST_MPL_ASSERT_MSG( (detail::is_indexable::value), @@ -114,8 +184,85 @@ struct indexable, fa { return boost::get<0>(v); } + + /*! + \brief Return indexable extracted from compatible type different than value_type. + + \param v The value. + \return The indexable. + */ + template + inline result_type operator()(boost::tuple const& v) const + { + BOOST_MPL_ASSERT_MSG( + (is_referencable::value), + UNEXPECTED_TYPE, + (boost::tuple) + ); + return boost::get<0>(v); + } + + /*! + \brief Return indexable extracted from compatible type different than value_type. + + \param v The value. + \return The indexable. + */ + template + inline result_type operator()(boost::tuples::cons const& v) const + { + BOOST_MPL_ASSERT_MSG( + (is_referencable::value), + UNEXPECTED_TYPE, + (boost::tuples::cons) + ); + return boost::get<0>(v); + } + + /*! + \brief Prevent reference to temporary for types convertible to Value. + */ + template + inline result_type operator()(V const& v) const + { + return indexable_prevent_any_type(v); + } }; +/*! +\brief The function object extracting Indexable from Value. + +This specialization translates from boost::tuple. + +\tparam Indexable The Indexable type. +*/ +template +struct indexable, false> + : indexable_boost_tuple + < + boost::tuple, + Indexable + > +{}; + +/*! +\brief The function object extracting Indexable from Value. + +This specialization translates from boost::tuples::cons. + +\tparam Indexable The Indexable type. +*/ +template +struct indexable, false> + : indexable_boost_tuple + < + boost::tuples::cons, + Indexable + > +{}; + }}}} // namespace boost::geometry::index::detail #if !defined(BOOST_NO_CXX11_HDR_TUPLE) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) @@ -156,6 +303,32 @@ struct indexable, false> { return std::get<0>(v); } + + /*! + \brief Return indexable extracted from compatible type different than value_type. + + \param v The value. + \return The indexable. + */ + template + inline result_type operator()(std::tuple const& v) const + { + BOOST_MPL_ASSERT_MSG( + (is_referencable::value), + UNEXPECTED_TYPE, + (std::tuple) + ); + return std::get<0>(v); + } + + /*! + \brief Prevent reference to temporary for types convertible to Value. + */ + template + inline result_type operator()(V const& v) const + { + return indexable_prevent_any_type(v); + } }; }}}} // namespace boost::geometry::index::detail @@ -190,6 +363,20 @@ struct indexable { return detail::indexable::operator()(v); } + + /*! + \brief Return indexable extracted from the value. Overload for types + compatible with Value but different yet holding referencable + Indexable, e.g. tuple containing a reference. + + \param v The value. + \return The indexable. + */ + template + inline result_type operator()(V const& v) const + { + return detail::indexable::operator()(v); + } }; }}} // namespace boost::geometry::index From b012e4f5bf452087c115dbd0acad4a6d19535b1c Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Wed, 23 Jan 2019 10:04:54 +0100 Subject: [PATCH 18/48] [strategies] remove dead links and inspiration links --- .../boost/geometry/strategies/agnostic/hull_graham_andrew.hpp | 3 --- .../strategies/agnostic/point_in_poly_oriented_winding.hpp | 2 -- .../geometry/strategies/cartesian/point_in_poly_winding.hpp | 2 -- 3 files changed, 7 deletions(-) diff --git a/include/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp b/include/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp index 85d60ab85..f86dcbdd9 100644 --- a/include/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp +++ b/include/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp @@ -192,9 +192,6 @@ static inline void sort(Range& range) /*! \brief Graham scan strategy to calculate convex hull \ingroup strategies -\note Completely reworked version inspired on the sources listed below -\see http://www.ddj.com/architect/201806315 -\see http://marknelson.us/2007/08/22/convex */ template class graham_andrew diff --git a/include/boost/geometry/strategies/agnostic/point_in_poly_oriented_winding.hpp b/include/boost/geometry/strategies/agnostic/point_in_poly_oriented_winding.hpp index 423948fff..35aae192a 100644 --- a/include/boost/geometry/strategies/agnostic/point_in_poly_oriented_winding.hpp +++ b/include/boost/geometry/strategies/agnostic/point_in_poly_oriented_winding.hpp @@ -36,8 +36,6 @@ namespace strategy { namespace within \tparam PointOfSegment \tparam_segment_point \tparam CalculationType \tparam_calculation \author Barend Gehrels -\note The implementation is inspired by terralib http://www.terralib.org (LGPL) -\note but totally revised afterwards, especially for cases on segments \note Only dependant on "side", -> agnostic, suitable for spherical/latlong \qbk{ diff --git a/include/boost/geometry/strategies/cartesian/point_in_poly_winding.hpp b/include/boost/geometry/strategies/cartesian/point_in_poly_winding.hpp index d7f972758..696a86c98 100644 --- a/include/boost/geometry/strategies/cartesian/point_in_poly_winding.hpp +++ b/include/boost/geometry/strategies/cartesian/point_in_poly_winding.hpp @@ -44,8 +44,6 @@ namespace strategy { namespace within \tparam PointOfSegment \tparam_segment_point \tparam CalculationType \tparam_calculation \author Barend Gehrels -\note The implementation is inspired by terralib http://www.terralib.org (LGPL) -\note but totally revised afterwards, especially for cases on segments \qbk{ [heading See also] From 01a621d9b3bb419d045838cefd6935d51e8f8def Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Wed, 23 Jan 2019 10:18:43 +0100 Subject: [PATCH 19/48] [doc] Year changes, add missing parameters --- doc/geometry.qbk | 10 +++++----- .../algorithms/detail/overlay/self_turn_points.hpp | 2 ++ .../algorithms/detail/sections/sectionalize.hpp | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/geometry.qbk b/doc/geometry.qbk index 4cedb869e..409f3c9b2 100644 --- a/doc/geometry.qbk +++ b/doc/geometry.qbk @@ -1,10 +1,10 @@ [/============================================================================ Boost.Geometry (aka GGL, Generic Geometry Library) - Copyright (c) 2009-2018 Barend Gehrels, Amsterdam, the Netherlands. - Copyright (c) 2009-2018 Mateusz Loskot, London, UK. - Copyright (c) 2009-2018 Bruno Lalande, Paris, France. - Copyright (c) 2011-2018 Adam Wulkiewicz, Lodz, Poland. + Copyright (c) 2009-2019 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2009-2019 Mateusz Loskot, London, UK. + Copyright (c) 2009-2019 Bruno Lalande, Paris, France. + Copyright (c) 2011-2019 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 @@ -14,7 +14,7 @@ [library Geometry [quickbook 1.5] [authors [Gehrels, Barend], [Lalande, Bruno], [Loskot, Mateusz], [Wulkiewicz, Adam], [Karavelas, Menelaos], [Fisikopoulos, Vissarion]] - [copyright 2009-2018 Barend Gehrels, Bruno Lalande, Mateusz Loskot, Adam Wulkiewicz, Oracle and/or its affiliates] + [copyright 2009-2019 Barend Gehrels, Bruno Lalande, Mateusz Loskot, Adam Wulkiewicz, Oracle and/or its affiliates] [purpose Documentation of Boost.Geometry library] [license Distributed under the Boost Software License, Version 1.0. diff --git a/include/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp b/include/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp index a7a87a16a..261d2c4b0 100644 --- a/include/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp @@ -336,6 +336,8 @@ inline void self_turns(Geometry const& geometry, \param turns container which will contain intersection points \param interrupt_policy policy determining if process is stopped when intersection is found + \param source_index source index for generated turns + \param skip_adjacent indicates if adjacent turns should be skipped */ template < diff --git a/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp b/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp index aca1029ee..6ece756cd 100644 --- a/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp +++ b/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp @@ -928,6 +928,8 @@ struct sectionalize Date: Wed, 23 Jan 2019 15:24:28 +0100 Subject: [PATCH 20/48] [enrich] discard blocked clusters, change comments --- .../detail/overlay/enrich_intersection_points.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp b/include/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp index a35be052a..287a06b08 100644 --- a/include/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp @@ -441,18 +441,21 @@ inline void enrich_intersection_points(Turns& turns, if (turn.both(detail::overlay::operation_none) || turn.both(opposite_operation) + || turn.both(detail::overlay::operation_blocked) || (detail::overlay::is_self_turn(turn) && ! turn.is_clustered() && ! turn.both(target_operation))) { + // For all operations, discard xx and none/none // For intersections, remove uu to avoid the need to travel // a union (during intersection) in uu/cc clusters (e.g. #31,#32,#33) + // The ux is necessary to indicate impossible paths + // (especially if rescaling is removed) - // Similarly, for union, discard ii + // Similarly, for union, discard ii and ix - // Only keep self-uu-turns or self-ii-turns + // For self-turns, only keep uu / ii - // Blocked (or combination with blocked is still needed for difference) turn.discarded = true; turn.cluster_id = -1; continue; From 01812b3152de03140934b74df56591d9818232f3 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Wed, 23 Jan 2019 15:34:05 +0100 Subject: [PATCH 21/48] [traverse] if both turns continue, select the one possible one with the best remaining distance (either min or max). This changes behavior for union. --- .../algorithms/detail/overlay/traversal.hpp | 43 +++++++++++++------ 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/overlay/traversal.hpp b/include/boost/geometry/algorithms/detail/overlay/traversal.hpp index 90ee24013..df4e1f6f8 100644 --- a/include/boost/geometry/algorithms/detail/overlay/traversal.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/traversal.hpp @@ -352,35 +352,52 @@ struct traversal // If both are valid candidates, take the one with minimal remaining // distance (important for #mysql_23023665 in buffer). - // Initialize with 0, automatically assigned on first result + turn_operation_type const& op0 = turn.operations[0]; + turn_operation_type const& op1 = turn.operations[1]; + signed_size_type const next0 = op0.enriched.get_next_turn_index(); + signed_size_type const next1 = op1.enriched.get_next_turn_index(); + + bool possible[2]; + possible[0] = traverse_possible(next0); + possible[1] = traverse_possible(next1); + + bool const close0 = possible[0] && next0 == start_turn_index; + bool const close1 = possible[1] && next1 == start_turn_index; + + if (close0 != close1) + { + // One of the operations will finish the ring. Take that one. + selected_op_index = close0 ? 0 : 1; + debug_traverse(turn, turn.operations[selected_op_index], "Candidate cc closing"); + return true; + } + + static bool const is_union = target_operation == operation_union; + typename turn_operation_type::comparable_distance_type - min_remaining_distance = 0; + best_remaining_distance = 0; bool result = false; for (int i = 0; i < 2; i++) { - turn_operation_type const& op = turn.operations[i]; - - signed_size_type const next_turn_index = op.enriched.get_next_turn_index(); - - if (! traverse_possible(next_turn_index)) + if (!possible[i]) { continue; } + turn_operation_type const& op = turn.operations[i]; + if (! result - || next_turn_index == start_turn_index - || op.remaining_distance < min_remaining_distance) + || (is_union && op.remaining_distance > best_remaining_distance) + || (!is_union && op.remaining_distance < best_remaining_distance)) { debug_traverse(turn, op, "First candidate cc", ! result); - debug_traverse(turn, op, "Candidate cc override (start)", - result && next_turn_index == start_turn_index); debug_traverse(turn, op, "Candidate cc override (remaining)", - result && op.remaining_distance < min_remaining_distance); + result && op.remaining_distance < best_remaining_distance); selected_op_index = i; - min_remaining_distance = op.remaining_distance; + best_remaining_distance = op.remaining_distance; result = true; } } From 1300f8f816f20920dc475918886b59550cc773df Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Wed, 23 Jan 2019 15:37:19 +0100 Subject: [PATCH 22/48] [get_turn] add generic preparations, preparing removing rescaling --- .../detail/overlay/get_turn_info.hpp | 72 +++++++++++++++---- .../detail/overlay/get_turn_info_helpers.hpp | 6 ++ 2 files changed, 63 insertions(+), 15 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp index 815bcb928..8e536b110 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp @@ -84,7 +84,7 @@ struct base_turn_handler return side1 * side2 == 1; } - // Both continue + // Both get the same operation template static inline void both(TurnInfo& ti, operation_type const op) { @@ -130,6 +130,17 @@ struct base_turn_handler ? 1 : 0; } + template + static inline typename geometry::coordinate_type::type + distance_measure(Point1 const& a, Point2 const& b) + { + // TODO: use comparable distance for point-point instead - but that + // causes currently cycling include problems + typedef typename geometry::coordinate_type::type ctype; + ctype const dx = get<0>(a) - get<0>(b); + ctype const dy = get<1>(a) - get<1>(b); + return dx * dx + dy * dy; + } }; @@ -185,6 +196,9 @@ struct touch_interior : public base_turn_handler int const side_qk_q = has_k ? side.qk_wrt_q1() : 0; + // Only necessary if rescaling is turned off: + int const side_pj_q2 = side.pj_wrt_q2(); + if (side_qi_p == -1 && side_qk_p == -1 && side_qk_q == 1) { // Q turns left on the right side of P (test "MR3") @@ -194,10 +208,21 @@ struct touch_interior : public base_turn_handler } else if (side_qi_p == 1 && side_qk_p == 1 && side_qk_q == -1) { + if (side_pj_q2 == -1) + { // Q turns right on the left side of P (test "ML3") - // Union: take both operation + // Union: take both operations // Intersection: skip both(ti, operation_union); + } + else + { + // q2 is collinear with p1, so it does not turn back. This + // can happen in floating point precision. In this case, + // block one of the operations to avoid taking that path. + ti.operations[index_p].operation = operation_union; + ti.operations[index_q].operation = operation_blocked; + } ti.touch_only = true; } else if (side_qi_p == side_qk_p && side_qi_p == side_qk_q) @@ -207,6 +232,29 @@ struct touch_interior : public base_turn_handler // Union: take left turn (Q if Q turns left, P if Q turns right) // Intersection: other turn unsigned int index = side_qk_q == 1 ? index_q : index_p; + if (side_pj_q2 == 0) + { + // Even though sides xk w.r.t. 1 are distinct, pj is collinear + // with q. Therefore swap the path + index = 1 - index; + } + + if (opposite(side_pj_q2, side_qi_p)) + { + // Without rescaling, floating point requires extra measures + int const side_qj_p1 = side.qj_wrt_p1(); + int const side_qj_p2 = side.qj_wrt_p2(); + + if (same(side_qj_p1, side_qj_p2)) + { + int const side_pj_q1 = side.pj_wrt_q1(); + if (opposite(side_pj_q1, side_pj_q2)) + { + index = 1 - index; + } + } + } + ti.operations[index].operation = operation_union; ti.operations[1 - index].operation = operation_intersection; ti.touch_only = true; @@ -219,10 +267,16 @@ struct touch_interior : public base_turn_handler // Collinearly in the same direction // (Q comes from left of P and turns left, // OR Q comes from right of P and turns right) - // Omit intersection point. + // Omit second intersection point. // Union: just continue // Intersection: just continue both(ti, operation_continue); + + // Calculate remaining distance. + // Q arrives at p, at point qj, so use qk for q + // and use pj for p + ti.operations[index_p].remaining_distance = distance_measure(ti.point, range_p.at(1)); + ti.operations[index_q].remaining_distance = distance_measure(ti.point, range_q.at(2)); } else { @@ -641,18 +695,6 @@ struct collinear : public base_turn_handler ? distance_measure(ti.point, range_q.at(2)) : distance_measure(ti.point, range_q.at(1)); } - - template - static inline typename geometry::coordinate_type::type - distance_measure(Point1 const& a, Point2 const& b) - { - // TODO: use comparable distance for point-point instead - but that - // causes currently cycling include problems - typedef typename geometry::coordinate_type::type ctype; - ctype const dx = get<0>(a) - get<0>(b); - ctype const dy = get<1>(a) - get<1>(b); - return dx * dx + dy * dy; - } }; template diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_helpers.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_helpers.hpp index 6640fdd1e..d61e12156 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_helpers.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_helpers.hpp @@ -66,6 +66,12 @@ struct side_calculator inline int pk_wrt_q2() const { return m_side_strategy.apply(get_qj(), get_qk(), get_pk()); } inline int qk_wrt_p2() const { return m_side_strategy.apply(get_pj(), get_pk(), get_qk()); } + // Necessary when rescaling turns off: + inline int qj_wrt_p1() const { return m_side_strategy.apply(get_pi(), get_pj(), get_qj()); } + inline int qj_wrt_p2() const { return m_side_strategy.apply(get_pj(), get_pk(), get_qj()); } + inline int pj_wrt_q1() const { return m_side_strategy.apply(get_qi(), get_qj(), get_pj()); } + inline int pj_wrt_q2() const { return m_side_strategy.apply(get_qj(), get_qk(), get_pj()); } + inline point1_type const& get_pi() const { return m_range_p.at(0); } inline point1_type const& get_pj() const { return m_range_p.at(1); } inline point1_type const& get_pk() const { return m_range_p.at(2); } From e8156729c89838847fa3509ded97dca3d3cf9cfb Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Wed, 23 Jan 2019 15:46:19 +0100 Subject: [PATCH 23/48] [traverse] fix early finish, only if next turn index of that operation is the start index --- .../algorithms/detail/overlay/traversal_ring_creator.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/overlay/traversal_ring_creator.hpp b/include/boost/geometry/algorithms/detail/overlay/traversal_ring_creator.hpp index 7f80c8313..92fd6d540 100644 --- a/include/boost/geometry/algorithms/detail/overlay/traversal_ring_creator.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/traversal_ring_creator.hpp @@ -208,10 +208,11 @@ struct traversal_ring_creator if (start_turn.is_clustered()) { - turn_type const& turn = m_turns[current_turn_index]; - if (turn.cluster_id == start_turn.cluster_id) + turn_type& turn = m_turns[current_turn_index]; + turn_operation_type& op = turn.operations[current_op_index]; + if (turn.cluster_id == start_turn.cluster_id + && op.enriched.get_next_turn_index() == start_turn_index) { - turn_operation_type& op = m_turns[start_turn_index].operations[current_op_index]; op.visited.set_finished(); m_visitor.visit_traverse(m_turns, m_turns[current_turn_index], start_op, "Early finish (cluster)"); return traverse_error_none; From 201a361f5a4dbcdc8af99d0b8601da5f1c7baa16 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Wed, 23 Jan 2019 15:47:11 +0100 Subject: [PATCH 24/48] [traverse] fix traverse, use smallest remaining distance for intersection, but for union use largest --- .../detail/overlay/traversal_ring_creator.hpp | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/overlay/traversal_ring_creator.hpp b/include/boost/geometry/algorithms/detail/overlay/traversal_ring_creator.hpp index 92fd6d540..7ab678f9b 100644 --- a/include/boost/geometry/algorithms/detail/overlay/traversal_ring_creator.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/traversal_ring_creator.hpp @@ -307,6 +307,23 @@ struct traversal_ring_creator } } + int get_operation_index(turn_type const& turn) const + { + // When starting with a continue operation, the one + // with the smallest (for intersection) or largest (for union) + // remaining distance (#8310b) + // Also to avoid skipping a turn in between, which can happen + // in rare cases (e.g. #130) + static const bool is_union + = operation_from_overlay::value == operation_union; + + turn_operation_type const& op0 = turn.operations[0]; + turn_operation_type const& op1 = turn.operations[1]; + return op0.remaining_distance <= op1.remaining_distance + ? (is_union ? 1 : 0) + : (is_union ? 0 : 1); + } + template void iterate(Rings& rings, std::size_t& finalized_ring_size, typename Backtrack::state_type& state) @@ -323,15 +340,8 @@ struct traversal_ring_creator if (turn.both(operation_continue)) { - // Traverse only one turn, the one with the SMALLEST remaining distance - // to avoid skipping a turn in between, which can happen in rare cases - // (e.g. #130) - turn_operation_type const& op0 = turn.operations[0]; - turn_operation_type const& op1 = turn.operations[1]; - int const op_index - = op0.remaining_distance <= op1.remaining_distance ? 0 : 1; - - traverse_with_operation(turn, turn_index, op_index, + traverse_with_operation(turn, turn_index, + get_operation_index(turn), rings, finalized_ring_size, state); } else @@ -374,13 +384,8 @@ struct traversal_ring_creator if (turn.both(operation_continue)) { - // Traverse only one turn, the one with the SMALLEST remaining distance - // to avoid skipping a turn in between, which can happen in rare cases - // (e.g. #130) - int const op_index - = op0.remaining_distance <= op1.remaining_distance ? 0 : 1; - - traverse_with_operation(turn, turn_index, op_index, + traverse_with_operation(turn, turn_index, + get_operation_index(turn), rings, finalized_ring_size, state); } else From 237adbc4213d88c6d080a2096440f710f5aff1f2 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Wed, 23 Jan 2019 21:06:27 +0100 Subject: [PATCH 25/48] [overlay] fix administration of traversed rings, a discarded self-turn should not count as traversed --- .../boost/geometry/algorithms/detail/overlay/overlay.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/boost/geometry/algorithms/detail/overlay/overlay.hpp b/include/boost/geometry/algorithms/detail/overlay/overlay.hpp index 5094c6c96..8a8561c13 100644 --- a/include/boost/geometry/algorithms/detail/overlay/overlay.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/overlay.hpp @@ -125,6 +125,12 @@ inline void get_ring_turn_info(TurnInfoMap& turn_info_map, Turns const& turns, C bool cluster_checked = false; bool has_blocked = false; + if (is_self_turn(turn) && turn.discarded) + { + // Discarded self-turns don't count as traversed + continue; + } + for (typename boost::range_iterator::type op_it = boost::begin(turn.operations); op_it != boost::end(turn.operations); From 38cf3794481c05e813eb714a1111714f883daa33 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Wed, 23 Jan 2019 21:58:51 +0100 Subject: [PATCH 26/48] [test] Add testcase for reported issue --- test/algorithms/overlay/multi_overlay_cases.hpp | 10 ++++++++++ .../set_operations/intersection/intersection_multi.cpp | 5 +++++ test/algorithms/set_operations/union/union_multi.cpp | 3 +++ 3 files changed, 18 insertions(+) diff --git a/test/algorithms/overlay/multi_overlay_cases.hpp b/test/algorithms/overlay/multi_overlay_cases.hpp index 9b40f2a23..219957456 100644 --- a/test/algorithms/overlay/multi_overlay_cases.hpp +++ b/test/algorithms/overlay/multi_overlay_cases.hpp @@ -1361,6 +1361,16 @@ static std::string ggl_list_20140212_sybren[2] = "MULTIPOLYGON(((0.4951091661995328 0.6614133543986973,0.495396 0.625263,0.50092 0.6492750000000001,0.494964 0.679709,0.477258 0.698703,0.4951091661995328 0.6614133543986973)),((0.452167 0.706562,0.433379 0.696888,0.442673 0.65792,0.464729 0.671387,0.452167 0.706562)))" }; +static std::string mail_2019_01_21_johan[4] = + { + // Contains a, b, both a and b (should have been merged), c (clip) + "MULTIPOLYGON(((1.2036811113357544 0.7535473108291626,1.1699721813201904 0.7535473108291626,1.1699721813201904 0.7663263082504272,1.2033243179321289 0.7672826647758484,1.2036811113357544 0.7535473108291626)))", + "MULTIPOLYGON(((1.2036811113357544 0.7535473108291626,1.2038091421127319 0.7486215233802795,1.1713759899139404 0.7495520114898682,1.1713759899139404 0.7535472512245178,1.2036811113357544 0.7535473108291626)))", + "MULTIPOLYGON(((1.2036811113357544 0.7535473108291626,1.1699721813201904 0.7535473108291626,1.1699721813201904 0.7663263082504272,1.2033243179321289 0.7672826647758484,1.2036811113357544 0.7535473108291626))," + "((1.2036811113357544 0.7535473108291626,1.2038091421127319 0.7486215233802795,1.1713759899139404 0.7495520114898682,1.1713759899139404 0.7535472512245178,1.2036811113357544 0.7535473108291626)))", + "MULTIPOLYGON(((0 0,2 0,2 2,0 2,0 0)))" + }; + static std::string ticket_9081[2] = { "MULTIPOLYGON(((0.5489109414010371 0.5774835110050927,0.4099611282054447 0.4644351568071598,0.4294011278595494 0.4843224236729239,0.4205359995313906 0.5115225580860201,0.4441572412013468 0.5184999851878852,0.5489109414010371 0.5774835110050927)),((0.562085028126843 0.5882018328808966,0.5644349663154944 0.591180348361206,0.568218114394707 0.5970364466647042,0.5838690879677763 0.6212632646137447,0.5873787029417971 0.6412877041753083,0.468699602592386 0.5866280231830688,0.4171010902425981 0.5220616039851281,0.4059124592966251 0.5563907478354578,0.3909547828925878 0.6022841397455458,0.520859401226844 0.9508041627246925,0.8595233008819849 0.8301950132755517,0.562085028126843 0.5882018328808966)))", diff --git a/test/algorithms/set_operations/intersection/intersection_multi.cpp b/test/algorithms/set_operations/intersection/intersection_multi.cpp index c208148f8..a0f4a215f 100644 --- a/test/algorithms/set_operations/intersection/intersection_multi.cpp +++ b/test/algorithms/set_operations/intersection/intersection_multi.cpp @@ -379,6 +379,11 @@ void test_areal() ticket_9081[0], ticket_9081[1], 2, 10, 0.0019812556); + // Should generate output, even for + test_one("mail_2019_01_21_johan", + mail_2019_01_21_johan[2], mail_2019_01_21_johan[3], + 2, -1, 0.0005889587); + // qcc-arm reports 1.7791215549400884e-14 test_one("ticket_11018", ticket_11018[0], ticket_11018[1], diff --git a/test/algorithms/set_operations/union/union_multi.cpp b/test/algorithms/set_operations/union/union_multi.cpp index 988b4af01..387ac5553 100644 --- a/test/algorithms/set_operations/union/union_multi.cpp +++ b/test/algorithms/set_operations/union/union_multi.cpp @@ -460,6 +460,9 @@ void test_areal() TEST_UNION(ticket_12503, 42, 1, -1, 945.625); + // Generates two polygons, which should (without rescaling) be merged into one + TEST_UNION(mail_2019_01_21_johan, 2, 0, -1, 0.00058896); + #ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_UNION(mysql_23023665_7, 1, 1, -1, 99.19494); #else From 5ea1abcedc301bcacf6fcff157b4cd88184eab2f Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Thu, 24 Jan 2019 19:10:55 +0100 Subject: [PATCH 27/48] [relate] Use RobustPolicy based on parameters, for consistency with set operations. --- include/boost/geometry/algorithms/detail/relate/turns.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/boost/geometry/algorithms/detail/relate/turns.hpp b/include/boost/geometry/algorithms/detail/relate/turns.hpp index 6fa05eaf2..01c4304fa 100644 --- a/include/boost/geometry/algorithms/detail/relate/turns.hpp +++ b/include/boost/geometry/algorithms/detail/relate/turns.hpp @@ -48,7 +48,11 @@ template < Geometry1, Geometry2, assign_policy<> >, - typename RobustPolicy = detail::no_rescale_policy + typename RobustPolicy = typename geometry::rescale_overlay_policy_type + < + Geometry1, + Geometry2 + >::type > struct get_turns { From 2e19b75876caad5f0572f65d565a3fc6c92bde75 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Fri, 25 Jan 2019 21:13:28 +0100 Subject: [PATCH 28/48] [setops] Disable validity testing for several cases. --- .../set_operations/difference/difference.cpp | 14 +++++++++--- .../difference/difference_multi.cpp | 15 +++++++++---- .../set_operations/union/union_multi.cpp | 22 +++++++++++++------ 3 files changed, 37 insertions(+), 14 deletions(-) diff --git a/test/algorithms/set_operations/difference/difference.cpp b/test/algorithms/set_operations/difference/difference.cpp index e29392f4e..51ff33a2b 100644 --- a/test/algorithms/set_operations/difference/difference.cpp +++ b/test/algorithms/set_operations/difference/difference.cpp @@ -63,6 +63,11 @@ void test_all() sym_settings.sym_difference = false; #endif + ut_settings ignore_validity_settings; +#ifndef BOOST_GEOMETRY_TEST_INCLUDE_FAILING_TESTS + ignore_validity_settings.test_validity = false; +#endif + test_one("simplex_normal", simplex_normal[0], simplex_normal[1], 3, 12, 2.52636706856656, @@ -156,12 +161,14 @@ void test_all() test_one("intersect_holes_intersect_and_disjoint", intersect_holes_intersect_and_disjoint[0], intersect_holes_intersect_and_disjoint[1], 2, 16, 15.75, - 3, 17, 6.75); + 3, 17, 6.75, + ignore_validity_settings); test_one("intersect_holes_intersect_and_touch", intersect_holes_intersect_and_touch[0], intersect_holes_intersect_and_touch[1], 3, 21, 16.25, - 3, 17, 6.25); + 3, 17, 6.25, + ignore_validity_settings); { ut_settings settings = sym_settings; @@ -186,7 +193,8 @@ void test_all() test_one("intersect_holes_intersect", intersect_holes_intersect[0], intersect_holes_intersect[1], 2, 16, 15.75, - 2, 12, 5.75); + 2, 12, 5.75, + ignore_validity_settings); test_one( "case4", case_4[0], case_4[1], diff --git a/test/algorithms/set_operations/difference/difference_multi.cpp b/test/algorithms/set_operations/difference/difference_multi.cpp index 6c7d13327..25e82b1c3 100644 --- a/test/algorithms/set_operations/difference/difference_multi.cpp +++ b/test/algorithms/set_operations/difference/difference_multi.cpp @@ -175,12 +175,19 @@ void test_areal() TEST_DIFFERENCE_WITH(0, 1, bug_21155501, 1, 3.758937, 1, 1.7763568394002505e-15, 2); } #else - // With no-robustness this one misses one of the outputs - test_one("ticket_9081", - ticket_9081[0], ticket_9081[1], + { + // With no-robustness this one misses one of the outputs + ut_settings settings; + settings.percentage = 0.001; // tolerance +#if !defined(BOOST_GEOMETRY_NO_ROBUSTNESS) && !defined(BOOST_GEOMETRY_TEST_INCLUDE_FAILING_TESTS) + settings.test_validity = false; +#endif + test_one("ticket_9081", + ticket_9081[0], ticket_9081[1], 2, 28, 0.0907392476356186, 4, 25, 0.126018011439877, 4, 42, 0.0907392476356186 + 0.126018011439877, - tolerance(0.001)); + settings); + } // With rescaling, A is invalid (this is a robustness problem) and the other // output is discarded because of zero (rescaled) area diff --git a/test/algorithms/set_operations/union/union_multi.cpp b/test/algorithms/set_operations/union/union_multi.cpp index 387ac5553..8aeec22e1 100644 --- a/test/algorithms/set_operations/union/union_multi.cpp +++ b/test/algorithms/set_operations/union/union_multi.cpp @@ -431,14 +431,22 @@ void test_areal() ggl_list_20140212_sybren[0], ggl_list_20140212_sybren[1], 2, 0, 16, 0.002471626); - test_one("ticket_9081", - ticket_9081[0], ticket_9081[1], -#if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) - 3, -#else - 4, + { + ut_settings settings; +#if !defined(BOOST_GEOMETRY_NO_ROBUSTNESS) && !defined(BOOST_GEOMETRY_TEST_INCLUDE_FAILING_TESTS) + settings.test_validity = false; #endif - 0, 31, 0.2187385); + + test_one("ticket_9081", + ticket_9081[0], ticket_9081[1], +#if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) + 3, +#else + 4, +#endif + 0, 31, 0.2187385, + settings); + } test_one("ticket_10803", ticket_10803[0], ticket_10803[1], From 5d14e969cb8beeef1eb0addf8c0670a393e28569 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Wed, 30 Jan 2019 10:46:35 +0100 Subject: [PATCH 29/48] [traversal] support linked clusters, which can be handled differently (simpler). They occur more if rescaling is removed and fractions (segment ratios) are double values instead of ratios. --- .../algorithms/detail/overlay/traversal.hpp | 201 +++++++++++++++++- 1 file changed, 191 insertions(+), 10 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/overlay/traversal.hpp b/include/boost/geometry/algorithms/detail/overlay/traversal.hpp index 6acdff6aa..361b2f9c8 100644 --- a/include/boost/geometry/algorithms/detail/overlay/traversal.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/traversal.hpp @@ -105,6 +105,23 @@ template > struct traversal { +private : + struct linked_turn_op_info + { + explicit linked_turn_op_info(signed_size_type ti = -1, int oi = -1, + signed_size_type nti = -1) + : turn_index(ti) + , op_index(oi) + , next_turn_index(nti) + , rank_index(-1) + {} + + signed_size_type turn_index; + int op_index; + signed_size_type next_turn_index; + signed_size_type rank_index; + }; + static const operation_type target_operation = operation_from_overlay::value; typedef typename side_compare::type side_compare_type; @@ -118,6 +135,7 @@ struct traversal point_type, SideStrategy, side_compare_type > sbs_type; +public : inline traversal(Geometry1 const& geometry1, Geometry2 const& geometry2, Turns& turns, Clusters const& clusters, RobustPolicy const& robust_policy, SideStrategy const& strategy, @@ -729,24 +747,155 @@ struct traversal return false; } - inline bool select_turn_from_cluster(signed_size_type& turn_index, + inline signed_size_type get_rank(sbs_type const& sbs, + linked_turn_op_info const& info) const + { + for (std::size_t i = 0; i < sbs.m_ranked_points.size(); i++) + { + typename sbs_type::rp const& rp = sbs.m_ranked_points[i]; + if (rp.turn_index == info.turn_index + && rp.operation_index == info.op_index + && rp.direction == sort_by_side::dir_to) + { + return rp.rank; + } + } + return -1; + } + + // Function checks simple cases, such as a cluster with two turns, + // arriving at the first turn, first turn points to second turn, + // second turn points further. + inline bool select_turn_from_cluster_linked(signed_size_type& turn_index, int& op_index, - signed_size_type start_turn_index, int start_op_index, + std::set const& ids, segment_identifier const& previous_seg_id) const { - bool const is_union = target_operation == operation_union; + typedef typename std::set::const_iterator sit_type; - turn_type const& turn = m_turns[turn_index]; - BOOST_ASSERT(turn.is_clustered()); + std::vector possibilities; + std::vector blocked; + for (sit_type it = ids.begin(); it != ids.end(); ++it) + { + signed_size_type cluster_turn_index = *it; + turn_type const& cluster_turn = m_turns[cluster_turn_index]; + if (cluster_turn.discarded) + { + continue; + } + if (is_self_turn(cluster_turn) + || cluster_turn.both(target_operation)) + { + // Not (yet) supported, can be cluster of u/u turns + return false; + } + for (int i = 0; i < 2; i++) + { + turn_operation_type const& op = cluster_turn.operations[i]; + turn_operation_type const& other_op = cluster_turn.operations[1 - i]; + signed_size_type const ni = op.enriched.get_next_turn_index(); + if (op.operation == target_operation + || op.operation == operation_continue) + { + if (ni == cluster_turn_index) + { + // Not (yet) supported, traveling to itself, can be + // hole + return false; + } + possibilities.push_back( + linked_turn_op_info(cluster_turn_index, i, ni)); + } + else if (op.operation == operation_blocked + && ! (ni == other_op.enriched.get_next_turn_index()) + && ids.count(ni) == 0) + { + // Points to turn, not part of this cluster, + // and that way is blocked. But if the other operation + // points at the same turn, it is still fine. + blocked.push_back( + linked_turn_op_info(cluster_turn_index, i, ni)); + } + } + } - typename Clusters::const_iterator mit = m_clusters.find(turn.cluster_id); - BOOST_ASSERT(mit != m_clusters.end()); - - cluster_info const& cinfo = mit->second; - std::set const& ids = cinfo.turn_indices; + typedef typename std::vector::const_iterator const_it_type; + if (! blocked.empty()) + { sbs_type sbs(m_strategy); + if (! fill_sbs(sbs, turn_index, ids, previous_seg_id)) + { + return false; + } + + for (typename std::vector::iterator it = possibilities.begin(); + it != possibilities.end(); ++it) + { + linked_turn_op_info& info = *it; + info.rank_index = get_rank(sbs, info); + } + for (typename std::vector::iterator it = blocked.begin(); + it != blocked.end(); ++it) + { + linked_turn_op_info& info = *it; + info.rank_index = get_rank(sbs, info); + } + + + for (const_it_type it = possibilities.begin(); + it != possibilities.end(); ++it) + { + linked_turn_op_info const& lti = *it; + for (const_it_type bit = blocked.begin(); + bit != blocked.end(); ++bit) + { + linked_turn_op_info const& blti = *bit; + if (blti.next_turn_index == lti.next_turn_index + && blti.rank_index == lti.rank_index) + { + return false; + } + } + } + } + + // Traveral can either enter the cluster in the first turn, + // or it can start halfway. + // If there is one (and only one) possibility pointing outside + // the cluster, take that one. + linked_turn_op_info target; + for (const_it_type it = possibilities.begin(); + it != possibilities.end(); ++it) + { + linked_turn_op_info const& lti = *it; + if (ids.count(lti.next_turn_index) == 0) + { + if (target.turn_index >= 0 + && target.next_turn_index != lti.next_turn_index) + { + return false; + } + target = lti; + } + } + if (target.turn_index < 0) + { + return false; + } + + turn_index = target.turn_index; + op_index = target.op_index; + + return true; + } + + inline bool fill_sbs(sbs_type& sbs, + signed_size_type turn_index, + std::set const& ids, + segment_identifier const& previous_seg_id) const + { for (typename std::set::const_iterator sit = ids.begin(); sit != ids.end(); ++sit) { @@ -772,7 +921,39 @@ struct traversal { return false; } + turn_type const& turn = m_turns[turn_index]; sbs.apply(turn.point); + return true; + } + + + inline bool select_turn_from_cluster(signed_size_type& turn_index, + int& op_index, + signed_size_type start_turn_index, int start_op_index, + segment_identifier const& previous_seg_id) const + { + bool const is_union = target_operation == operation_union; + + turn_type const& turn = m_turns[turn_index]; + BOOST_ASSERT(turn.is_clustered()); + + typename Clusters::const_iterator mit = m_clusters.find(turn.cluster_id); + BOOST_ASSERT(mit != m_clusters.end()); + + cluster_info const& cinfo = mit->second; + std::set const& ids = cinfo.turn_indices; + + if (select_turn_from_cluster_linked(turn_index, op_index, ids, previous_seg_id)) + { + return true; + } + + sbs_type sbs(m_strategy); + + if (! fill_sbs(sbs, turn_index, ids, previous_seg_id)) + { + return false; + } bool result = false; From 346e452f63436d6d7f5f705468c1d109ea11b6a0 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Wed, 30 Jan 2019 13:00:35 +0100 Subject: [PATCH 30/48] [traversal][buffer] take care the right cc operation is selected for buffer --- .../algorithms/detail/overlay/traversal.hpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/boost/geometry/algorithms/detail/overlay/traversal.hpp b/include/boost/geometry/algorithms/detail/overlay/traversal.hpp index 361b2f9c8..33badf08c 100644 --- a/include/boost/geometry/algorithms/detail/overlay/traversal.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/traversal.hpp @@ -392,6 +392,25 @@ public : return true; } + if (OverlayType == overlay_buffer && possible[0] && possible[1]) + { + // Buffers sometimes have multiple overlapping pieces, where remaining + // distance could lead to the wrong choice. Take the matcing operation. + turn_operation_type const& next_op0 = m_turns[next0].operations[0]; + turn_operation_type const& next_op1 = m_turns[next1].operations[1]; + + bool const is_target0 = next_op0.operation == target_operation; + bool const is_target1 = next_op1.operation == target_operation; + + if (is_target0 != is_target1) + { + // One of the operations will finish the ring. Take that one. + selected_op_index = is_target0 ? 0 : 1; + debug_traverse(turn, turn.operations[selected_op_index], "Candidate cc target"); + return true; + } + } + static bool const is_union = target_operation == operation_union; typename turn_operation_type::comparable_distance_type From e83b8060cc305b7c02767e20ac452b0261204a99 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Wed, 30 Jan 2019 14:35:54 +0100 Subject: [PATCH 31/48] [traverse][buffer] fix wrong traversal when there are multiple paths --- .../geometry/algorithms/detail/overlay/traversal.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/boost/geometry/algorithms/detail/overlay/traversal.hpp b/include/boost/geometry/algorithms/detail/overlay/traversal.hpp index 33badf08c..d95284b7f 100644 --- a/include/boost/geometry/algorithms/detail/overlay/traversal.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/traversal.hpp @@ -842,7 +842,7 @@ public : if (! blocked.empty()) { - sbs_type sbs(m_strategy); + sbs_type sbs(m_strategy); if (! fill_sbs(sbs, turn_index, ids, previous_seg_id)) { @@ -894,8 +894,16 @@ public : if (target.turn_index >= 0 && target.next_turn_index != lti.next_turn_index) { + // Points to different target return false; } + if (OverlayType == overlay_buffer && target.turn_index > 0) + { + // Target already assigned, so there are more targets + // or more ways to the same target + return false; + } + target = lti; } } From e9b81ed8773a0f3bb2f56c70f081c92bae26c3e5 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Wed, 30 Jan 2019 15:23:56 +0100 Subject: [PATCH 32/48] [test] add testcases, minor changes in existing testcases --- .../overlay/multi_overlay_cases.hpp | 12 +++ test/algorithms/overlay/overlay_cases.hpp | 82 +++++++++++++++++++ .../set_operations/difference/difference.cpp | 8 +- .../difference/difference_multi.cpp | 5 ++ .../difference/test_difference.hpp | 10 ++- .../intersection/intersection.cpp | 60 +++++++++++--- .../intersection/intersection_multi.cpp | 15 ++++ .../intersection/test_intersection.hpp | 10 ++- .../algorithms/set_operations/union/union.cpp | 81 +++++++++++++----- 9 files changed, 246 insertions(+), 37 deletions(-) diff --git a/test/algorithms/overlay/multi_overlay_cases.hpp b/test/algorithms/overlay/multi_overlay_cases.hpp index 219957456..68215f842 100644 --- a/test/algorithms/overlay/multi_overlay_cases.hpp +++ b/test/algorithms/overlay/multi_overlay_cases.hpp @@ -1323,6 +1323,18 @@ static std::string pie_7_2_1_0_15[2] = "MULTIPOLYGON(((2500 2500,2791 3586,3062 3474,2500 2500)),((2500 2500,3474 3062,3586 2791,3625 2500,3586 2208,3474 1937,3295 1704,3062 1525,2791 1413,2499 1375,2208 1413,1937 1525,1704 1704,1525 1937,1413 2208,1375 2500,2500 2500)))" }; +static std::string case_precision_m1[2] = +{ + "MULTIPOLYGON(((0 0,0 4,2 4,2 3,4 3,4 0,0 0)))", + "MULTIPOLYGON(((-1 -1,-1 8,2 8,2 7,2 3,4.0000005 2.9999995,4 7,4 8,8 8,8 -1,-1 -1)))" +}; + +static std::string case_precision_m2[2] = +{ + "MULTIPOLYGON(((0 0,0 4,2 4,2 3,4 3,4 0,0 0)),((3 6,3 7.5,4.5 7.5,4.5 6,3 6)))", + "MULTIPOLYGON(((-1 -1,-1 8,8 8,8 -1,-1 -1),(2 7,2 3,4.0000005 2.9999995,4 7,2 7)))" +}; + // Case, not literally on this list but derived, to mix polygon/multipolygon in call to difference static std::string ggl_list_20111025_vd[4] = { diff --git a/test/algorithms/overlay/overlay_cases.hpp b/test/algorithms/overlay/overlay_cases.hpp index c917af845..a84812a2d 100644 --- a/test/algorithms/overlay/overlay_cases.hpp +++ b/test/algorithms/overlay/overlay_cases.hpp @@ -700,6 +700,88 @@ static std::string dz_4[2] = { "POLYGON((20.486696243286133 60.650150299072266,24.282432556152344 49.304500579833984,34.362251281738281 55.748767852783203,30.764263153076172 44.3388671875,42.706855773925781 43.627620697021484,33.089447021484375 36.511661529541016,42.333145141601563 28.916570663452148,30.369846343994141 28.81260871887207,33.383872985839844 17.234743118286133,23.644252777099609 24.182485580444336,19.277351379394531 13.044195175170898,15.48161506652832 24.389842987060547,5.40179443359375 17.945577621459961,8.9997835159301758 29.355476379394531,-2.9428071975708008 30.06672477722168,6.6745977401733398 37.182682037353516,-2.5690991878509521 44.777774810791016,9.394200325012207 44.881736755371094,6.3801741600036621 56.459602355957031,16.119794845581055 49.511859893798828,20.486696243286133 60.650150299072266))" }; +static std::string case_precision_1[2] = +{ + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((2 7,4 7,4.000005 2.99999,2 3,2 7))" +}; + +static std::string case_precision_2[2] = +{ + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((2 7,4 7,4 2.999995,2 3,2 7))" +}; + +static std::string case_precision_3[2] = +{ + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((2 7,4 7,4.0000001 2.99999995,2 3,2 7))" +}; + +static std::string case_precision_4[2] = +{ + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((2 7,4 7,4 3.00000001,2 3,2 7))" +}; + +static std::string case_precision_5[2] = +{ + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((2 7,4 7,4 3,2.0000005 2.9999995,2 7))" +}; + +static std::string case_precision_6[2] = +{ + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((-1 -1,-1 8,2 8,2 7,2 3,4.0000005 2.9999995,4 7,4 8,8 8,8 -1,-1 -1))" +}; + +static std::string case_precision_7[2] = +{ + // Needs larger margin for sectionalize (long double only) + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((2 7,4 7,4 3.00000002,2 3,2 7))" +}; + +static std::string case_precision_8[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.00000006 3.00000009,4 7,2 7))" +}; + +static std::string case_precision_9[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,3.99999 2.999995,4 7,2 7))" +}; + +static std::string case_precision_10[2] = +{ + // Needs 1.0e-5 for threshold in double + "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.000006 2.999991,4 7,2 7))" +}; + +static std::string case_precision_11[2] = +{ + // Needs ~0.5 for threshold in side_by_generic_form + "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.00000000000000089 2.99999999999999201,4 7,2 7))" +}; + +static std::string case_precision_12[2] = +{ + // Needs threshold for threshold a2 + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((1 1,2.99999999999999731e-12 1.00000000001,2.99999999999999731e-12 3.00000000001,1 3,1 1))" +}; + +static std::string case_precision_13[2] = +{ + // Needs threshold for threshold a2 + "POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))", + "POLYGON((1 1,9.99999999999999912e-06 1,9.99999999999999912e-06 3,1 3,1 1))" +}; // ticket_17 is keyholed, so has a hole formed by an deliberate intersection // This will fail the intersection/traversal process diff --git a/test/algorithms/set_operations/difference/difference.cpp b/test/algorithms/set_operations/difference/difference.cpp index e29392f4e..4770fec13 100644 --- a/test/algorithms/set_operations/difference/difference.cpp +++ b/test/algorithms/set_operations/difference/difference.cpp @@ -296,15 +296,17 @@ void test_all() // Isovist - the # output polygons differ per compiler/pointtype, (very) small // rings might be discarded. We check area only + + // SQL Server gives: 0.279121891701124 and 224.889211358929 + // PostGIS gives: 0.279121991127244 and 224.889205853156 + // No robustness gives: 0.279121991127106 and 224.825363749290 + test_one("isovist", isovist1[0], isovist1[1], -1, -1, 0.279132, -1, -1, 224.8892, settings); } - // SQL Server gives: 0.279121891701124 and 224.889211358929 - // PostGIS gives: 0.279121991127244 and 224.889205853156 - // No robustness gives: 0.279121991127106 and 224.825363749290 #ifdef BOOST_GEOMETRY_TEST_INCLUDE_FAILING_TESTS test_one("geos_1", diff --git a/test/algorithms/set_operations/difference/difference_multi.cpp b/test/algorithms/set_operations/difference/difference_multi.cpp index 6c7d13327..49e950a7b 100644 --- a/test/algorithms/set_operations/difference/difference_multi.cpp +++ b/test/algorithms/set_operations/difference/difference_multi.cpp @@ -456,6 +456,11 @@ void test_areal() TEST_DIFFERENCE(case_recursive_boxes_87, 4, 2.0, 4, 2.5, 8); TEST_DIFFERENCE(case_recursive_boxes_88, 3, 4.75, 5, 6.75, 4); + // Output of A can be 0 or 1 polygons (with a very small area) + TEST_DIFFERENCE(case_precision_m1, -1, 0.0, 1, 57.0, -1); + // Output of A can be 1 or 2 polygons (one with a very small area) + TEST_DIFFERENCE(case_precision_m2, -1, 1.0, 1, 57.75, -1); + { ut_settings sym_settings; #if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) diff --git a/test/algorithms/set_operations/difference/test_difference.hpp b/test/algorithms/set_operations/difference/test_difference.hpp index 3dc31c7e9..4a505bcdb 100644 --- a/test/algorithms/set_operations/difference/test_difference.hpp +++ b/test/algorithms/set_operations/difference/test_difference.hpp @@ -273,7 +273,15 @@ std::string test_difference(std::string const& caseid, G1 const& g1, G2 const& g ); } - BOOST_CHECK_CLOSE(area, expected_area, settings.percentage); + if (expected_area > 0) + { + BOOST_CHECK_CLOSE(area, expected_area, settings.percentage); + } + else + { + // Compare 0 with 0 or a very small detected area + BOOST_CHECK_LE(area, settings.percentage); + } #endif diff --git a/test/algorithms/set_operations/intersection/intersection.cpp b/test/algorithms/set_operations/intersection/intersection.cpp index f0934cb98..c59c4afff 100644 --- a/test/algorithms/set_operations/intersection/intersection.cpp +++ b/test/algorithms/set_operations/intersection/intersection.cpp @@ -46,6 +46,16 @@ BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) (test_one) \ ( #caseid, caseid[0], caseid[1], clips, points, area) +#define TEST_INTERSECTION_REV(caseid, clips, points, area) \ + (test_one) \ + ( #caseid "_rev", caseid[1], caseid[0], clips, points, area) + +#define TEST_INTERSECTION_WITH(caseid, index1, index2, \ + clips, points, area, settings) \ + (test_one) \ + ( #caseid #index1 "_" #index2, caseid[index1], caseid[index2], \ + clips, points, area, settings) + #if defined(BOOST_GEOMETRY_NO_SELF_TURNS) #define TEST_INTERSECTION_IGNORE(caseid, clips, points, area) \ { ut_settings ignore_validity; ignore_validity.test_validity = false; \ @@ -197,8 +207,7 @@ void test_areal() // In most cases: 0 (no intersection) // In some cases: 1.430511474609375e-05 (clang/gcc on Xubuntu using b2) // In some cases: 5.6022983000000002e-05 (powerpc64le-gcc-6-0) - test_one("geos_2", - geos_2[0], geos_2[1], + test_one("geos_2", geos_2[0], geos_2[1], 0, 0, 6.0e-5, ut_settings(-1.0)); // -1 denotes: compare with <= #if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) @@ -276,12 +285,12 @@ void test_areal() test_one("ticket_8652", ticket_8652[0], ticket_8652[1], 1, 4, 0.0003); - test_one("ticket_8310a", ticket_8310a[0], ticket_8310a[1], - 1, 5, 0.3843747); - test_one("ticket_8310b", ticket_8310b[0], ticket_8310b[1], - 1, 5, 0.3734379); - test_one("ticket_8310c", ticket_8310c[0], ticket_8310c[1], - 1, 5, 0.4689541); + TEST_INTERSECTION(ticket_8310a, 1, 5, 0.3843747); + TEST_INTERSECTION(ticket_8310b, 1, 5, 0.3734379); + TEST_INTERSECTION(ticket_8310c, 1, 5, 0.4689541); + TEST_INTERSECTION_REV(ticket_8310a, 1, 5, 0.3843747); + TEST_INTERSECTION_REV(ticket_8310b, 1, 5, 0.3734379); + TEST_INTERSECTION_REV(ticket_8310c, 1, 5, 0.4689541); test_one("ticket_9081_15", ticket_9081_15[0], ticket_9081_15[1], @@ -296,7 +305,7 @@ void test_areal() // mingw 5.6022954e-5 test_one("ticket_10108_b", ticket_10108_b[0], ticket_10108_b[1], - 0, 0, 5.6022983e-5); + 0, 0, 5.6022983e-5, ut_settings(-1.0)); #endif test_one("ticket_10747_a", @@ -355,6 +364,37 @@ void test_areal() TEST_INTERSECTION(case_105, 1, 34, 76.0); + TEST_INTERSECTION(case_precision_1, 0, 0, 0.0); + TEST_INTERSECTION(case_precision_2, 0, 0, 0.0); + TEST_INTERSECTION(case_precision_3, 0, 0, 0.0); + TEST_INTERSECTION(case_precision_4, 0, 0, 0.0); + TEST_INTERSECTION(case_precision_5, 0, 0, 0.0); + TEST_INTERSECTION(case_precision_6, 1, -1, 14.0); + TEST_INTERSECTION(case_precision_7, 0, -1, 0.0); + TEST_INTERSECTION(case_precision_8, 1, -1, 14.0); + TEST_INTERSECTION(case_precision_9, 1, -1, 14.0); + TEST_INTERSECTION(case_precision_10, 1, -1, 14.0); + TEST_INTERSECTION(case_precision_11, 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); + TEST_INTERSECTION_REV(case_precision_4, 0, 0, 0.0); + TEST_INTERSECTION_REV(case_precision_5, 0, 0, 0.0); + TEST_INTERSECTION_REV(case_precision_6, 1, -1, 14.0); + TEST_INTERSECTION_REV(case_precision_7, 0, -1, 0.0); + TEST_INTERSECTION_REV(case_precision_8, 1, -1, 14.0); + 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); + } + #ifndef BOOST_GEOMETRY_NO_SELF_TURNS TEST_INTERSECTION(case_106, 2, -1, 3.5); TEST_INTERSECTION(case_107, 3, -1, 3.0); @@ -890,7 +930,6 @@ int test_main(int, char* []) test_all >(); #endif -#endif // Commented, because exception is now disabled: // test_exception >(); @@ -918,6 +957,7 @@ int test_main(int, char* []) #if defined(BOOST_HAS_LONG_LONG) test_ticket_10868("MULTIPOLYGON(((33520458 6878575,33480192 14931538,31446819 18947953,30772384 19615678,30101303 19612322,30114725 16928001,33520458 6878575)))"); #endif +#endif #endif return 0; diff --git a/test/algorithms/set_operations/intersection/intersection_multi.cpp b/test/algorithms/set_operations/intersection/intersection_multi.cpp index a0f4a215f..139507780 100644 --- a/test/algorithms/set_operations/intersection/intersection_multi.cpp +++ b/test/algorithms/set_operations/intersection/intersection_multi.cpp @@ -32,6 +32,10 @@ (test_one) \ ( #caseid, caseid[0], caseid[1], clips, points, area) +#define TEST_INTERSECTION_REV(caseid, clips, points, area) \ + (test_one) \ + ( #caseid "_rev", caseid[1], caseid[0], clips, points, area) + #define TEST_INTERSECTION_IGNORE(caseid, clips, points, area) \ { ut_settings ignore_validity; ignore_validity.test_validity = false; \ (test_one) \ @@ -368,6 +372,17 @@ void test_areal() TEST_INTERSECTION(case_recursive_boxes_87, 0, -1, 0.0); TEST_INTERSECTION(case_recursive_boxes_88, 4, -1, 3.5); +#ifndef BOOST_GEOMETRY_NO_ROBUSTNESS + 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("ggl_list_20120915_h2_a", ggl_list_20120915_h2[0], ggl_list_20120915_h2[1], 2, 10, 6.0); // Area from SQL Server diff --git a/test/algorithms/set_operations/intersection/test_intersection.hpp b/test/algorithms/set_operations/intersection/test_intersection.hpp index 8a9d6ac88..d780ee14e 100644 --- a/test/algorithms/set_operations/intersection/test_intersection.hpp +++ b/test/algorithms/set_operations/intersection/test_intersection.hpp @@ -151,7 +151,15 @@ check_result( double const detected_length_or_area = boost::numeric_cast(length_or_area); if (settings.percentage > 0.0) { - BOOST_CHECK_CLOSE(detected_length_or_area, expected_length_or_area, settings.percentage); + if (expected_length_or_area > 0) + { + BOOST_CHECK_CLOSE(detected_length_or_area, expected_length_or_area, settings.percentage); + } + else + { + // Compare 0 with 0 or a very small detected area + BOOST_CHECK_LE(detected_length_or_area, settings.percentage); + } } else { diff --git a/test/algorithms/set_operations/union/union.cpp b/test/algorithms/set_operations/union/union.cpp index e989e6187..d2dee0662 100644 --- a/test/algorithms/set_operations/union/union.cpp +++ b/test/algorithms/set_operations/union/union.cpp @@ -26,6 +26,14 @@ #include +#define TEST_UNION(caseid, clips, holes, points, area) \ + (test_one) \ + ( #caseid, caseid[0], caseid[1], clips, holes, points, area) + +#define TEST_UNION_REV(caseid, clips, holes, points, area) \ + (test_one) \ + ( #caseid "_rev", caseid[1], caseid[0], clips, holes, points, area) + template void test_areal() @@ -247,6 +255,34 @@ void test_areal() test_one("108", case_108[0], case_108[1], 1, 0, 13, 5.0); + TEST_UNION(case_precision_1, 1, 0, -1, 22.0); + TEST_UNION(case_precision_2, 1, 0, -1, 22.0); + TEST_UNION(case_precision_3, 1, 0, -1, 22.0); + TEST_UNION(case_precision_4, 1, 0, -1, 22.0); + TEST_UNION(case_precision_5, 1, 0, -1, 22.0); + TEST_UNION(case_precision_6, 1, 0, -1, 71.0); + TEST_UNION(case_precision_7, 1, 0, -1, 22.0); + TEST_UNION(case_precision_8, 1, 1, -1, 73.0); + TEST_UNION(case_precision_9, 1, 1, -1, 73.0); + TEST_UNION(case_precision_10, 1, 1, -1, 73.0); + 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_REV(case_precision_1, 1, 0, -1, 22.0); + TEST_UNION_REV(case_precision_2, 1, 0, -1, 22.0); + TEST_UNION_REV(case_precision_3, 1, 0, -1, 22.0); + TEST_UNION_REV(case_precision_4, 1, 0, -1, 22.0); + TEST_UNION_REV(case_precision_5, 1, 0, -1, 22.0); + TEST_UNION_REV(case_precision_6, 1, 0, -1, 71.0); + TEST_UNION_REV(case_precision_7, 1, 0, -1, 22.0); + TEST_UNION_REV(case_precision_8, 1, 1, -1, 73.0); + TEST_UNION_REV(case_precision_9, 1, 1, -1, 73.0); + TEST_UNION_REV(case_precision_10, 1, 1, -1, 73.0); + 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_one(102, simplex_normal[0], simplex_reversed[1], @@ -342,22 +378,23 @@ void test_areal() ticket_5103[0], ticket_5103[1], 1, 0, 25, 2515271327070.5); - test_one("ticket_8310a", ticket_8310a[0], ticket_8310a[1], - 1, 0, 5, 10.5000019595); - test_one("ticket_8310b", ticket_8310b[0], ticket_8310b[1], - 1, 0, 5, 10.5000019595); - test_one("ticket_8310c", ticket_8310c[0], ticket_8310c[1], - 1, 0, 5, 10.5000019595); + TEST_UNION(ticket_8310a, 1, 0, 5, 10.5000019595); + TEST_UNION(ticket_8310b, 1, 0, 5, 10.5000019595); + TEST_UNION(ticket_8310c, 1, 0, 5, 10.5000019595); + TEST_UNION_REV(ticket_8310a, 1, 0, 5, 10.5000019595); + TEST_UNION_REV(ticket_8310b, 1, 0, 5, 10.5000019595); + TEST_UNION_REV(ticket_8310c, 1, 0, 5, 10.5000019595); test_one("ticket_9081_15", ticket_9081_15[0], ticket_9081_15[1], - 1, 0, 10, 0.0403425433); + 1, 0, -1, 0.0403425433); test_one("ticket_9563", ticket_9563[0], ticket_9563[1], 1, 0, 13, 150.0); + // Float result is OK but a bit larger test_one("ticket_9756", ticket_9756[0], ticket_9756[1], - 1, 0, 10, 1289.08374); + 1, 0, 10, if_typed(1291.5469, 1289.08374)); #if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) test_one("ticket_10108_a", ticket_10108_a[0], ticket_10108_a[1], @@ -373,7 +410,7 @@ void test_areal() #endif test_one("ticket_10866", ticket_10866[0], ticket_10866[1], - 1, 0, 14, 332760303.5); + 1, 0, 14, if_typed(332752493.0, 332760303.5)); test_one("ticket_11725", ticket_11725[0], ticket_11725[1], 1, 1, 10, 7.5); @@ -398,17 +435,17 @@ void test_areal() // Robustness issues, followed out buffer-robustness-tests, test them also reverse #if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) test_one("buffer_rt_f", buffer_rt_f[0], buffer_rt_f[1], - 1, 0, 15, 4.60853); + 1, 0, -1, 4.60853); test_one("buffer_rt_f_rev", buffer_rt_f[1], buffer_rt_f[0], - 1, 0, 15, 4.60853); + 1, 0, -1, 4.60853); test_one("buffer_rt_g", buffer_rt_g[0], buffer_rt_g[1], - 1, 0, if_typed(16, 11), 16.571); + 1, 0, -1, 16.571); test_one("buffer_rt_g_rev", buffer_rt_g[1], buffer_rt_g[0], - 1, 0, if_typed(16, 11), 16.571); + 1, 0, -1, 16.571); test_one("buffer_rt_i", buffer_rt_i[0], buffer_rt_i[1], - 1, 0, if_typed(11, 13), 13.6569); + 1, 0, -1, 13.6569); test_one("buffer_rt_i_rev", buffer_rt_i[1], buffer_rt_i[0], - 1, 0, 13, 13.6569); + 1, 0, -1, 13.6569); #endif test_one("buffer_rt_j", buffer_rt_j[0], buffer_rt_j[1], @@ -429,23 +466,23 @@ void test_areal() 1, 0, 9, 19.4852); test_one("buffer_rt_m2", buffer_rt_m2[0], buffer_rt_m2[1], - 1, 0, 12, 21.4853); + 1, 0, -1, 21.4853); test_one("buffer_rt_m2_rev", buffer_rt_m2[1], buffer_rt_m2[0], 1, 0, 15, 21.4853); #if ! defined(BOOST_GEOMETRY_NO_ROBUSTNESS) test_one("buffer_rt_q", buffer_rt_q[0], buffer_rt_q[1], - 1, 0, if_typed(16, 12), 18.5710); + 1, 0, -1, 18.5710); test_one("buffer_rt_q_rev", buffer_rt_q[1], buffer_rt_q[0], - 1, 0, if_typed(16, 12), 18.5710); + 1, 0, -1, 18.5710); test_one("buffer_rt_r", buffer_rt_r[0], buffer_rt_r[1], - 1, 0, if_typed(18, 14), 21.07612); + 1, 0, -1, 21.07612); test_one("buffer_rt_r_rev", buffer_rt_r[1], buffer_rt_r[0], - 1, 0, if_typed(18, 14), 21.07612); + 1, 0, -1, 21.07612); test_one("buffer_rt_t", buffer_rt_t[0], buffer_rt_t[1], - 1, 0, 9, 15.6569); + 1, 0, -1, 15.6569); test_one("buffer_rt_t_rev", buffer_rt_t[1], buffer_rt_t[0], - 1, 0, 10, 15.6569); + 1, 0, -1, 15.6569); #endif test_one("buffer_mp1", buffer_mp1[0], buffer_mp1[1], From e83c8404b5fa1487a035e7f050f13a8281025c91 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Fri, 1 Feb 2019 01:07:35 +0100 Subject: [PATCH 33/48] [test][srs] Improve proj4 wrapper. --- test/srs/proj4.hpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/test/srs/proj4.hpp b/test/srs/proj4.hpp index ef7c84dd3..efe0c218b 100644 --- a/test/srs/proj4.hpp +++ b/test/srs/proj4.hpp @@ -1,6 +1,6 @@ // Boost.Geometry -// Copyright (c) 2017-2018, Oracle and/or its affiliates. +// 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, @@ -115,8 +115,24 @@ struct pj_transformation { assert(in_x.size() == in_y.size()); pj_transform(m_from.get(), m_to.get(), in_x.size(), 1, &in_x[0], &in_y[0], NULL); - out_x = in_x; - out_y = in_y; + out_x = std::move(in_x); + out_y = std::move(in_y); + } + + void forward(std::vector in_xy, + std::vector & out_xy) const + { + assert(in_xy.size() % 2 == 0); + pj_transform(m_from.get(), m_to.get(), in_xy.size() / 2, 2, &in_xy[0], &in_xy[1], NULL); + out_xy = std::move(in_xy); + } + + void forward(std::vector > const& in_xy, + std::vector > & out_xy) const + { + out_xy.resize(in_xy.size()); + for (size_t i = 0 ; i < in_xy.size(); ++i) + forward(in_xy[i], out_xy[i]); } private: From 4aac78da1c57508426029d19dad6d2101c855a60 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Fri, 1 Feb 2019 01:08:25 +0100 Subject: [PATCH 34/48] [strategies] Fix default geographic envelope strategy definition. --- .../boost/geometry/strategies/geographic/envelope.hpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/include/boost/geometry/strategies/geographic/envelope.hpp b/include/boost/geometry/strategies/geographic/envelope.hpp index c98d995fe..4623f1a6c 100644 --- a/include/boost/geometry/strategies/geographic/envelope.hpp +++ b/include/boost/geometry/strategies/geographic/envelope.hpp @@ -4,8 +4,8 @@ // Copyright (c) 2008-2015 Bruno Lalande, Paris, France. // Copyright (c) 2009-2015 Mateusz Loskot, London, UK. -// This file was modified by Oracle on 2015, 2016, 2018. -// Modifications copyright (c) 2015-2018, Oracle and/or its affiliates. +// This file was modified by Oracle on 2015, 2016, 2018, 2019. +// Modifications copyright (c) 2015-2019, 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 @@ -96,7 +96,12 @@ namespace services template struct default_strategy { - typedef strategy::envelope::geographic type; + typedef strategy::envelope::geographic + < + strategy::andoyer, + geometry::srs::spheroid, + CalculationType + > type; }; } From 05e8acc65ec319f609f67fb32b35e3c328c01915 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Fri, 1 Feb 2019 01:09:29 +0100 Subject: [PATCH 35/48] [srs] Fix static towgs84 get-access. --- .../boost/geometry/srs/projections/impl/pj_datum_set.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/boost/geometry/srs/projections/impl/pj_datum_set.hpp b/include/boost/geometry/srs/projections/impl/pj_datum_set.hpp index fee5eca90..eda607f03 100644 --- a/include/boost/geometry/srs/projections/impl/pj_datum_set.hpp +++ b/include/boost/geometry/srs/projections/impl/pj_datum_set.hpp @@ -3,8 +3,8 @@ // Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2017, 2018. -// Modifications copyright (c) 2017-2018, Oracle and/or its affiliates. +// This file was modified by Oracle on 2017, 2018, 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, @@ -322,7 +322,7 @@ struct pj_datum_find_towgs84_static static void apply(Params const& params, srs::detail::towgs84 & out) { typename boost::tuples::element::type const& - towgs84 = boost::tuples::get(); + towgs84 = boost::tuples::get(params); std::size_t n = (std::min)(towgs84.size(), 7u); std::size_t z = n <= 3 ? 3 : 7; From eb73b0c03fa7923d8970e8ee0ec3c93fbd3fd70b Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Sat, 2 Feb 2019 12:36:48 +0100 Subject: [PATCH 36/48] [test] Use correct namespaces in proj4 wrapper. --- test/srs/proj4.hpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/test/srs/proj4.hpp b/test/srs/proj4.hpp index efe0c218b..436db1177 100644 --- a/test/srs/proj4.hpp +++ b/test/srs/proj4.hpp @@ -52,8 +52,8 @@ struct pj_projection template void forward(In const& in, Out & out) const { - double x = bg::get_as_radian<0>(in); - double y = bg::get_as_radian<1>(in); + double x = boost::geometry::get_as_radian<0>(in); + double y = boost::geometry::get_as_radian<1>(in); projUV p1; projUV p2; @@ -63,15 +63,15 @@ struct pj_projection p2 = pj_fwd(p1, m_ptr.get()); - bg::set_from_radian<0>(out, p2.u); - bg::set_from_radian<1>(out, p2.v); + boost::geometry::set_from_radian<0>(out, p2.u); + boost::geometry::set_from_radian<1>(out, p2.v); } template void inverse(In const& in, Out & out) const { - double lon = bg::get_as_radian<0>(in); - double lat = bg::get_as_radian<1>(in); + double lon = boost::geometry::get_as_radian<0>(in); + double lat = boost::geometry::get_as_radian<1>(in); projUV p1; projUV p2; @@ -79,10 +79,10 @@ struct pj_projection p1.u = lon; p1.v = lat; - p2 = pj_inv(p1, pj_prj.get()); + p2 = pj_inv(p1, m_ptr.get()); - bg::set_from_radian<0>(out, p2.u); - bg::set_from_radian<1>(out, p2.v); + boost::geometry::set_from_radian<0>(out, p2.u); + boost::geometry::set_from_radian<1>(out, p2.v); } private: @@ -99,13 +99,13 @@ struct pj_transformation template void forward(In const& in, Out & out) const { - double x = bg::get_as_radian<0>(in); - double y = bg::get_as_radian<1>(in); + double x = boost::geometry::get_as_radian<0>(in); + double y = boost::geometry::get_as_radian<1>(in); pj_transform(m_from.get(), m_to.get(), 1, 0, &x, &y, NULL); - bg::set_from_radian<0>(out, x); - bg::set_from_radian<1>(out, y); + boost::geometry::set_from_radian<0>(out, x); + boost::geometry::set_from_radian<1>(out, y); } void forward(std::vector in_x, From 28cbd311834e3d9c262431f618a9aaa07b98849b Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Sat, 2 Feb 2019 12:38:54 +0100 Subject: [PATCH 37/48] [srs] Add missing include. Remove/comment unused parameters. --- .../geometry/srs/projections/impl/pj_apply_gridshift.hpp | 7 ++++--- .../boost/geometry/srs/projections/impl/pj_datum_set.hpp | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/boost/geometry/srs/projections/impl/pj_apply_gridshift.hpp b/include/boost/geometry/srs/projections/impl/pj_apply_gridshift.hpp index 2b3c8c2a7..e56fecc8b 100644 --- a/include/boost/geometry/srs/projections/impl/pj_apply_gridshift.hpp +++ b/include/boost/geometry/srs/projections/impl/pj_apply_gridshift.hpp @@ -1,8 +1,8 @@ // Boost.Geometry // This file is manually converted from PROJ4 -// This file was modified by Oracle on 2018. -// Modifications copyright (c) 2018, Oracle and/or its affiliates. +// This file was modified by Oracle on 2018, 2019. +// Modifications copyright (c) 2018-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, @@ -45,6 +45,7 @@ #include #include +#include #include #include @@ -391,7 +392,7 @@ inline bool pj_apply_gridshift_3(StreamPolicy const& stream_policy, /************************************************************************/ template -inline bool pj_apply_gridshift_2(Par const& defn, Range & range, ProjGrids const& grids) +inline bool pj_apply_gridshift_2(Par const& /*defn*/, Range & range, ProjGrids const& grids) { /*if( defn->catalog_name != NULL ) return pj_gc_apply_gridshift( defn, inverse, point_count, point_offset, diff --git a/include/boost/geometry/srs/projections/impl/pj_datum_set.hpp b/include/boost/geometry/srs/projections/impl/pj_datum_set.hpp index eda607f03..94cceae38 100644 --- a/include/boost/geometry/srs/projections/impl/pj_datum_set.hpp +++ b/include/boost/geometry/srs/projections/impl/pj_datum_set.hpp @@ -135,7 +135,7 @@ template struct pj_datum_find_datum_static { template - static const pj_datums_type* apply(Params const& params) + static const pj_datums_type* apply(Params const& ) { const pj_datums_type* pj_datums = pj_get_datums().first; const int n = pj_get_datums().second; From bb584a57db25a2f41b0db9655e68350d4de5f6a0 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Sat, 2 Feb 2019 12:41:03 +0100 Subject: [PATCH 38/48] [srs] Fix gcc/clang compilation error for shared_grid. Error: Unable to find function overload Fix by moving shared_grid to the same namespace where the functions are and bringing it up to the srs namespace with using directive. --- .../impl/pj_apply_gridshift_shared.hpp | 6 ++--- .../projections/impl/pj_gridlist_shared.hpp | 6 ++--- .../geometry/srs/projections/shared_grids.hpp | 23 +++++-------------- include/boost/geometry/srs/shared_grids.hpp | 6 +++++ 4 files changed, 18 insertions(+), 23 deletions(-) diff --git a/include/boost/geometry/srs/projections/impl/pj_apply_gridshift_shared.hpp b/include/boost/geometry/srs/projections/impl/pj_apply_gridshift_shared.hpp index 2f0d63169..c83c1bc51 100644 --- a/include/boost/geometry/srs/projections/impl/pj_apply_gridshift_shared.hpp +++ b/include/boost/geometry/srs/projections/impl/pj_apply_gridshift_shared.hpp @@ -1,8 +1,8 @@ // Boost.Geometry // This file is manually converted from PROJ4 -// This file was modified by Oracle on 2018. -// Modifications copyright (c) 2018, Oracle and/or its affiliates. +// This file was modified by Oracle on 2018, 2019. +// Modifications copyright (c) 2018-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, @@ -57,7 +57,7 @@ namespace detail template inline bool pj_apply_gridshift_3(StreamPolicy const& stream_policy, Range & range, - srs::shared_grids & grids, + shared_grids & grids, std::vector const& gridindexes) { typedef typename boost::range_size::type size_type; diff --git a/include/boost/geometry/srs/projections/impl/pj_gridlist_shared.hpp b/include/boost/geometry/srs/projections/impl/pj_gridlist_shared.hpp index cb41eaf68..de8640a01 100644 --- a/include/boost/geometry/srs/projections/impl/pj_gridlist_shared.hpp +++ b/include/boost/geometry/srs/projections/impl/pj_gridlist_shared.hpp @@ -1,8 +1,8 @@ // Boost.Geometry // This file is manually converted from PROJ4 -// This file was modified by Oracle on 2018. -// Modifications copyright (c) 2018, Oracle and/or its affiliates. +// This file was modified by Oracle on 2018, 2019. +// Modifications copyright (c) 2018-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, @@ -64,7 +64,7 @@ namespace detail template inline bool pj_gridlist_merge_gridfile(std::string const& gridname, StreamPolicy const& stream_policy, - srs::shared_grids & grids, + shared_grids & grids, std::vector & gridindexes) { // Try to find in the existing list of loaded grids. Add all diff --git a/include/boost/geometry/srs/projections/shared_grids.hpp b/include/boost/geometry/srs/projections/shared_grids.hpp index 54191808c..d4a27e4b1 100644 --- a/include/boost/geometry/srs/projections/shared_grids.hpp +++ b/include/boost/geometry/srs/projections/shared_grids.hpp @@ -23,35 +23,24 @@ namespace boost { namespace geometry { -// Forward declarations -namespace srs +namespace projections { namespace detail { // Forward declaration for functions declarations below class shared_grids; -} // namespace srs -namespace projections { namespace detail -{ - // Forward declaratios of shared_grids friends template inline bool pj_gridlist_merge_gridfile(std::string const& gridname, StreamPolicy const& stream_policy, - srs::shared_grids & grids, + shared_grids & grids, std::vector & gridindexes); template inline bool pj_apply_gridshift_3(StreamPolicy const& stream_policy, Range & range, - srs::shared_grids & grids, + shared_grids & grids, std::vector const& gridindexes); -}} // namespace projections::detail - - -namespace srs -{ - class shared_grids { @@ -73,21 +62,21 @@ private: friend inline bool projections::detail::pj_gridlist_merge_gridfile( std::string const& gridname, StreamPolicy const& stream_policy, - srs::shared_grids & grids, + shared_grids & grids, std::vector & gridindexes); template friend inline bool projections::detail::pj_apply_gridshift_3( StreamPolicy const& stream_policy, Range & range, - srs::shared_grids & grids, + shared_grids & grids, std::vector const& gridindexes); projections::detail::pj_gridinfo gridinfo; mutable boost::shared_mutex mutex; }; +}} // namespace projections::detail -} // namespace srs }} // namespace boost::geometry diff --git a/include/boost/geometry/srs/shared_grids.hpp b/include/boost/geometry/srs/shared_grids.hpp index 9eb61717b..bc9528bd2 100644 --- a/include/boost/geometry/srs/shared_grids.hpp +++ b/include/boost/geometry/srs/shared_grids.hpp @@ -16,5 +16,11 @@ #include #include +namespace boost { namespace geometry { namespace srs +{ + +using geometry::projections::detail::shared_grids; + +}}} // namespace boost::geometry::srs #endif // BOOST_GEOMETRY_SRS_SHARED_GRIDS_HPP From 7e5021a53209ab32982d86fd6251c88f7896696c Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Mon, 4 Feb 2019 22:17:28 +0100 Subject: [PATCH 39/48] [srs] Fix get-access of static nadgrids. --- include/boost/geometry/srs/projections/impl/pj_datum_set.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/geometry/srs/projections/impl/pj_datum_set.hpp b/include/boost/geometry/srs/projections/impl/pj_datum_set.hpp index 94cceae38..1b651d082 100644 --- a/include/boost/geometry/srs/projections/impl/pj_datum_set.hpp +++ b/include/boost/geometry/srs/projections/impl/pj_datum_set.hpp @@ -225,7 +225,7 @@ struct pj_datum_find_nadgrids_static { static void apply(Params const& params, srs::detail::nadgrids & out) { - out = boost::tuples::get(); + out = boost::tuples::get(params); } }; template From fca0aa9ff454253e99cd342177275eb6a79c45bb Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Mon, 4 Feb 2019 22:18:59 +0100 Subject: [PATCH 40/48] [srs][strategies] Fix warnings (comparison, unused parameter). --- .../geometry/srs/projections/impl/pj_gridinfo.hpp | 14 +++++++------- .../geometry/srs/projections/proj/ob_tran.hpp | 8 ++++---- .../strategies/cartesian/side_of_intersection.hpp | 6 ++++-- .../strategies/geographic/intersection.hpp | 4 ++-- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/include/boost/geometry/srs/projections/impl/pj_gridinfo.hpp b/include/boost/geometry/srs/projections/impl/pj_gridinfo.hpp index a2b364e12..0d297b1cb 100644 --- a/include/boost/geometry/srs/projections/impl/pj_gridinfo.hpp +++ b/include/boost/geometry/srs/projections/impl/pj_gridinfo.hpp @@ -1,8 +1,8 @@ // Boost.Geometry // This file is manually converted from PROJ4 -// This file was modified by Oracle on 2018. -// Modifications copyright (c) 2018, Oracle and/or its affiliates. +// This file was modified by Oracle on 2018, 2019. +// Modifications copyright (c) 2018-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, @@ -205,7 +205,7 @@ bool pj_gridinfo_load_ctable(IStream & is, pj_gi_load & gi) std::size_t ch_size = sizeof(pj_ctable::flp_t) * a_size; is.read(reinterpret_cast(&ct.cvs[0]), ch_size); - if (is.fail() || is.gcount() != ch_size) + if (is.fail() || std::size_t(is.gcount()) != ch_size) { ct.cvs.clear(); //ctable loading failed on fread() - binary incompatible? @@ -236,7 +236,7 @@ bool pj_gridinfo_load_ctable2(IStream & is, pj_gi_load & gi) std::size_t ch_size = sizeof(pj_ctable::flp_t) * a_size; is.read(reinterpret_cast(&ct.cvs[0]), ch_size); - if (is.fail() || is.gcount() != ch_size) + if (is.fail() || std::size_t(is.gcount()) != ch_size) { //ctable2 loading failed on fread() - binary incompatible? ct.cvs.clear(); @@ -279,7 +279,7 @@ inline bool pj_gridinfo_load_ntv1(IStream & is, pj_gi_load & gi) { is.read(reinterpret_cast(&row_buf[0]), ch_size); - if (is.fail() || is.gcount() != ch_size) + if (is.fail() || std::size_t(is.gcount()) != ch_size) { gi.ct.cvs.clear(); return false; @@ -329,7 +329,7 @@ inline bool pj_gridinfo_load_ntv2(IStream & is, pj_gi_load & gi) { is.read(reinterpret_cast(&row_buf[0]), ch_size); - if (is.fail() || is.gcount() != ch_size) + if (is.fail() || std::size_t(is.gcount()) != ch_size) { gi.ct.cvs.clear(); return false; @@ -376,7 +376,7 @@ inline bool pj_gridinfo_load_gtx(IStream & is, pj_gi_load & gi) is.read(reinterpret_cast(&gi.ct.cvs[0]), ch_size); - if (is.fail() || is.gcount() != ch_size) + if (is.fail() || std::size_t(is.gcount()) != ch_size) { gi.ct.cvs.clear(); return false; diff --git a/include/boost/geometry/srs/projections/proj/ob_tran.hpp b/include/boost/geometry/srs/projections/proj/ob_tran.hpp index f5709228f..99a7b82b1 100644 --- a/include/boost/geometry/srs/projections/proj/ob_tran.hpp +++ b/include/boost/geometry/srs/projections/proj/ob_tran.hpp @@ -2,8 +2,8 @@ // Copyright (c) 2008-2015 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2017, 2018. -// Modifications copyright (c) 2017-2018, Oracle and/or its affiliates. +// This file was modified by Oracle on 2017, 2018, 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, @@ -128,7 +128,7 @@ namespace projections } template - inline Parameters o_proj_parameters(srs::spar::parameters const& params, + inline Parameters o_proj_parameters(srs::spar::parameters const& /*params*/, Parameters const& par) { /* copy existing header into new */ @@ -292,7 +292,7 @@ namespace projections // General Oblique Transformation template - inline T setup_ob_tran(Params const& params, Parameters & par, ProjParameters& proj_parm) + inline T setup_ob_tran(Params const& params, Parameters & /*par*/, ProjParameters& proj_parm) { static const T half_pi = detail::half_pi(); diff --git a/include/boost/geometry/strategies/cartesian/side_of_intersection.hpp b/include/boost/geometry/strategies/cartesian/side_of_intersection.hpp index db57644ad..9c0a5f0d3 100644 --- a/include/boost/geometry/strategies/cartesian/side_of_intersection.hpp +++ b/include/boost/geometry/strategies/cartesian/side_of_intersection.hpp @@ -2,8 +2,8 @@ // Copyright (c) 2015 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2015. -// Modifications copyright (c) 2015, Oracle and/or its affiliates. +// This file was modified by Oracle on 2015, 2019. +// Modifications copyright (c) 2015-2019, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -118,6 +118,7 @@ struct multiplicable_integral return b < a; } +#ifdef BOOST_GEOMETRY_SIDE_OF_INTERSECTION_DEBUG template void check_value(CmpVal const& cmp_val) const { @@ -125,6 +126,7 @@ struct multiplicable_integral CmpVal val = CmpVal(m_sign) * (CmpVal(m_ms) * CmpVal(b) + CmpVal(m_ls)); BOOST_GEOMETRY_ASSERT(cmp_val == val); } +#endif // BOOST_GEOMETRY_SIDE_OF_INTERSECTION_DEBUG }; } // namespace detail diff --git a/include/boost/geometry/strategies/geographic/intersection.hpp b/include/boost/geometry/strategies/geographic/intersection.hpp index 0bfa2f881..6f317bb31 100644 --- a/include/boost/geometry/strategies/geographic/intersection.hpp +++ b/include/boost/geometry/strategies/geographic/intersection.hpp @@ -2,7 +2,7 @@ // Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. -// Copyright (c) 2016-2018, Oracle and/or its affiliates. +// 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, @@ -649,7 +649,7 @@ private: // in order to make this independent from is_near() template static inline bool calculate_collinear_data(Point1 const& a1, Point1 const& a2, // in - Point2 const& b1, Point2 const& b2, // in + Point2 const& b1, Point2 const& /*b2*/, // in ResultInverse const& res_a1_a2, // in ResultInverse const& res_a1_b1, // in ResultInverse const& res_a1_b2, // in From 661d3b1acd4d057b8d4ba014b36e48201c2be32f Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Tue, 5 Feb 2019 02:49:22 +0100 Subject: [PATCH 41/48] [overlay] Fix unused parameters warnings. --- .../algorithms/detail/overlay/get_turn_info.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp index edb05f97b..0d1f6473f 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp @@ -3,8 +3,8 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2015, 2017, 2018. -// Modifications copyright (c) 2015-2018 Oracle and/or its affiliates. +// This file was modified by Oracle on 2015, 2017, 2018, 2019. +// Modifications copyright (c) 2015-2019 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -150,7 +150,7 @@ struct touch_interior : public base_turn_handler typename DirInfo, typename SidePolicy > - static inline void apply(UniqueSubRange1 const& range_p, + static inline void apply(UniqueSubRange1 const& /*range_p*/, UniqueSubRange2 const& range_q, TurnInfo& ti, IntersectionInfo const& intersection_info, @@ -520,8 +520,8 @@ struct equal_opposite : public base_turn_handler typename IntersectionInfo > static inline void apply( - UniqueSubRange1 const& range_p, - UniqueSubRange2 const& range_q, + UniqueSubRange1 const& /*range_p*/, + UniqueSubRange2 const& /*range_q*/, /* by value: */ TurnInfo tp, OutputIterator& out, IntersectionInfo const& intersection_info) From da6a2dd186cbf28bfdb465f20f9016aeb828ad53 Mon Sep 17 00:00:00 2001 From: Vissarion Fysikopoulos Date: Wed, 6 Feb 2019 15:11:59 +0200 Subject: [PATCH 42/48] [strategy] [test] Return strategy correctly from get_comparable in pt-seg and pt-box; add tests for those cases --- .../geographic/distance_cross_track.hpp | 10 ++---- .../distance_cross_track_point_box.hpp | 8 ++--- .../algorithms/distance/distance_geo_pl_l.cpp | 35 ++++++++++++------- .../distance/distance_se_geo_pl_ar.cpp | 4 +++ .../distance/distance_se_geo_pl_pl.cpp | 2 ++ 5 files changed, 34 insertions(+), 25 deletions(-) diff --git a/include/boost/geometry/strategies/geographic/distance_cross_track.hpp b/include/boost/geometry/strategies/geographic/distance_cross_track.hpp index 03eba63d4..9afaae1ae 100644 --- a/include/boost/geometry/strategies/geographic/distance_cross_track.hpp +++ b/include/boost/geometry/strategies/geographic/distance_cross_track.hpp @@ -643,15 +643,11 @@ template > struct get_comparable > { - typedef typename comparable_type - < - geographic_cross_track - >::type comparable_type; public : - static inline comparable_type - apply(geographic_cross_track const& ) + static inline geographic_cross_track + apply(geographic_cross_track const& strategy) { - return comparable_type(); + return strategy; } }; diff --git a/include/boost/geometry/strategies/geographic/distance_cross_track_point_box.hpp b/include/boost/geometry/strategies/geographic/distance_cross_track_point_box.hpp index 4508d5acb..b6694b4e0 100644 --- a/include/boost/geometry/strategies/geographic/distance_cross_track_point_box.hpp +++ b/include/boost/geometry/strategies/geographic/distance_cross_track_point_box.hpp @@ -157,13 +157,11 @@ struct comparable_type struct get_comparable > { - typedef geographic_cross_track_point_box this_strategy; - typedef typename comparable_type::type comparable_type; - public: - static inline comparable_type apply(this_strategy const&) + static inline geographic_cross_track_point_box + apply(geographic_cross_track_point_box const& str) { - return comparable_type(); + return str; } }; diff --git a/test/algorithms/distance/distance_geo_pl_l.cpp b/test/algorithms/distance/distance_geo_pl_l.cpp index 7d20d4286..5063bda3e 100644 --- a/test/algorithms/distance/distance_geo_pl_l.cpp +++ b/test/algorithms/distance/distance_geo_pl_l.cpp @@ -58,7 +58,8 @@ ps_distance(std::string const& wkt1, template void test_distance_point_segment(Strategy_pp const& strategy_pp, - Strategy_ps const& strategy_ps) + Strategy_ps const& strategy_ps, + bool WGS84) { #ifdef BOOST_GEOMETRY_TEST_DEBUG @@ -97,16 +98,19 @@ void test_distance_point_segment(Strategy_pp const& strategy_pp, "SEGMENT(2 0,3 0)", pp_distance("POINT(3 0)", "POINT(3.5 3)", strategy_pp), strategy_ps, true, true); - tester::apply("p-s-07", - "POINT(15 80)", - "SEGMENT(10 15,30 15)", - 7204174.8264546748, - strategy_ps, true, true); - tester::apply("p-s-08", - "POINT(15 10)", - "SEGMENT(10 15,30 15)", - 571412.71247283253, - strategy_ps, true, true); + if(WGS84) + { + tester::apply("p-s-07", + "POINT(15 80)", + "SEGMENT(10 15,30 15)", + 7204174.8264546748, + strategy_ps, true, true); + tester::apply("p-s-08", + "POINT(15 10)", + "SEGMENT(10 15,30 15)", + 571412.71247283253, + strategy_ps, true, true); + } tester::apply("p-s-09", "POINT(5 10)", "SEGMENT(10 15,30 15)", @@ -624,9 +628,10 @@ void test_distance_multipoint_segment(Strategy_pp const& strategy_pp, //=========================================================================== template -void test_all_pl_l(Strategy_pp pp_strategy, Strategy_ps ps_strategy) +void test_all_pl_l(Strategy_pp pp_strategy, Strategy_ps ps_strategy, + bool WGS84 = true) { - test_distance_point_segment(pp_strategy, ps_strategy); + test_distance_point_segment(pp_strategy, ps_strategy, WGS84); test_distance_point_linestring(pp_strategy, ps_strategy); test_distance_point_multilinestring(pp_strategy, ps_strategy); test_distance_linestring_multipoint(pp_strategy, ps_strategy); @@ -642,6 +647,10 @@ BOOST_AUTO_TEST_CASE( test_all_pointlike_linear ) test_all_pl_l(thomas_pp(), thomas_ps()); test_all_pl_l(andoyer_pp(), andoyer_ps()); + // test with different spheroid + stype spheroid(6372000, 6370000); + test_all_pl_l(andoyer_pp(spheroid), andoyer_ps(spheroid), false); + 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()); diff --git a/test/algorithms/distance/distance_se_geo_pl_ar.cpp b/test/algorithms/distance/distance_se_geo_pl_ar.cpp index 3d1759769..111bec066 100644 --- a/test/algorithms/distance/distance_se_geo_pl_ar.cpp +++ b/test/algorithms/distance/distance_se_geo_pl_ar.cpp @@ -682,4 +682,8 @@ BOOST_AUTO_TEST_CASE( test_all_pointlike_areal ) test_all_pl_ar(vincenty_pp(), vincenty_ps(), vincenty_pb()); test_all_pl_ar(thomas_pp(), thomas_ps(), thomas_pb()); test_all_pl_ar(andoyer_pp(), andoyer_ps(), andoyer_pb()); + + // test with different spheroid + stype spheroid(6372000, 6370000); + test_all_pl_ar(andoyer_pp(spheroid), andoyer_ps(spheroid), andoyer_pb(spheroid)); } diff --git a/test/algorithms/distance/distance_se_geo_pl_pl.cpp b/test/algorithms/distance/distance_se_geo_pl_pl.cpp index 57a0c2931..3027bf4d5 100644 --- a/test/algorithms/distance/distance_se_geo_pl_pl.cpp +++ b/test/algorithms/distance/distance_se_geo_pl_pl.cpp @@ -117,4 +117,6 @@ BOOST_AUTO_TEST_CASE( test_all_pointlike_pointlike ) test_all_pl_pl(vincenty_pp()); test_all_pl_pl(thomas_pp()); test_all_pl_pl(andoyer_pp()); + + test_all_pl_pl(andoyer_pp(stype(5000000,6000000))); } From b242878b8ebc283223dd6645ee4f659fa2db6fee Mon Sep 17 00:00:00 2001 From: Vissarion Fysikopoulos Date: Wed, 6 Feb 2019 15:14:49 +0200 Subject: [PATCH 43/48] [test] Remove some unused parameters --- test/algorithms/distance/distance_se_geo_pl_ar.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/algorithms/distance/distance_se_geo_pl_ar.cpp b/test/algorithms/distance/distance_se_geo_pl_ar.cpp index 111bec066..3a9d5f277 100644 --- a/test/algorithms/distance/distance_se_geo_pl_ar.cpp +++ b/test/algorithms/distance/distance_se_geo_pl_ar.cpp @@ -63,11 +63,9 @@ void test_distance_point_ring(Strategy_pp const& strategy_pp, template < typename Point, - typename Strategy_pp, typename Strategy_ps > -void test_distance_multipoint_ring(Strategy_pp const& strategy_pp, - Strategy_ps const& strategy_ps) +void test_distance_multipoint_ring(Strategy_ps const& strategy_ps) { #ifdef BOOST_GEOMETRY_TEST_DEBUG @@ -649,7 +647,7 @@ void test_all_pl_ar(Strategy_pp pp_strategy, Strategy_pb pb_strategy) { test_distance_point_ring(pp_strategy, ps_strategy); - test_distance_multipoint_ring(pp_strategy, ps_strategy); + test_distance_multipoint_ring(ps_strategy); test_distance_point_polygon(pp_strategy, ps_strategy); test_distance_multipoint_polygon(pp_strategy, ps_strategy); From 05102586b04d8288cbe1797a5dc2d0ae49d4449a Mon Sep 17 00:00:00 2001 From: Vissarion Fysikopoulos Date: Wed, 6 Feb 2019 15:20:53 +0200 Subject: [PATCH 44/48] [strategy] [test] Return strategy correctly from get_comparable in box-box; add tests for those cases --- .../geographic/distance_cross_track_box_box.hpp | 8 +++----- test/algorithms/distance/distance_se_geo_ar_ar.cpp | 5 +++++ 2 files changed, 8 insertions(+), 5 deletions(-) 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 b32df6587..2bc33096a 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 @@ -173,13 +173,11 @@ struct comparable_type struct get_comparable > { - typedef geographic_cross_track_box_box this_strategy; - typedef typename comparable_type::type comparable_type; - public: - static inline comparable_type apply(this_strategy const& /*strategy*/) + static inline geographic_cross_track_box_box + apply(geographic_cross_track_box_box const& str) { - return comparable_type(); + return str; } }; diff --git a/test/algorithms/distance/distance_se_geo_ar_ar.cpp b/test/algorithms/distance/distance_se_geo_ar_ar.cpp index a685e70f2..4e25d7eac 100644 --- a/test/algorithms/distance/distance_se_geo_ar_ar.cpp +++ b/test/algorithms/distance/distance_se_geo_ar_ar.cpp @@ -935,4 +935,9 @@ BOOST_AUTO_TEST_CASE( test_all_areal_areal ) test_all_ar_ar(vincenty_pp(), vincenty_ps(), vincenty_bb(), vincenty_sb()); test_all_ar_ar(thomas_pp(), thomas_ps(), thomas_bb(), thomas_sb()); test_all_ar_ar(andoyer_pp(), andoyer_ps(), andoyer_bb(), andoyer_sb()); + + // test with different spheroid + stype spheroid(6372000, 6370000); + test_all_ar_ar(andoyer_pp(spheroid), andoyer_ps(spheroid), + andoyer_bb(spheroid), andoyer_sb(spheroid)); } From b9dc49391e52bdced55481a4b645cbb1f9e64754 Mon Sep 17 00:00:00 2001 From: Vissarion Fysikopoulos Date: Wed, 6 Feb 2019 16:52:33 +0200 Subject: [PATCH 45/48] [release] Update 1.70 release notes --- doc/release_notes.qbk | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/doc/release_notes.qbk b/doc/release_notes.qbk index e17b2c4d0..ea2cc043e 100644 --- a/doc/release_notes.qbk +++ b/doc/release_notes.qbk @@ -7,7 +7,7 @@ Copyright (c) 2011-2017 Adam Wulkiewicz, Lodz, Poland. This file was modified by Oracle on 2015, 2017, 2018. - Modifications copyright (c) 2015-2018, Oracle and/or its affiliates. + Modifications copyright (c) 2015-2019, 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 @@ -19,6 +19,14 @@ [section:release_notes Release Notes] +[/=================] +[heading Boost 1.70] +[/=================] + +[*Bugfixes] + +* [@https://github.com/boostorg/geometry/pull/553 553] Pass spheroid correctly in geographic comparable strategies + [/=================] [heading Boost 1.69] [/=================] @@ -51,7 +59,7 @@ * [@https://github.com/boostorg/geometry/pull/469 469] Horizontal grid shift (nadgrids) in SRS transformations (undocumented for now due to potential interface changes). * [@https://github.com/boostorg/geometry/pull/478 478] Box-Segment distance for spherical and geographic coordinate systems. * [@https://github.com/boostorg/geometry/pull/487 487] Missing combinations of geometries in distance for spherical and geographic cs -* [@https://github.com/boostorg/geometry/pull/489 489] Additional direct geodesic problem formulas for internal use +* [@https://github.com/boostorg/geometry/pull/489 489] Additional direct geodesic problem formulas for internal use [*Solved issues] @@ -355,7 +363,7 @@ [*Bugfixes] * Bug in multipoint/polygon multipoint/multipolygon distance computation (wrong detection of points inside the areal geometry) -* Bug in flatten_iterator's assignment operator causing an access violation +* Bug in flatten_iterator's assignment operator causing an access violation * Bug in Cartesian segment-segment intersection strategy when one segment degenerates to a point and is collinear to the other non-degenerate segment * Bug in centroid(), non-deterministic result if calculated for e.g. a Polygon with zero-area. * Bug in buffers for joins with a limited number of points @@ -676,9 +684,9 @@ [*Additional coordinate types] * Basic (limited) support for Boost.Rational - + [heading Boost 1.47] -Original release +Original release [endsect] From 82c42d0558a143d6a5e14cee7acc2343c125e449 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Thu, 7 Feb 2019 19:06:36 +0100 Subject: [PATCH 46/48] [traversal] process review remarks --- .../detail/overlay/get_turn_info.hpp | 6 +-- .../algorithms/detail/overlay/traversal.hpp | 45 ++++++++++--------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp index 135d8e365..5cb5f78c7 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp @@ -211,10 +211,10 @@ struct touch_interior : public base_turn_handler { if (side_pj_q2 == -1) { - // Q turns right on the left side of P (test "ML3") + // Q turns right on the left side of P (test "ML3") // Union: take both operations - // Intersection: skip - both(ti, operation_union); + // Intersection: skip + both(ti, operation_union); } else { diff --git a/include/boost/geometry/algorithms/detail/overlay/traversal.hpp b/include/boost/geometry/algorithms/detail/overlay/traversal.hpp index d95284b7f..3a7d82ce0 100644 --- a/include/boost/geometry/algorithms/detail/overlay/traversal.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/traversal.hpp @@ -372,22 +372,21 @@ public : // If both are valid candidates, take the one with minimal remaining // distance (important for #mysql_23023665 in buffer). - turn_operation_type const& op0 = turn.operations[0]; - turn_operation_type const& op1 = turn.operations[1]; - signed_size_type const next0 = op0.enriched.get_next_turn_index(); - signed_size_type const next1 = op1.enriched.get_next_turn_index(); + signed_size_type next[2] = {0}; + bool possible[2] = {0}; + bool close[2] = {0}; - bool possible[2]; - possible[0] = traverse_possible(next0); - possible[1] = traverse_possible(next1); + for (int i = 0; i < 2; i++) + { + next[i] = turn.operations[i].enriched.get_next_turn_index(); + possible[i] = traverse_possible(next[i]); + close[i] = possible[i] && next[i] == start_turn_index; + } - bool const close0 = possible[0] && next0 == start_turn_index; - bool const close1 = possible[1] && next1 == start_turn_index; - - if (close0 != close1) + if (close[0] != close[1]) { // One of the operations will finish the ring. Take that one. - selected_op_index = close0 ? 0 : 1; + selected_op_index = close[0] ? 0 : 1; debug_traverse(turn, turn.operations[selected_op_index], "Candidate cc closing"); return true; } @@ -395,17 +394,19 @@ public : if (OverlayType == overlay_buffer && possible[0] && possible[1]) { // Buffers sometimes have multiple overlapping pieces, where remaining - // distance could lead to the wrong choice. Take the matcing operation. - turn_operation_type const& next_op0 = m_turns[next0].operations[0]; - turn_operation_type const& next_op1 = m_turns[next1].operations[1]; + // distance could lead to the wrong choice. Take the matching operation. - bool const is_target0 = next_op0.operation == target_operation; - bool const is_target1 = next_op1.operation == target_operation; - - if (is_target0 != is_target1) + bool is_target[2] = {0}; + for (int i = 0; i < 2; i++) { - // One of the operations will finish the ring. Take that one. - selected_op_index = is_target0 ? 0 : 1; + turn_operation_type const& next_op = m_turns[next[i]].operations[i]; + is_target[i] = next_op.operation == target_operation; + } + + if (is_target[0] != is_target[1]) + { + // Take the matching operation + selected_op_index = is_target[0] ? 0 : 1; debug_traverse(turn, turn.operations[selected_op_index], "Candidate cc target"); return true; } @@ -880,7 +881,7 @@ public : } } - // Traveral can either enter the cluster in the first turn, + // Traversal can either enter the cluster in the first turn, // or it can start halfway. // If there is one (and only one) possibility pointing outside // the cluster, take that one. From 54344382d4b598a3d2ee8a6df4a850877033a155 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 9 Feb 2019 15:43:13 +0100 Subject: [PATCH 47/48] [turns] Fix compilation error by 846d91cac --- .../boost/geometry/algorithms/detail/overlay/get_turn_info.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp index 477d5573b..7a6f24454 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp @@ -161,7 +161,7 @@ struct touch_interior : public base_turn_handler typename DirInfo, typename SidePolicy > - static inline void apply(UniqueSubRange1 const& /*range_p*/, + static inline void apply(UniqueSubRange1 const& range_p, UniqueSubRange2 const& range_q, TurnInfo& ti, IntersectionInfo const& intersection_info, From 787bf255d5f93d470fe265d296f7d3fe9e7859aa Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 9 Feb 2019 16:10:40 +0100 Subject: [PATCH 48/48] [get_turn_info] fix assertions by checking ranges before --- .../algorithms/detail/overlay/get_turn_info.hpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp index 7a6f24454..6d92b1bd3 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp @@ -180,9 +180,10 @@ struct touch_interior : public base_turn_handler static unsigned int const index_p = Index; static unsigned int const index_q = 1 - Index; - bool const has_k = ! range_q.is_last_segment(); + bool const has_pk = ! range_p.is_last_segment(); + bool const has_qk = ! range_q.is_last_segment(); int const side_qi_p = dir_info.sides.template get(); - int const side_qk_p = has_k ? side.qk_wrt_p1() : 0; + int const side_qk_p = has_qk ? side.qk_wrt_p1() : 0; if (side_qi_p == -side_qk_p) { @@ -195,10 +196,10 @@ struct touch_interior : public base_turn_handler return; } - int const side_qk_q = has_k ? side.qk_wrt_q1() : 0; + int const side_qk_q = has_qk ? side.qk_wrt_q1() : 0; // Only necessary if rescaling is turned off: - int const side_pj_q2 = side.pj_wrt_q2(); + int const side_pj_q2 = has_qk ? side.pj_wrt_q2() : 0; if (side_qi_p == -1 && side_qk_p == -1 && side_qk_q == 1) { @@ -209,7 +210,7 @@ struct touch_interior : public base_turn_handler } else if (side_qi_p == 1 && side_qk_p == 1 && side_qk_q == -1) { - if (side_pj_q2 == -1) + if (has_qk && side_pj_q2 == -1) { // Q turns right on the left side of P (test "ML3") // Union: take both operations @@ -233,14 +234,14 @@ struct touch_interior : public base_turn_handler // Union: take left turn (Q if Q turns left, P if Q turns right) // Intersection: other turn unsigned int index = side_qk_q == 1 ? index_q : index_p; - if (side_pj_q2 == 0) + if (has_qk && side_pj_q2 == 0) { // Even though sides xk w.r.t. 1 are distinct, pj is collinear // with q. Therefore swap the path index = 1 - index; } - if (opposite(side_pj_q2, side_qi_p)) + if (has_pk && has_qk && opposite(side_pj_q2, side_qi_p)) { // Without rescaling, floating point requires extra measures int const side_qj_p1 = side.qj_wrt_p1();