diff --git a/include/boost/geometry/algorithms/buffer.hpp b/include/boost/geometry/algorithms/buffer.hpp index ec2f9c5ac..c7343c4bb 100644 --- a/include/boost/geometry/algorithms/buffer.hpp +++ b/include/boost/geometry/algorithms/buffer.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 2017. -// Modifications copyright (c) 2017 Oracle and/or its affiliates. +// This file was modified by Oracle on 2017, 2019. +// Modifications copyright (c) 2017, 2019 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 @@ -224,7 +224,11 @@ inline void buffer(GeometryIn const& geometry_in, concepts::check(); typedef typename point_type::type point_type; - typedef typename rescale_policy_type::type rescale_policy_type; + typedef typename rescale_policy_type + < + point_type, + typename geometry::cs_tag::type + >::type rescale_policy_type; geometry_out.clear(); diff --git a/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp b/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp index 00b6a5178..8a4618da4 100644 --- a/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp @@ -175,7 +175,8 @@ struct buffered_piece_collection typedef typename geometry::rescale_policy_type < - typename geometry::point_type::type + typename geometry::point_type::type, + typename IntersectionStrategy::cs_tag >::type rescale_policy_type; typedef typename geometry::segment_ratio_type diff --git a/include/boost/geometry/algorithms/detail/closest_feature/range_to_range.hpp b/include/boost/geometry/algorithms/detail/closest_feature/range_to_range.hpp index 26b868482..a3e99bec7 100644 --- a/include/boost/geometry/algorithms/detail/closest_feature/range_to_range.hpp +++ b/include/boost/geometry/algorithms/detail/closest_feature/range_to_range.hpp @@ -1,8 +1,9 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2014, Oracle and/or its affiliates. +// 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 // Licensed under the Boost Software License version 1.0. // http://www.boost.org/users/license.html @@ -53,7 +54,15 @@ private: QueryRangeIterator& qit_min, Distance& dist_min) { - typedef index::rtree > rtree_type; + typedef strategy::index::services::from_strategy + < + Strategy + > index_strategy_from; + typedef index::parameters + < + index::linear<8>, typename index_strategy_from::type + > index_parameters_type; + typedef index::rtree rtree_type; BOOST_GEOMETRY_ASSERT( rtree_first != rtree_last ); BOOST_GEOMETRY_ASSERT( queries_first != queries_last ); @@ -62,7 +71,9 @@ private: dist_min = zero; // create -- packing algorithm - rtree_type rt(rtree_first, rtree_last); + rtree_type rt(rtree_first, rtree_last, + index_parameters_type(index::linear<8>(), + index_strategy_from::get(strategy))); RTreeValueType t_v; bool first = true; diff --git a/include/boost/geometry/algorithms/detail/comparable_distance/interface.hpp b/include/boost/geometry/algorithms/detail/comparable_distance/interface.hpp index 3e48a05ba..27174a71b 100644 --- a/include/boost/geometry/algorithms/detail/comparable_distance/interface.hpp +++ b/include/boost/geometry/algorithms/detail/comparable_distance/interface.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, 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. @@ -35,9 +36,10 @@ namespace boost { namespace geometry namespace resolve_strategy { +template struct comparable_distance { - template + template static inline typename comparable_distance_result::type apply(Geometry1 const& geometry1, @@ -59,7 +61,11 @@ struct comparable_distance Strategy >::apply(strategy)); } +}; +template <> +struct comparable_distance +{ template static inline typename comparable_distance_result < @@ -101,9 +107,10 @@ struct comparable_distance Geometry2 const& geometry2, Strategy const& strategy) { - return resolve_strategy::comparable_distance::apply(geometry1, - geometry2, - strategy); + return resolve_strategy::comparable_distance + < + Strategy + >::apply(geometry1, geometry2, strategy); } }; diff --git a/include/boost/geometry/algorithms/detail/direction_code.hpp b/include/boost/geometry/algorithms/detail/direction_code.hpp index 9acd2c301..ab3b1e0a2 100644 --- a/include/boost/geometry/algorithms/detail/direction_code.hpp +++ b/include/boost/geometry/algorithms/detail/direction_code.hpp @@ -223,7 +223,7 @@ struct direction_code_impl return direction_code_impl < - Point, spherical_equatorial_tag + spherical_equatorial_tag >::apply(segment_a, segment_b, p); } }; diff --git a/include/boost/geometry/algorithms/detail/disjoint/linear_segment_or_box.hpp b/include/boost/geometry/algorithms/detail/disjoint/linear_segment_or_box.hpp index b4c71c8f3..ebf41e896 100644 --- a/include/boost/geometry/algorithms/detail/disjoint/linear_segment_or_box.hpp +++ b/include/boost/geometry/algorithms/detail/disjoint/linear_segment_or_box.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-2014. -// Modifications copyright (c) 2013-2014, Oracle and/or its affiliates. +// This file was modified by Oracle on 2013-2019. +// Modifications copyright (c) 2013-2019, 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 @@ -21,19 +21,14 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_LINEAR_SEGMENT_OR_BOX_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_LINEAR_SEGMENT_OR_BOX_HPP -#include -#include - -#include - -#include - -#include - -#include #include #include +#include +#include +#include +#include +#include namespace boost { namespace geometry @@ -45,6 +40,44 @@ namespace detail { namespace disjoint { +template +< + typename SegmentOrBox, + typename Tag = typename tag::type +> +struct disjoint_point_segment_or_box + : not_implemented +{}; + +template +struct disjoint_point_segment_or_box +{ + template + static inline bool apply(Point const& point, Segment const& segment, Strategy const& strategy) + { + return dispatch::disjoint + < + Point, Segment + >::apply(point, segment, + strategy.template get_point_in_geometry_strategy()); + } +}; + +template +struct disjoint_point_segment_or_box +{ + template + static inline bool apply(Point const& point, Box const& box, Strategy const& strategy) + { + return dispatch::disjoint + < + Point, Box + >::apply(point, box, + strategy.get_disjoint_point_box_strategy()); + } +}; + + template < typename Range, @@ -83,12 +116,12 @@ struct disjoint_range_segment_or_box } else if ( count == 1 ) { - return dispatch::disjoint + return disjoint_point_segment_or_box < - point_type, SegmentOrBox + SegmentOrBox >::apply(geometry::range::front(view), segment_or_box, - strategy.template get_point_in_geometry_strategy()); + strategy); } else { diff --git a/include/boost/geometry/algorithms/detail/disjoint/multipoint_geometry.hpp b/include/boost/geometry/algorithms/detail/disjoint/multipoint_geometry.hpp index 5bc8af77d..58fe2b4fd 100644 --- a/include/boost/geometry/algorithms/detail/disjoint/multipoint_geometry.hpp +++ b/include/boost/geometry/algorithms/detail/disjoint/multipoint_geometry.hpp @@ -307,21 +307,23 @@ template class multi_point_multi_geometry { private: + template struct expand_box_point { template static inline void apply(Box& total, Point const& point) { - geometry::expand(total, point); + geometry::expand(total, point, ExpandPointStrategy()); } }; + template struct expand_box_box_pair { template inline void apply(Box& total, BoxPair const& box_pair) const { - geometry::expand(total, box_pair.first); + geometry::expand(total, box_pair.first, ExpandBoxStrategy()); } }; @@ -411,10 +413,18 @@ public: item_visitor_type visitor(multi_geometry, strategy); + typedef expand_box_point + < + typename Strategy::expand_point_strategy_type + > expand_box_point_type; typedef overlaps_box_point < typename Strategy::disjoint_point_box_strategy_type > overlaps_box_point_type; + typedef expand_box_box_pair + < + typename Strategy::envelope_strategy_type::box_expand_strategy_type + > expand_box_box_pair_type; typedef overlaps_box_box_pair < typename Strategy::disjoint_box_box_strategy_type @@ -424,9 +434,9 @@ public: < box1_type >::apply(multi_point, boxes, visitor, - expand_box_point(), + expand_box_point_type(), overlaps_box_point_type(), - expand_box_box_pair(), + expand_box_box_pair_type(), overlaps_box_box_pair_type()); return ! visitor.intersection_found(); diff --git a/include/boost/geometry/algorithms/detail/distance/geometry_to_segment_or_box.hpp b/include/boost/geometry/algorithms/detail/distance/geometry_to_segment_or_box.hpp index d6de7cac9..964f3e218 100644 --- a/include/boost/geometry/algorithms/detail/distance/geometry_to_segment_or_box.hpp +++ b/include/boost/geometry/algorithms/detail/distance/geometry_to_segment_or_box.hpp @@ -1,8 +1,9 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2014, Oracle and/or its affiliates. +// 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 // Licensed under the Boost Software License version 1.0. // http://www.boost.org/users/license.html @@ -165,6 +166,27 @@ private: } }; + template + < + typename SegOrBox, + typename SegOrBoxTag = typename tag::type + > + struct intersects + { + static inline bool apply(Geometry const& g1, SegOrBox const& g2, Strategy const&) + { + return geometry::intersects(g1, g2); + } + }; + + template + struct intersects + { + static inline bool apply(Geometry const& g1, SegOrBox const& g2, Strategy const& s) + { + return geometry::intersects(g1, g2, s.get_relate_segment_segment_strategy()); + } + }; public: typedef typename strategy::distance::services::return_type @@ -194,7 +216,7 @@ public: if (check_intersection - && geometry::intersects(geometry, segment_or_box)) + && intersects::apply(geometry, segment_or_box, strategy)) { return 0; } diff --git a/include/boost/geometry/algorithms/detail/distance/linear_or_areal_to_areal.hpp b/include/boost/geometry/algorithms/detail/distance/linear_or_areal_to_areal.hpp index 7b81d68bb..dfd9d770e 100644 --- a/include/boost/geometry/algorithms/detail/distance/linear_or_areal_to_areal.hpp +++ b/include/boost/geometry/algorithms/detail/distance/linear_or_areal_to_areal.hpp @@ -1,8 +1,9 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2014, Oracle and/or its affiliates. +// 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 // Licensed under the Boost Software License version 1.0. // http://www.boost.org/users/license.html @@ -40,7 +41,8 @@ struct linear_to_areal Areal const& areal, Strategy const& strategy) { - if ( geometry::intersects(linear, areal) ) + if ( geometry::intersects(linear, areal, + strategy.get_relate_segment_segment_strategy()) ) { return 0; } @@ -74,7 +76,8 @@ struct areal_to_areal Areal2 const& areal2, Strategy const& strategy) { - if ( geometry::intersects(areal1, areal2) ) + if ( geometry::intersects(areal1, areal2, + strategy.get_relate_segment_segment_strategy()) ) { return 0; } diff --git a/include/boost/geometry/algorithms/detail/distance/multipoint_to_geometry.hpp b/include/boost/geometry/algorithms/detail/distance/multipoint_to_geometry.hpp index 8f1b33cfb..da54f20a4 100644 --- a/include/boost/geometry/algorithms/detail/distance/multipoint_to_geometry.hpp +++ b/include/boost/geometry/algorithms/detail/distance/multipoint_to_geometry.hpp @@ -1,8 +1,9 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2014, Oracle and/or its affiliates. +// 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 // Licensed under the Boost Software License version 1.0. // http://www.boost.org/users/license.html @@ -113,19 +114,21 @@ template class multipoint_to_areal { private: + template struct not_covered_by_areal { - not_covered_by_areal(Areal const& areal) - : m_areal(areal) + not_covered_by_areal(Areal const& areal, CoveredByStrategy const& strategy) + : m_areal(areal), m_strategy(strategy) {} template inline bool apply(Point const& point) const { - return !geometry::covered_by(point, m_areal); + return !geometry::covered_by(point, m_areal, m_strategy); } Areal const& m_areal; + CoveredByStrategy const& m_strategy; }; public: @@ -140,11 +143,16 @@ public: Areal const& areal, Strategy const& strategy) { - not_covered_by_areal predicate(areal); + typedef not_covered_by_areal + < + typename Strategy::point_in_geometry_strategy_type + > predicate_type; + + predicate_type predicate(areal, strategy.get_point_in_geometry_strategy()); if (check_iterator_range < - not_covered_by_areal, false + predicate_type, false >::apply(boost::begin(multipoint), boost::end(multipoint), predicate)) 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 f41cf5c76..177eb19f1 100644 --- a/include/boost/geometry/algorithms/detail/distance/point_to_geometry.hpp +++ b/include/boost/geometry/algorithms/detail/distance/point_to_geometry.hpp @@ -161,7 +161,8 @@ struct point_to_ring Strategy const& strategy) { // TODO: pass strategy - if (within::within_point_geometry(point, ring)) + if (within::within_point_geometry(point, ring, + strategy.get_point_in_geometry_strategy())) { return return_type(0); } @@ -206,7 +207,8 @@ private: for (InteriorRingIterator it = first; it != last; ++it) { // TODO: pass strategy - if (within::within_point_geometry(point, *it)) + if (within::within_point_geometry(point, *it, + strategy.get_point_in_geometry_strategy())) { // the point is inside a polygon hole, so its distance // to the polygon its distance to the polygon's @@ -236,7 +238,8 @@ public: Strategy const& strategy) { // TODO: pass strategy - if (! within::covered_by_point_geometry(point, exterior_ring(polygon))) + if (! within::covered_by_point_geometry(point, exterior_ring(polygon), + strategy.get_point_in_geometry_strategy())) { // the point is outside the exterior ring, so its distance // to the polygon is its distance to the polygon's exterior ring @@ -334,7 +337,8 @@ struct point_to_multigeometry Strategy const& strategy) { // TODO: pass strategy - if (within::covered_by_point_geometry(point, multipolygon)) + if (within::covered_by_point_geometry(point, multipolygon, + strategy.get_point_in_geometry_strategy())) { 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 d88a6699c..93ebebe18 100644 --- a/include/boost/geometry/algorithms/detail/distance/segment_to_box.hpp +++ b/include/boost/geometry/algorithms/detail/distance/segment_to_box.hpp @@ -542,10 +542,8 @@ private: SBStrategy const& sb_strategy, ReturnType& result) { - typedef typename geometry::strategy::side::services::default_strategy - < - typename geometry::cs_tag::type - >::type side; + typename SBStrategy::side_strategy_type + side_strategy = sb_strategy.get_side_strategy(); typedef cast_to_result cast; ReturnType diff1 = cast::apply(geometry::get<1>(p1)) @@ -555,12 +553,12 @@ private: sb_strategy.get_distance_ps_strategy(); int sign = diff1 < 0 ? -1 : 1; - if (side::apply(p0, p1, corner1) * sign < 0) + if (side_strategy.apply(p0, p1, corner1) * sign < 0) { result = cast::apply(ps_strategy.apply(corner1, p0, p1)); return true; } - if (side::apply(p0, p1, corner2) * sign > 0) + if (side_strategy.apply(p0, p1, corner2) * sign > 0) { result = cast::apply(ps_strategy.apply(corner2, p0, p1)); return true; @@ -682,7 +680,7 @@ public: BoxPoint const& bottom_right, SBStrategy const& sb_strategy) { - BOOST_GEOMETRY_ASSERT( geometry::less()(p0, p1) + BOOST_GEOMETRY_ASSERT( (geometry::less()(p0, p1)) || geometry::has_nan_coordinate(p0) || geometry::has_nan_coordinate(p1) ); @@ -782,15 +780,9 @@ public: >, typename strategy::distance::services::comparable_type < - typename detail::distance::default_strategy - < - segment_point, Box - >::type + typename SBStrategy::distance_pb_strategy::type >::type, - typename detail::distance::default_strategy - < - segment_point, Box - >::type + typename SBStrategy::distance_pb_strategy::type >::type point_box_strategy_type; return dispatch::distance @@ -809,7 +801,8 @@ public: bottom_left, bottom_right, top_left, top_right); - if (geometry::less()(p[0], p[1])) + typedef geometry::less less_type; + if (less_type()(p[0], p[1])) { return segment_to_box_2D < diff --git a/include/boost/geometry/algorithms/detail/distance/segment_to_segment.hpp b/include/boost/geometry/algorithms/detail/distance/segment_to_segment.hpp index bdf056d76..55380a3a8 100644 --- a/include/boost/geometry/algorithms/detail/distance/segment_to_segment.hpp +++ b/include/boost/geometry/algorithms/detail/distance/segment_to_segment.hpp @@ -1,8 +1,9 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2014, Oracle and/or its affiliates. +// 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 // Licensed under the Boost Software License version 1.0. // http://www.boost.org/users/license.html @@ -70,7 +71,7 @@ public: apply(Segment1 const& segment1, Segment2 const& segment2, Strategy const& strategy) { - if (geometry::intersects(segment1, segment2)) + if (geometry::intersects(segment1, segment2, strategy.get_relate_segment_segment_strategy())) { return 0; } diff --git a/include/boost/geometry/algorithms/detail/intersection/interface.hpp b/include/boost/geometry/algorithms/detail/intersection/interface.hpp index 0efc9731b..a928e6ea5 100644 --- a/include/boost/geometry/algorithms/detail/intersection/interface.hpp +++ b/include/boost/geometry/algorithms/detail/intersection/interface.hpp @@ -2,8 +2,8 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2014, 2017. -// Modifications copyright (c) 2014-2017, Oracle and/or its affiliates. +// This file was modified by Oracle on 2014, 2017, 2019. +// Modifications copyright (c) 2014-2019, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -109,16 +109,25 @@ struct intersection < typename Geometry1, typename Geometry2, - typename RobustPolicy, typename GeometryOut, typename Strategy > static inline bool apply(Geometry1 const& geometry1, Geometry2 const& geometry2, - RobustPolicy const& robust_policy, GeometryOut & geometry_out, Strategy const& strategy) { + typedef typename geometry::rescale_overlay_policy_type + < + Geometry1, + Geometry2, + typename Strategy::cs_tag + >::type rescale_policy_type; + + rescale_policy_type robust_policy + = geometry::get_rescale_policy(geometry1, + geometry2); + return dispatch::intersection < Geometry1, @@ -131,15 +140,24 @@ struct intersection < typename Geometry1, typename Geometry2, - typename RobustPolicy, typename GeometryOut > static inline bool apply(Geometry1 const& geometry1, Geometry2 const& geometry2, - RobustPolicy const& robust_policy, GeometryOut & geometry_out, default_strategy) { + typedef typename geometry::rescale_overlay_policy_type + < + Geometry1, + Geometry2, + typename geometry::cs_tag::type + >::type rescale_policy_type; + + rescale_policy_type robust_policy + = geometry::get_rescale_policy(geometry1, + geometry2); + typedef typename strategy::relate::services::default_strategy < Geometry1, Geometry2 @@ -172,19 +190,8 @@ struct intersection concepts::check(); concepts::check(); - typedef typename geometry::rescale_overlay_policy_type - < - Geometry1, - Geometry2 - >::type rescale_policy_type; - - rescale_policy_type robust_policy - = geometry::get_rescale_policy(geometry1, - geometry2); - return resolve_strategy::intersection::apply(geometry1, geometry2, - robust_policy, geometry_out, strategy); } 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 82818b099..3fc6ce6b8 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-2018, Oracle and/or its affiliates. +// 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 @@ -41,7 +41,7 @@ namespace detail { namespace is_valid template < typename Geometry, - typename IsAcceptableTurn = is_acceptable_turn + typename CSTag > class has_valid_self_turns { @@ -50,7 +50,8 @@ private: typedef typename geometry::rescale_policy_type < - point_type + point_type, + CSTag >::type rescale_policy_type; typedef detail::overlay::get_turn_info @@ -83,7 +84,7 @@ public: detail::overlay::stateless_predicate_based_interrupt_policy < - IsAcceptableTurn + is_acceptable_turn > interrupt_policy; detail::self_get_turn_points::self_turns(geometry, diff --git a/include/boost/geometry/algorithms/detail/is_valid/multipolygon.hpp b/include/boost/geometry/algorithms/detail/is_valid/multipolygon.hpp index 25aa579f5..36c1979fb 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/multipolygon.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/multipolygon.hpp @@ -317,7 +317,7 @@ public: // compute turns and check if all are acceptable debug_phase::apply(2); - typedef has_valid_self_turns has_valid_turns; + typedef has_valid_self_turns has_valid_turns; std::deque turns; bool has_invalid_turns = diff --git a/include/boost/geometry/algorithms/detail/is_valid/polygon.hpp b/include/boost/geometry/algorithms/detail/is_valid/polygon.hpp index b799b383f..142500a9c 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/polygon.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/polygon.hpp @@ -476,7 +476,7 @@ public: // compute turns and check if all are acceptable debug_phase::apply(3); - typedef has_valid_self_turns has_valid_turns; + typedef has_valid_self_turns has_valid_turns; std::deque turns; bool has_invalid_turns diff --git a/include/boost/geometry/algorithms/detail/is_valid/ring.hpp b/include/boost/geometry/algorithms/detail/is_valid/ring.hpp index 8927b2a5e..2a377ee8c 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/ring.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/ring.hpp @@ -209,7 +209,7 @@ struct is_valid_ring && ! has_duplicates::apply(ring, visitor) && ! has_spikes::apply(ring, visitor, strategy.get_side_strategy()) && (! CheckSelfIntersections - || has_valid_self_turns::apply(ring, visitor, strategy)) + || has_valid_self_turns::apply(ring, visitor, strategy)) && is_properly_oriented::apply(ring, visitor, strategy); } }; diff --git a/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp b/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp index f3fc32d74..6f36a44fe 100644 --- a/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp @@ -193,7 +193,7 @@ struct assign_visitor ring_info_type& inner_in_map = m_ring_map[inner.id]; if (geometry::covered_by(inner_in_map.point, outer.envelope, - Strategy::disjoint_point_box_strategy_type()) + typename Strategy::disjoint_point_box_strategy_type()) && within_selected_input(inner_in_map, inner.id, outer.id, m_geometry1, m_geometry2, m_collection, m_strategy) diff --git a/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp b/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp index 60255cd95..58f10936c 100644 --- a/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp @@ -2,8 +2,8 @@ // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. -// 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 Menelaos Karavelas, on behalf of Oracle // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -1290,7 +1290,8 @@ inline OutputIterator intersection_insert(Geometry1 const& geometry1, typedef typename geometry::rescale_policy_type < - typename geometry::point_type::type // TODO from both + typename geometry::point_type::type, // TODO from both + typename Strategy::cs_tag >::type rescale_policy_type; rescale_policy_type robust_policy diff --git a/include/boost/geometry/algorithms/detail/overlay/linear_linear.hpp b/include/boost/geometry/algorithms/detail/overlay/linear_linear.hpp index f0a7d6a7a..a6e66b03d 100644 --- a/include/boost/geometry/algorithms/detail/overlay/linear_linear.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/linear_linear.hpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2014-2017, Oracle and/or its affiliates. +// Copyright (c) 2014-2019, Oracle and/or its affiliates. // Licensed under the Boost Software License version 1.0. // http://www.boost.org/users/license.html @@ -169,8 +169,7 @@ protected: LinearGeometry1, LinearGeometry2, assign_policy - >, - RobustPolicy + > >::apply(turns, linear1, linear2, interrupt_policy, strategy, robust_policy); } @@ -237,13 +236,12 @@ public: Linear1, Linear2, detail::get_turns::get_turn_info_type - < - Linear1, - Linear2, - assign_policy - >, - RobustPolicy - >::turn_info turn_info; + < + Linear1, + Linear2, + assign_policy + > + >::template turn_info_type::type turn_info; typedef std::vector turns_container; diff --git a/include/boost/geometry/algorithms/detail/point_is_spike_or_equal.hpp b/include/boost/geometry/algorithms/detail/point_is_spike_or_equal.hpp index f83162966..502a5b0bb 100644 --- a/include/boost/geometry/algorithms/detail/point_is_spike_or_equal.hpp +++ b/include/boost/geometry/algorithms/detail/point_is_spike_or_equal.hpp @@ -5,8 +5,8 @@ // Copyright (c) 2009-2015 Mateusz Loskot, London, UK. // Copyright (c) 2013-2015 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, 2019. +// Modifications copyright (c) 2015-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 @@ -75,7 +75,7 @@ inline bool point_is_spike_or_equal(Point1 const& last_point, // prev | back Point3 const& segment_b, // curr | back - 1 | spike's vertex SideStrategy const& strategy) { - typedef SideStrategy::cs_tag cs_tag; + typedef typename SideStrategy::cs_tag cs_tag; int const side = strategy.apply(segment_a, segment_b, last_point); if (side == 0) diff --git a/include/boost/geometry/algorithms/detail/relate/areal_areal.hpp b/include/boost/geometry/algorithms/detail/relate/areal_areal.hpp index fa0ab1ea0..06192e38d 100644 --- a/include/boost/geometry/algorithms/detail/relate/areal_areal.hpp +++ b/include/boost/geometry/algorithms/detail/relate/areal_areal.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, 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 @@ -223,7 +223,10 @@ struct areal_areal return; // get and analyse turns - typedef typename turns::get_turns::turn_info turn_type; + typedef typename turns::get_turns + < + Geometry1, Geometry2 + >::template turn_info_type::type turn_type; std::vector turns; interrupt_policy_areal_areal interrupt_policy(geometry1, geometry2, result); diff --git a/include/boost/geometry/algorithms/detail/relate/linear_areal.hpp b/include/boost/geometry/algorithms/detail/relate/linear_areal.hpp index 81fc9e5b3..018565f2e 100644 --- a/include/boost/geometry/algorithms/detail/relate/linear_areal.hpp +++ b/include/boost/geometry/algorithms/detail/relate/linear_areal.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, 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 @@ -219,21 +219,21 @@ struct linear_areal > {}; - template + template struct multi_turn_info - : turns::get_turns::turn_info + : turns::get_turns::template turn_info_type::type { multi_turn_info() : priority(0) {} int priority; // single-geometry sorting priority }; - template + template struct turn_info_type : boost::mpl::if_c < is_multi::value, - multi_turn_info, - typename turns::get_turns::turn_info + multi_turn_info, + typename turns::get_turns::template turn_info_type::type > {}; @@ -251,7 +251,7 @@ struct linear_areal return; // get and analyse turns - typedef typename turn_info_type::type turn_type; + typedef typename turn_info_type::type turn_type; std::vector turns; interrupt_policy_linear_areal interrupt_policy(geometry2, result); diff --git a/include/boost/geometry/algorithms/detail/relate/linear_linear.hpp b/include/boost/geometry/algorithms/detail/relate/linear_linear.hpp index 6c5d82fde..7be6bc788 100644 --- a/include/boost/geometry/algorithms/detail/relate/linear_linear.hpp +++ b/include/boost/geometry/algorithms/detail/relate/linear_linear.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, 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 @@ -133,7 +133,10 @@ struct linear_linear return; // get and analyse turns - typedef typename turns::get_turns::turn_info turn_type; + typedef typename turns::get_turns + < + Geometry1, Geometry2 + >::template turn_info_type::type turn_type; std::vector turns; interrupt_policy_linear_linear interrupt_policy(result); 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 8dec5ccda..7f9e13839 100644 --- a/include/boost/geometry/algorithms/detail/relate/multi_point_geometry.hpp +++ b/include/boost/geometry/algorithms/detail/relate/multi_point_geometry.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 @@ -113,7 +113,7 @@ template struct multi_point_geometry_eb { // TODO: CS-specific less compare strategy derived from EqPPStrategy - typedef geometry::less<> less_type; + typedef geometry::less less_type; template struct boundary_visitor @@ -257,21 +257,23 @@ struct multi_point_single_geometry template class multi_point_multi_geometry_ii_ib { + template struct expand_box_point { template static inline void apply(Box& total, Point const& point) { - geometry::expand(total, point); + geometry::expand(total, point, ExpandPointStrategy()); } }; + template struct expand_box_box_pair { template static inline void apply(Box& total, BoxPair const& box_pair) { - geometry::expand(total, box_pair.first); + geometry::expand(total, box_pair.first, ExpandBoxStrategy()); } }; @@ -384,10 +386,18 @@ public: { item_visitor_type visitor(multi_geometry, tc, result, strategy); + typedef expand_box_point + < + typename Strategy::expand_point_strategy_type + > expand_box_point_type; typedef overlaps_box_point < typename Strategy::disjoint_point_box_strategy_type > overlaps_box_point_type; + typedef expand_box_box_pair + < + typename Strategy::envelope_strategy_type::box_expand_strategy_type + > expand_box_box_pair_type; typedef overlaps_box_box_pair < typename Strategy::disjoint_box_box_strategy_type @@ -397,9 +407,9 @@ public: < box1_type >::apply(multi_point, boxes, visitor, - expand_box_point(), + expand_box_point_type(), overlaps_box_point_type(), - expand_box_box_pair(), + expand_box_box_pair_type(), overlaps_box_box_pair_type()); } @@ -431,7 +441,17 @@ struct multi_point_multi_geometry_ii_ib_ie Result & result, Strategy const& strategy) { - index::rtree > rt(boxes.begin(), boxes.end()); + typedef strategy::index::services::from_strategy + < + Strategy + > index_strategy_from; + typedef index::parameters + < + index::rstar<4>, typename index_strategy_from::type + > index_parameters_type; + index::rtree + rtree(boxes.begin(), boxes.end(), + index_parameters_type(index::rstar<4>(), index_strategy_from::get(strategy))); typedef typename boost::range_const_iterator::type iterator; for ( iterator it = boost::begin(multi_point) ; it != boost::end(multi_point) ; ++it ) @@ -446,7 +466,7 @@ struct multi_point_multi_geometry_ii_ib_ie typename boost::range_value::type const& point = *it; boxes_type boxes_found; - rt.query(index::intersects(point), std::back_inserter(boxes_found)); + rtree.query(index::intersects(point), std::back_inserter(boxes_found)); bool found_ii_or_ib = false; for (boxes_iterator bi = boxes_found.begin() ; bi != boxes_found.end() ; ++bi) diff --git a/include/boost/geometry/algorithms/detail/relate/turns.hpp b/include/boost/geometry/algorithms/detail/relate/turns.hpp index 01c4304fa..ff3807f16 100644 --- a/include/boost/geometry/algorithms/detail/relate/turns.hpp +++ b/include/boost/geometry/algorithms/detail/relate/turns.hpp @@ -2,8 +2,8 @@ // Copyright (c) 2007-2015 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, 2019. +// Modifications copyright (c) 2013-2019 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 @@ -47,18 +47,30 @@ template typename GetTurnPolicy = detail::get_turns::get_turn_info_type < Geometry1, Geometry2, assign_policy<> - >, - typename RobustPolicy = typename geometry::rescale_overlay_policy_type - < - Geometry1, - Geometry2 - >::type + > > struct get_turns { typedef typename geometry::point_type::type point1_type; - typedef overlay::turn_info + template + struct robust_policy_type + : geometry::rescale_overlay_policy_type + < + Geometry1, + Geometry2, + typename Strategy::cs_tag + > + {}; + + template + < + typename Strategy, + typename RobustPolicy = typename robust_policy_type::type + > + struct turn_info_type + { + typedef overlay::turn_info < point1_type, typename segment_ratio_type::type, @@ -70,7 +82,8 @@ struct get_turns point1_type, RobustPolicy >::type >::type - > turn_info; + > type; + }; template static inline void apply(Turns & turns, @@ -94,15 +107,17 @@ struct get_turns InterruptPolicy & interrupt_policy, IntersectionStrategy const& intersection_strategy) { - RobustPolicy robust_policy = geometry::get_rescale_policy + typedef typename robust_policy_type::type robust_policy_t; + + robust_policy_t robust_policy = geometry::get_rescale_policy < - RobustPolicy + robust_policy_t >(geometry1, geometry2); apply(turns, geometry1, geometry2, interrupt_policy, intersection_strategy, robust_policy); } - template + template static inline void apply(Turns & turns, Geometry1 const& geometry1, Geometry2 const& geometry2, diff --git a/include/boost/geometry/algorithms/detail/within/multi_point.hpp b/include/boost/geometry/algorithms/detail/within/multi_point.hpp index 711c5b61c..66ae88240 100644 --- a/include/boost/geometry/algorithms/detail/within/multi_point.hpp +++ b/include/boost/geometry/algorithms/detail/within/multi_point.hpp @@ -1,6 +1,6 @@ // Boost.Geometry -// Copyright (c) 2017 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 @@ -116,7 +116,7 @@ struct multi_point_single_geometry LinearOrAreal const& linear_or_areal, Strategy const& strategy) { - typedef typename boost::range_value::type point1_type; + //typedef typename boost::range_value::type point1_type; typedef typename point_type::type point2_type; typedef model::box box2_type; @@ -195,7 +195,17 @@ struct multi_point_multi_geometry } // Create R-tree - index::rtree > rtree(boxes.begin(), boxes.end()); + typedef strategy::index::services::from_strategy + < + Strategy + > index_strategy_from; + typedef index::parameters + < + index::rstar<4>, typename index_strategy_from::type + > index_parameters_type; + index::rtree + rtree(boxes.begin(), boxes.end(), + index_parameters_type(index::rstar<4>(), index_strategy_from::get(strategy))); // For each point find overlapping envelopes and test corresponding single geometries // If a point is in the exterior break diff --git a/include/boost/geometry/algorithms/difference.hpp b/include/boost/geometry/algorithms/difference.hpp index c11ceca24..31216c78d 100644 --- a/include/boost/geometry/algorithms/difference.hpp +++ b/include/boost/geometry/algorithms/difference.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, 2019. +// Modifications copyright (c) 2017, 2019, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -131,18 +131,27 @@ struct difference < typename Geometry1, typename Geometry2, - typename RobustPolicy, typename Collection, typename Strategy > static inline void apply(Geometry1 const& geometry1, Geometry2 const& geometry2, - RobustPolicy const& robust_policy, Collection & output_collection, Strategy const& strategy) { typedef typename boost::range_value::type geometry_out; + typedef typename geometry::rescale_overlay_policy_type + < + Geometry1, + Geometry2, + typename Strategy::cs_tag + >::type rescale_policy_type; + + rescale_policy_type robust_policy + = geometry::get_rescale_policy(geometry1, + geometry2); + detail::difference::difference_insert( geometry1, geometry2, robust_policy, range::back_inserter(output_collection), @@ -153,17 +162,26 @@ struct difference < typename Geometry1, typename Geometry2, - typename RobustPolicy, typename Collection > static inline void apply(Geometry1 const& geometry1, Geometry2 const& geometry2, - RobustPolicy const& robust_policy, Collection & output_collection, default_strategy) { typedef typename boost::range_value::type geometry_out; + typedef typename geometry::rescale_overlay_policy_type + < + Geometry1, + Geometry2, + typename geometry::cs_tag::type + >::type rescale_policy_type; + + rescale_policy_type robust_policy + = geometry::get_rescale_policy(geometry1, + geometry2); + detail::difference::difference_insert( geometry1, geometry2, robust_policy, range::back_inserter(output_collection)); @@ -185,18 +203,7 @@ struct difference Collection& output_collection, Strategy const& strategy) { - typedef typename geometry::rescale_overlay_policy_type - < - Geometry1, - Geometry2 - >::type rescale_policy_type; - - rescale_policy_type robust_policy - = geometry::get_rescale_policy(geometry1, - geometry2); - resolve_strategy::difference::apply(geometry1, geometry2, - robust_policy, output_collection, strategy); } diff --git a/include/boost/geometry/algorithms/sym_difference.hpp b/include/boost/geometry/algorithms/sym_difference.hpp index 725230cd5..221d7bde3 100644 --- a/include/boost/geometry/algorithms/sym_difference.hpp +++ b/include/boost/geometry/algorithms/sym_difference.hpp @@ -2,8 +2,8 @@ // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. -// 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, 2019. +// Modifications copyright (c) 2015-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 @@ -305,18 +305,27 @@ struct sym_difference < typename Geometry1, typename Geometry2, - typename RobustPolicy, typename Collection, typename Strategy > static inline void apply(Geometry1 const& geometry1, Geometry2 const& geometry2, - RobustPolicy const& robust_policy, Collection & output_collection, Strategy const& strategy) { typedef typename boost::range_value::type geometry_out; + typedef typename geometry::rescale_overlay_policy_type + < + Geometry1, + Geometry2, + typename Strategy::cs_tag + >::type rescale_policy_type; + + rescale_policy_type robust_policy + = geometry::get_rescale_policy(geometry1, + geometry2); + detail::sym_difference::sym_difference_insert( geometry1, geometry2, robust_policy, range::back_inserter(output_collection), @@ -327,17 +336,26 @@ struct sym_difference < typename Geometry1, typename Geometry2, - typename RobustPolicy, typename Collection > static inline void apply(Geometry1 const& geometry1, Geometry2 const& geometry2, - RobustPolicy const& robust_policy, Collection & output_collection, default_strategy) { typedef typename boost::range_value::type geometry_out; + typedef typename geometry::rescale_overlay_policy_type + < + Geometry1, + Geometry2, + typename geometry::cs_tag::type + >::type rescale_policy_type; + + rescale_policy_type robust_policy + = geometry::get_rescale_policy(geometry1, + geometry2); + detail::sym_difference::sym_difference_insert( geometry1, geometry2, robust_policy, range::back_inserter(output_collection)); @@ -359,18 +377,7 @@ struct sym_difference Collection& output_collection, Strategy const& strategy) { - typedef typename geometry::rescale_overlay_policy_type - < - Geometry1, - Geometry2 - >::type rescale_policy_type; - - rescale_policy_type robust_policy - = geometry::get_rescale_policy(geometry1, - geometry2); - resolve_strategy::sym_difference::apply(geometry1, geometry2, - robust_policy, output_collection, strategy); } diff --git a/include/boost/geometry/algorithms/union.hpp b/include/boost/geometry/algorithms/union.hpp index d1d04d404..44619b4e5 100644 --- a/include/boost/geometry/algorithms/union.hpp +++ b/include/boost/geometry/algorithms/union.hpp @@ -2,8 +2,8 @@ // Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2014, 2017, 2018. -// Modifications copyright (c) 2014-2018 Oracle and/or its affiliates. +// This file was modified by Oracle on 2014, 2017, 2018, 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 @@ -244,18 +244,27 @@ struct union_ < typename Geometry1, typename Geometry2, - typename RobustPolicy, typename Collection, typename Strategy > static inline void apply(Geometry1 const& geometry1, Geometry2 const& geometry2, - RobustPolicy const& robust_policy, Collection & output_collection, Strategy const& strategy) { typedef typename boost::range_value::type geometry_out; + typedef typename geometry::rescale_overlay_policy_type + < + Geometry1, + Geometry2, + typename Strategy::cs_tag + >::type rescale_policy_type; + + rescale_policy_type robust_policy + = geometry::get_rescale_policy(geometry1, + geometry2); + dispatch::union_insert < Geometry1, Geometry2, geometry_out @@ -268,12 +277,10 @@ struct union_ < typename Geometry1, typename Geometry2, - typename RobustPolicy, typename Collection > static inline void apply(Geometry1 const& geometry1, Geometry2 const& geometry2, - RobustPolicy const& robust_policy, Collection & output_collection, default_strategy) { @@ -285,6 +292,17 @@ struct union_ Geometry2 >::type strategy_type; + typedef typename geometry::rescale_overlay_policy_type + < + Geometry1, + Geometry2, + typename geometry::cs_tag::type + >::type rescale_policy_type; + + rescale_policy_type robust_policy + = geometry::get_rescale_policy(geometry1, + geometry2); + dispatch::union_insert < Geometry1, Geometry2, geometry_out @@ -313,18 +331,7 @@ struct union_ concepts::check(); concepts::check::type>(); - typedef typename geometry::rescale_overlay_policy_type - < - Geometry1, - Geometry2 - >::type rescale_policy_type; - - rescale_policy_type robust_policy - = geometry::get_rescale_policy(geometry1, - geometry2); - resolve_strategy::union_::apply(geometry1, geometry2, - robust_policy, output_collection, strategy); }