diff --git a/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp b/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp index da8c6af04..be992ac86 100644 --- a/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp @@ -76,7 +76,7 @@ struct ring_info_helper {} inline ring_info_helper(ring_identifier i, area_type a) - : id(i), real_area(a), abs_area(abs(a)) + : id(i), real_area(a), abs_area(geometry::math::abs(a)) {} }; diff --git a/include/boost/geometry/algorithms/detail/overlay/calculate_distance_policy.hpp b/include/boost/geometry/algorithms/detail/overlay/calculate_distance_policy.hpp index a88060efb..5b0c38467 100644 --- a/include/boost/geometry/algorithms/detail/overlay/calculate_distance_policy.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/calculate_distance_policy.hpp @@ -10,7 +10,7 @@ #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_CALCULATE_DISTANCE_POLICY_HPP -#include +#include namespace boost { namespace geometry @@ -34,9 +34,9 @@ struct calculate_distance_policy static inline void apply(Info& info, Point1 const& p1, Point2 const& p2) { info.operations[0].enriched.distance - = geometry::distance(info.point, p1); + = geometry::comparable_distance(info.point, p1); info.operations[1].enriched.distance - = geometry::distance(info.point, p2); + = geometry::comparable_distance(info.point, p2); } }; diff --git a/include/boost/geometry/algorithms/detail/overlay/enrichment_info.hpp b/include/boost/geometry/algorithms/detail/overlay/enrichment_info.hpp index 132b2dbf1..9d838fb49 100644 --- a/include/boost/geometry/algorithms/detail/overlay/enrichment_info.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/enrichment_info.hpp @@ -10,7 +10,7 @@ #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_ENRICHMENT_INFO_HPP -#include +#include namespace boost { namespace geometry @@ -23,15 +23,25 @@ namespace detail { namespace overlay /*! - \brief Keeps info to enrich intersection info (per source) - \details Class to keep information necessary for traversal phase (a phase - of the overlay process). The information is gathered during the - enrichment phase +\brief Keeps info to enrich intersection info (per source) +\details Class to keep information necessary for traversal phase (a phase + of the overlay process). The information is gathered during the + enrichment phase */ template struct enrichment_info { - typedef typename default_distance_result::type distance_type; + typedef typename strategy::distance::services::return_type + < + typename strategy::distance::services::comparable_type + < + typename strategy::distance::services::default_strategy + < + point_tag, + P + >::type + >::type + >::type distance_type; inline enrichment_info() : travels_to_vertex_index(-1) diff --git a/include/boost/geometry/strategies/cartesian/area_surveyor.hpp b/include/boost/geometry/strategies/cartesian/area_surveyor.hpp index 033c4a433..2759466e5 100644 --- a/include/boost/geometry/strategies/cartesian/area_surveyor.hpp +++ b/include/boost/geometry/strategies/cartesian/area_surveyor.hpp @@ -82,7 +82,7 @@ private : inline return_type area() const { return_type result = sum; - result *= 0.5; + result /= 2; return result; } }; diff --git a/include/boost/geometry/strategies/cartesian/cart_intersect.hpp b/include/boost/geometry/strategies/cartesian/cart_intersect.hpp index 352cd7bff..b081e1937 100644 --- a/include/boost/geometry/strategies/cartesian/cart_intersect.hpp +++ b/include/boost/geometry/strategies/cartesian/cart_intersect.hpp @@ -376,8 +376,8 @@ private : // In robustness it can occur that a point of A is inside B AND a point of B is inside A, // still while has_common_points is true (so one point equals the other). // If that is the case we select on length. - coordinate_type const length_a = abs(a_1 - a_2); - coordinate_type const length_b = abs(b_1 - b_2); + coordinate_type const length_a = geometry::math::abs(a_1 - a_2); + coordinate_type const length_b = geometry::math::abs(b_1 - b_2); if (length_a > length_b) { a_in_b = false;