diff --git a/include/boost/geometry/algorithms/detail/disjoint/areal_areal.hpp b/include/boost/geometry/algorithms/detail/disjoint/areal_areal.hpp index 75e0ae293..05f264602 100644 --- a/include/boost/geometry/algorithms/detail/disjoint/areal_areal.hpp +++ b/include/boost/geometry/algorithms/detail/disjoint/areal_areal.hpp @@ -80,7 +80,7 @@ struct general_areal static inline bool apply(Geometry1 const& geometry1, Geometry2 const& geometry2) { - if ( !disjoint_linear::apply(geometry1, geometry2)) + if ( ! disjoint_linear::apply(geometry1, geometry2) ) { return false; } @@ -91,11 +91,8 @@ struct general_areal // We check that using a point on the surface, and see if that is inside // the other geometry. And vice versa. - typedef typename geometry::point_type::type point_type1; - typedef typename geometry::point_type::type point_type2; - - if (rings_containing(geometry1, geometry2) - || rings_containing(geometry2, geometry1)) + if ( rings_containing(geometry1, geometry2) + || rings_containing(geometry2, geometry1) ) { return false; } diff --git a/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp b/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp index 05b348a6d..f7fee8bb9 100644 --- a/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp @@ -147,11 +147,12 @@ public: RobustPolicy const& robust_policy, RangeOut& current_output) { - typedef typename boost::range_iterator::type iterator; int const from_index = seg_id.segment_index + 1; // Sanity check - if (from_index > to_index || from_index < 0 || to_index >= int(boost::size(ls))) + if ( from_index > to_index + || from_index < 0 + || to_index >= int(boost::size(ls)) ) { return; } @@ -159,7 +160,8 @@ public: typedef typename boost::range_difference::type size_type; size_type const count = to_index - from_index + 1; - typename boost::range_iterator::type it = boost::begin(ls) + from_index; + typename boost::range_iterator::type + it = boost::begin(ls) + from_index; for (size_type i = 0; i < count; ++i, ++it) { diff --git a/include/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp b/include/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp index d9c423ca4..63011c7d4 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp @@ -115,15 +115,6 @@ inline void get_intersection_points(Geometry1 const& geometry1, typename boost::range_value::type > TurnPolicy; - typedef typename strategy_intersection - < - typename cs_tag::type, - Geometry1, - Geometry2, - typename point_type::type, // TODO from both - RobustPolicy - >::segment_intersection_strategy_type segment_intersection_strategy_type; - detail::get_turns::no_interrupt_policy interrupt_policy; boost::mpl::if_c diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp index 0047d73a1..14220e87b 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp @@ -558,8 +558,6 @@ struct get_turns_cs InterruptPolicy& interrupt_policy, int multi_index = -1, int ring_index = -1) { - typedef typename boost::range_value::type turn_info; - if ( boost::size(range) <= 1) { return; diff --git a/include/boost/geometry/algorithms/detail/overlay/overlay.hpp b/include/boost/geometry/algorithms/detail/overlay/overlay.hpp index c194283f9..29e0dad0c 100644 --- a/include/boost/geometry/algorithms/detail/overlay/overlay.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/overlay.hpp @@ -165,14 +165,14 @@ struct overlay OutputIterator out, Strategy const& ) { - if (geometry::num_points(geometry1) == 0 - && geometry::num_points(geometry2) == 0) + if ( geometry::num_points(geometry1) == 0 + && geometry::num_points(geometry2) == 0 ) { return out; } - if (geometry::num_points(geometry1) == 0 - || geometry::num_points(geometry2) == 0) + if ( geometry::num_points(geometry1) == 0 + || geometry::num_points(geometry2) == 0 ) { return return_if_one_input_is_empty < @@ -180,7 +180,6 @@ struct overlay >(geometry1, geometry2, out); } - typedef typename geometry::coordinate_type::type coordinate_type; typedef typename geometry::point_type::type point_type; typedef detail::overlay::traversal_turn_info < @@ -275,8 +274,8 @@ std::cout << "traverse" << std::endl; ring_identifier id(2, 0, -1); for (typename boost::range_iterator::type it = boost::begin(rings); - it != boost::end(rings); - ++it) + it != boost::end(rings); + ++it) { selected[id] = properties(*it, true); selected[id].reversed = ReverseOut; diff --git a/include/boost/geometry/algorithms/detail/relate/areal_areal.hpp b/include/boost/geometry/algorithms/detail/relate/areal_areal.hpp index fea695e7c..151f94ade 100644 --- a/include/boost/geometry/algorithms/detail/relate/areal_areal.hpp +++ b/include/boost/geometry/algorithms/detail/relate/areal_areal.hpp @@ -202,7 +202,6 @@ struct areal_areal // get and analyse turns typedef typename turns::get_turns::turn_info turn_type; - typedef typename std::vector::iterator turn_iterator; 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 26750de3b..8d9f74e7f 100644 --- a/include/boost/geometry/algorithms/detail/relate/linear_areal.hpp +++ b/include/boost/geometry/algorithms/detail/relate/linear_areal.hpp @@ -205,7 +205,6 @@ struct linear_areal // get and analyse turns typedef typename turns::get_turns::turn_info turn_type; - typedef typename std::vector::iterator turn_iterator; 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 3476a4178..3db680db2 100644 --- a/include/boost/geometry/algorithms/detail/relate/linear_linear.hpp +++ b/include/boost/geometry/algorithms/detail/relate/linear_linear.hpp @@ -120,7 +120,6 @@ struct linear_linear // get and analyse turns typedef typename turns::get_turns::turn_info turn_type; - typedef typename std::vector::iterator turn_iterator; std::vector turns; interrupt_policy_linear_linear interrupt_policy(result); diff --git a/include/boost/geometry/algorithms/detail/relate/point_point.hpp b/include/boost/geometry/algorithms/detail/relate/point_point.hpp index fcbb1d7ee..f1af67cd6 100644 --- a/include/boost/geometry/algorithms/detail/relate/point_point.hpp +++ b/include/boost/geometry/algorithms/detail/relate/point_point.hpp @@ -56,7 +56,6 @@ std::pair point_multipoint_check(Point const& point, MultiPoint cons // point_in_geometry could be used here but why iterate over MultiPoint twice? // we must search for a point in the exterior because all points in MultiPoint can be equal - typedef typename boost::range_value::type point_type; typedef typename boost::range_iterator::type iterator; iterator it = boost::begin(multi_point); iterator last = boost::end(multi_point); diff --git a/include/boost/geometry/algorithms/detail/relate/turns.hpp b/include/boost/geometry/algorithms/detail/relate/turns.hpp index c373e9f63..b8c292bee 100644 --- a/include/boost/geometry/algorithms/detail/relate/turns.hpp +++ b/include/boost/geometry/algorithms/detail/relate/turns.hpp @@ -70,8 +70,6 @@ struct get_turns Geometry2 const& geometry2, InterruptPolicy & interrupt_policy) { - typedef typename geometry::point_type::type point1_type; - static const bool reverse1 = detail::overlay::do_reverse::value>::value; static const bool reverse2 = detail::overlay::do_reverse::value>::value; @@ -84,7 +82,8 @@ struct get_turns reverse1, reverse2, GetTurnPolicy - >::apply(0, geometry1, 1, geometry2, detail::no_rescale_policy(), turns, interrupt_policy); + >::apply(0, geometry1, 1, geometry2, + detail::no_rescale_policy(), turns, interrupt_policy); } }; diff --git a/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp b/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp index ae6bb72dd..e6b4c2607 100644 --- a/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp +++ b/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp @@ -204,7 +204,6 @@ struct check_duplicate_loop template static inline bool apply(Segment const& seg) { - typedef typename coordinate_type::type coordinate_type; if (! geometry::math::equals ( geometry::get<0, Dimension>(seg), @@ -486,7 +485,7 @@ struct sectionalize_polygon ring_identifier ring_id, std::size_t max_count) { typedef typename point_type::type point_type; - typedef typename ring_type::type ring_type; + //typedef typename ring_type::type ring_type; typedef sectionalize_range < closure::value, Reverse, 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 efdce0be1..3b460e506 100644 --- a/include/boost/geometry/algorithms/detail/within/point_in_geometry.hpp +++ b/include/boost/geometry/algorithms/detail/within/point_in_geometry.hpp @@ -32,6 +32,8 @@ #include #include +#include + namespace boost { namespace geometry { #ifndef DOXYGEN_NO_DETAIL @@ -190,25 +192,15 @@ struct point_in_geometry template static inline int apply(Point const& point, Ring const& ring, Strategy const& strategy) { - static const iterate_direction direction = order_as_direction::value>::value; - static const closure_selector closure = geometry::closure::value; - - if (boost::size(ring) - < core_detail::closure::minimum_ring_size::value) + if ( boost::size(ring) < core_detail::closure::minimum_ring_size + < + geometry::closure::value + >::value ) { return -1; } - typedef typename reversible_view::type rev_view_type; - typedef typename closeable_view - < - rev_view_type const, closure - >::type cl_view_type; - typedef typename boost::range_iterator::type iterator_type; - - rev_view_type rev_view(ring); - cl_view_type view(rev_view); - + detail::normalized_view view(ring); return detail::within::point_in_range(point, view, strategy); } }; diff --git a/include/boost/geometry/algorithms/intersects.hpp b/include/boost/geometry/algorithms/intersects.hpp index 8aa45d56c..12cf78173 100644 --- a/include/boost/geometry/algorithms/intersects.hpp +++ b/include/boost/geometry/algorithms/intersects.hpp @@ -61,25 +61,16 @@ inline bool intersects(Geometry const& geometry) typedef detail::overlay::get_turn_info < detail::overlay::assign_null_policy - > TurnPolicy; - - typedef typename strategy_intersection - < - typename cs_tag::type, - Geometry, - Geometry, - point_type, - rescale_policy_type - >::segment_intersection_strategy_type segment_intersection_strategy_type; + > turn_policy; rescale_policy_type robust_policy - = geometry::get_rescale_policy(geometry); + = geometry::get_rescale_policy(geometry); detail::disjoint::disjoint_interrupt_policy policy; detail::self_get_turn_points::get_turns - < - TurnPolicy - >::apply(geometry, robust_policy, turns, policy); + < + turn_policy + >::apply(geometry, robust_policy, turns, policy); return policy.has_intersections; } diff --git a/include/boost/geometry/algorithms/remove_spikes.hpp b/include/boost/geometry/algorithms/remove_spikes.hpp index 62845135f..8e1671824 100644 --- a/include/boost/geometry/algorithms/remove_spikes.hpp +++ b/include/boost/geometry/algorithms/remove_spikes.hpp @@ -75,8 +75,6 @@ struct range_remove_spikes return; } - typedef typename boost::range_iterator::type iterator; - std::deque cleaned; for (typename boost::range_iterator::type it = boost::begin(range); it != boost::end(range); ++it) diff --git a/include/boost/geometry/algorithms/reverse.hpp b/include/boost/geometry/algorithms/reverse.hpp index 215cb5b59..d1f927692 100644 --- a/include/boost/geometry/algorithms/reverse.hpp +++ b/include/boost/geometry/algorithms/reverse.hpp @@ -50,13 +50,12 @@ struct polygon_reverse: private range_reverse template static inline void apply(Polygon& polygon) { - typedef typename geometry::ring_type::type ring_type; - range_reverse::apply(exterior_ring(polygon)); - typename interior_return_type::type rings - = interior_rings(polygon); - for (BOOST_AUTO_TPL(it, boost::begin(rings)); it != boost::end(rings); ++it) + typename interior_return_type::type + rings = interior_rings(polygon); + for (BOOST_AUTO_TPL(it, boost::begin(rings)); + it != boost::end(rings); ++it) { range_reverse::apply(*it); } diff --git a/include/boost/geometry/algorithms/simplify.hpp b/include/boost/geometry/algorithms/simplify.hpp index 6dae3c98c..846874cc7 100644 --- a/include/boost/geometry/algorithms/simplify.hpp +++ b/include/boost/geometry/algorithms/simplify.hpp @@ -449,8 +449,6 @@ inline void simplify(Geometry const& geometry, Geometry& out, { concept::check(); - typedef typename point_type::type point_type; - simplify(geometry, out, max_distance, default_strategy()); } diff --git a/include/boost/geometry/algorithms/touches.hpp b/include/boost/geometry/algorithms/touches.hpp index 5ffc3eb34..a06071d42 100644 --- a/include/boost/geometry/algorithms/touches.hpp +++ b/include/boost/geometry/algorithms/touches.hpp @@ -248,11 +248,6 @@ struct areal_areal typename segment_ratio_type::type > turn_info; - typedef detail::overlay::get_turn_info - < - detail::overlay::assign_null_policy - > policy_type; - std::deque turns; detail::touches::areal_interrupt_policy policy; rescale_policy_type robust_policy; diff --git a/include/boost/geometry/algorithms/transform.hpp b/include/boost/geometry/algorithms/transform.hpp index 11c417e61..7dc917f93 100644 --- a/include/boost/geometry/algorithms/transform.hpp +++ b/include/boost/geometry/algorithms/transform.hpp @@ -153,8 +153,6 @@ struct transform_polygon static inline bool apply(Polygon1 const& poly1, Polygon2& poly2, Strategy const& strategy) { - typedef typename ring_type::type ring1_type; - typedef typename ring_type::type ring2_type; typedef typename point_type::type point2_type; geometry::clear(poly2); diff --git a/include/boost/geometry/extensions/algorithms/connect.hpp b/include/boost/geometry/extensions/algorithms/connect.hpp index 292a503e5..f4cc12b29 100644 --- a/include/boost/geometry/extensions/algorithms/connect.hpp +++ b/include/boost/geometry/extensions/algorithms/connect.hpp @@ -60,7 +60,7 @@ struct map_policy { typedef typename strategy::distance::services::default_strategy < - point_tag, Point + point_tag, point_tag, Point >::type strategy_type; // Have a map > such that we can find @@ -181,7 +181,7 @@ struct fuzzy_policy { typedef typename strategy::distance::services::default_strategy < - point_tag, Point + point_tag, point_tag, Point >::type strategy_type; // Have a map > such that we can find diff --git a/include/boost/geometry/extensions/algorithms/selected.hpp b/include/boost/geometry/extensions/algorithms/selected.hpp index 805f8d7fb..8890d6ab0 100644 --- a/include/boost/geometry/extensions/algorithms/selected.hpp +++ b/include/boost/geometry/extensions/algorithms/selected.hpp @@ -145,7 +145,7 @@ struct close_to_segment // Call corresponding strategy typedef typename strategy::distance::services::default_strategy < - segment_tag, P, PS + point_tag, segment_tag, P, PS >::type strategy_type; typedef typename strategy::distance::services::return_type::type return_type; diff --git a/include/boost/geometry/extensions/gis/geographic/strategies/andoyer.hpp b/include/boost/geometry/extensions/gis/geographic/strategies/andoyer.hpp index b4c016c90..d3a9aff71 100644 --- a/include/boost/geometry/extensions/gis/geographic/strategies/andoyer.hpp +++ b/include/boost/geometry/extensions/gis/geographic/strategies/andoyer.hpp @@ -198,7 +198,7 @@ struct result_from_distance, P1, P2> template -struct default_strategy +struct default_strategy { typedef strategy::distance::andoyer::type> type; }; diff --git a/include/boost/geometry/extensions/gis/geographic/strategies/distance_cross_track.hpp b/include/boost/geometry/extensions/gis/geographic/strategies/distance_cross_track.hpp index da1a27256..4e00c4b74 100644 --- a/include/boost/geometry/extensions/gis/geographic/strategies/distance_cross_track.hpp +++ b/include/boost/geometry/extensions/gis/geographic/strategies/distance_cross_track.hpp @@ -31,7 +31,7 @@ namespace services template -struct default_strategy +struct default_strategy { typedef cross_track < @@ -41,7 +41,7 @@ struct default_strategy, typename default_strategy < - point_tag, Point, PointOfSegment, + point_tag, point_tag, Point, PointOfSegment, geographic_tag, geographic_tag >::type, Strategy diff --git a/include/boost/geometry/extensions/nsphere/algorithms/within.hpp b/include/boost/geometry/extensions/nsphere/algorithms/within.hpp index d28ea42ae..19005d354 100644 --- a/include/boost/geometry/extensions/nsphere/algorithms/within.hpp +++ b/include/boost/geometry/extensions/nsphere/algorithms/within.hpp @@ -53,7 +53,7 @@ inline bool point_in_circle(P const& p, C const& c) typedef typename point_type::type point_type; typedef typename services::default_strategy < - point_tag, P, point_type + point_tag, point_tag, P, point_type >::type strategy_type; typedef typename services::return_type::type return_type; diff --git a/include/boost/geometry/index/detail/rtree/linear/redistribute_elements.hpp b/include/boost/geometry/index/detail/rtree/linear/redistribute_elements.hpp index 9842864e3..1f649bbdf 100644 --- a/include/boost/geometry/index/detail/rtree/linear/redistribute_elements.hpp +++ b/include/boost/geometry/index/detail/rtree/linear/redistribute_elements.hpp @@ -329,7 +329,6 @@ struct redistribute_elements::type elements_type; typedef typename elements_type::value_type element_type; typedef typename rtree::element_indexable_type::type indexable_type; - typedef typename coordinate_type::type coordinate_type; typedef typename index::detail::default_content_result::type content_type; elements_type & elements1 = rtree::elements(n); diff --git a/include/boost/geometry/index/detail/rtree/quadratic/redistribute_elements.hpp b/include/boost/geometry/index/detail/rtree/quadratic/redistribute_elements.hpp index 2cf4cf051..90d080c54 100644 --- a/include/boost/geometry/index/detail/rtree/quadratic/redistribute_elements.hpp +++ b/include/boost/geometry/index/detail/rtree/quadratic/redistribute_elements.hpp @@ -108,7 +108,6 @@ struct redistribute_elements::type elements_type; typedef typename elements_type::value_type element_type; typedef typename rtree::element_indexable_type::type indexable_type; - typedef typename coordinate_type::type coordinate_type; elements_type & elements1 = rtree::elements(n); elements_type & elements2 = rtree::elements(second_node); diff --git a/include/boost/geometry/index/detail/varray.hpp b/include/boost/geometry/index/detail/varray.hpp index f736a9db9..a795b7c3f 100644 --- a/include/boost/geometry/index/detail/varray.hpp +++ b/include/boost/geometry/index/detail/varray.hpp @@ -1946,7 +1946,6 @@ public: void insert(iterator, Iterator first, Iterator last) { // TODO - add MPL_ASSERT, check if Iterator is really an iterator - typedef typename boost::iterator_traversal::type traversal; errh::check_capacity(*this, std::distance(first, last)); // may throw } @@ -1970,7 +1969,6 @@ public: void assign(Iterator first, Iterator last) { // TODO - add MPL_ASSERT, check if Iterator is really an iterator - typedef typename boost::iterator_traversal::type traversal; errh::check_capacity(*this, std::distance(first, last)); // may throw } diff --git a/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp b/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp index 25179ba21..5bcad4fee 100644 --- a/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp +++ b/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp @@ -251,6 +251,20 @@ struct default_strategy > type; }; +template +struct default_strategy + < + segment_tag, point_tag, PointOfSegment, Point, + cartesian_tag, cartesian_tag, Strategy + > +{ + typedef typename default_strategy + < + point_tag, segment_tag, Point, PointOfSegment, + cartesian_tag, cartesian_tag, Strategy + >::type type; +}; + } // namespace services #endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS 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 9761d3b0d..95cd48027 100644 --- a/include/boost/geometry/strategies/cartesian/distance_pythagoras_point_box.hpp +++ b/include/boost/geometry/strategies/cartesian/distance_pythagoras_point_box.hpp @@ -322,6 +322,18 @@ struct default_strategy typedef pythagoras_point_box<> type; }; +template +struct default_strategy + < + box_tag, point_tag, BoxPoint, Point, cartesian_tag, cartesian_tag + > +{ + typedef typename default_strategy + < + point_tag, box_tag, Point, BoxPoint, cartesian_tag, cartesian_tag + >::type type; +}; + } // namespace services #endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS diff --git a/include/boost/geometry/strategies/spherical/distance_cross_track.hpp b/include/boost/geometry/strategies/spherical/distance_cross_track.hpp index 87fac4811..6ffa4ff7c 100644 --- a/include/boost/geometry/strategies/spherical/distance_cross_track.hpp +++ b/include/boost/geometry/strategies/spherical/distance_cross_track.hpp @@ -306,6 +306,22 @@ struct default_strategy }; +template +struct default_strategy + < + segment_tag, point_tag, PointOfSegment, Point, + spherical_equatorial_tag, spherical_equatorial_tag, + Strategy + > +{ + typedef typename default_strategy + < + point_tag, segment_tag, Point, PointOfSegment, + spherical_equatorial_tag, spherical_equatorial_tag, + Strategy + >::type type; +}; + } // namespace services #endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS diff --git a/test/strategies/cross_track.cpp b/test/strategies/cross_track.cpp index fe665ea1b..2fe639e30 100644 --- a/test/strategies/cross_track.cpp +++ b/test/strategies/cross_track.cpp @@ -68,6 +68,11 @@ void test_distance( < bg::point_tag, bg::segment_tag, Point, Point >::type cross_track_strategy_type; + + typedef typename bg::strategy::distance::services::default_strategy + < + bg::segment_tag, bg::point_tag, Point, Point + >::type reversed_tags_cross_track_strategy_type; } diff --git a/test/strategies/projected_point.cpp b/test/strategies/projected_point.cpp index 62c611495..64e30f934 100644 --- a/test/strategies/projected_point.cpp +++ b/test/strategies/projected_point.cpp @@ -62,6 +62,11 @@ void test_services() < bg::point_tag, bg::segment_tag, P, PS >::type projected_point_strategy_type; + + typedef typename services::default_strategy + < + bg::segment_tag, bg::point_tag, PS, P + >::type reversed_tags_projected_point_strategy_type; } // 1: normal, calculate distance: