Merge branch 'develop' of github.com:boostorg/geometry into develop

This commit is contained in:
Barend Gehrels
2015-04-28 19:18:38 +02:00
15 changed files with 255 additions and 96 deletions

View File

@@ -35,6 +35,7 @@
[*Solved tickets]
* [@https://svn.boost.org/trac/boost/ticket/11113 11113] Support easy enumeration of all elements with BOOST_FOREACH
* [@https://svn.boost.org/trac/boost/ticket/11236 11236] Invalid result of centroid() for integer coordinate type
[/=================]
[heading Boost 1.58]

View File

@@ -3,11 +3,13 @@
# Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
# Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
# Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
# Copyright (c) 2015 Adam Wulkiewicz, Lodz, Poland.
#
# Use, modification and distribution is subject to the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
build-project io ;
build-project latlong ;
build-project projections ;

View File

@@ -22,6 +22,7 @@
#include <boost/geometry/core/coordinate_type.hpp>
#include <boost/geometry/geometries/concepts/point_concept.hpp>
#include <boost/geometry/util/for_each_coordinate.hpp>
#include <boost/geometry/util/select_most_precise.hpp>
namespace boost { namespace geometry
@@ -32,80 +33,94 @@ namespace detail
{
template <typename P>
template <typename Point>
struct param
{
typedef typename boost::call_traits
<
typename coordinate_type<P>::type
typename coordinate_type<Point>::type
>::param_type type;
};
template <typename C, template <typename> class Function>
template <typename Value, template <typename> class Function>
struct value_operation
{
C m_value;
Value m_value;
inline value_operation(C const &value)
inline value_operation(Value const &value)
: m_value(value)
{}
template <typename P, int I>
inline void apply(P& point) const
template <typename PointDst, std::size_t Index>
inline void apply(PointDst& point_dst) const
{
set<I>(point, Function<C>()(get<I>(point), m_value));
set<Index>(point_dst,
Function
<
typename geometry::select_most_precise
<
Value,
typename geometry::coordinate_type<PointDst>::type
>::type
>()(get<Index>(point_dst), m_value));
}
};
template <typename PointSrc, template <typename> class Function>
struct point_operation
{
typedef typename coordinate_type<PointSrc>::type coordinate_type;
PointSrc const& m_source_point;
PointSrc const& m_point_src;
inline point_operation(PointSrc const& point)
: m_source_point(point)
: m_point_src(point)
{}
template <typename PointDst, int I>
inline void apply(PointDst& dest_point) const
template <typename PointDst, std::size_t Index>
inline void apply(PointDst& point_dst) const
{
set<I>(dest_point,
Function<coordinate_type>()(get<I>(dest_point), get<I>(m_source_point)));
set<Index>(point_dst,
Function
<
typename geometry::select_most_precise
<
typename geometry::coordinate_type<PointSrc>::type,
typename geometry::coordinate_type<PointDst>::type
>::type
>()(get<Index>(point_dst), get<Index>(m_point_src)));
}
};
template <typename C>
template <typename Value>
struct value_assignment
{
C m_value;
Value m_value;
inline value_assignment(C const &value)
inline value_assignment(Value const &value)
: m_value(value)
{}
template <typename P, int I>
inline void apply(P& point) const
template <typename PointDst, std::size_t Index>
inline void apply(PointDst& point_dst) const
{
set<I>(point, m_value);
set<Index>(point_dst, m_value);
}
};
template <typename PointSrc>
struct point_assignment
{
PointSrc const& m_source_point;
PointSrc const& m_point_src;
inline point_assignment(PointSrc const& point)
: m_source_point(point)
: m_point_src(point)
{}
template <typename PointDst, int I>
inline void apply(PointDst& dest_point) const
template <typename PointDst, std::size_t Index>
inline void apply(PointDst& point_dst) const
{
set<I>(dest_point, get<I>(m_source_point));
set<Index>(point_dst, get<Index>(m_point_src));
}
};
@@ -126,7 +141,12 @@ inline void add_value(Point& p, typename detail::param<Point>::type value)
{
BOOST_CONCEPT_ASSERT( (concept::Point<Point>) );
for_each_coordinate(p, detail::value_operation<typename coordinate_type<Point>::type, std::plus>(value));
for_each_coordinate(p,
detail::value_operation
<
typename coordinate_type<Point>::type,
std::plus
>(value));
}
/*!
@@ -161,7 +181,12 @@ inline void subtract_value(Point& p, typename detail::param<Point>::type value)
{
BOOST_CONCEPT_ASSERT( (concept::Point<Point>) );
for_each_coordinate(p, detail::value_operation<typename coordinate_type<Point>::type, std::minus>(value));
for_each_coordinate(p,
detail::value_operation
<
typename coordinate_type<Point>::type,
std::minus
>(value));
}
/*!
@@ -196,7 +221,12 @@ inline void multiply_value(Point& p, typename detail::param<Point>::type value)
{
BOOST_CONCEPT_ASSERT( (concept::Point<Point>) );
for_each_coordinate(p, detail::value_operation<typename coordinate_type<Point>::type, std::multiplies>(value));
for_each_coordinate(p,
detail::value_operation
<
typename coordinate_type<Point>::type,
std::multiplies
>(value));
}
/*!
@@ -232,7 +262,12 @@ inline void divide_value(Point& p, typename detail::param<Point>::type value)
{
BOOST_CONCEPT_ASSERT( (concept::Point<Point>) );
for_each_coordinate(p, detail::value_operation<typename coordinate_type<Point>::type, std::divides>(value));
for_each_coordinate(p,
detail::value_operation
<
typename coordinate_type<Point>::type,
std::divides
>(value));
}
/*!
@@ -267,7 +302,11 @@ inline void assign_value(Point& p, typename detail::param<Point>::type value)
{
BOOST_CONCEPT_ASSERT( (concept::Point<Point>) );
for_each_coordinate(p, detail::value_assignment<typename coordinate_type<Point>::type>(value));
for_each_coordinate(p,
detail::value_assignment
<
typename coordinate_type<Point>::type
>(value));
}
/*!

View File

@@ -184,6 +184,18 @@ namespace detail
// 1) lexical cast -> stack overflow and
// 2) because it is implemented as a function, generic implementation not possible
// Partial specialization for ttmath
template <ttmath::uint Exponent, ttmath::uint Mantissa>
struct define_half_pi<ttmath::Big<Exponent, Mantissa> >
{
static inline ttmath::Big<Exponent, Mantissa> apply()
{
static ttmath::Big<Exponent, Mantissa> const half_pi(
"1.57079632679489661923132169163975144209858469968755291048747229615390820314310449931401741267105853399107404325664115332354692230477529111586267970406424055872514205135096926055277982231147447746519098");
return half_pi;
}
};
// Partial specialization for ttmath
template <ttmath::uint Exponent, ttmath::uint Mantissa>
struct define_pi<ttmath::Big<Exponent, Mantissa> >
@@ -196,11 +208,33 @@ namespace detail
}
};
// Partial specialization for ttmath
template <ttmath::uint Exponent, ttmath::uint Mantissa>
struct define_two_pi<ttmath::Big<Exponent, Mantissa> >
{
static inline ttmath::Big<Exponent, Mantissa> apply()
{
static ttmath::Big<Exponent, Mantissa> const two_pi(
"6.28318530717958647692528676655900576839433879875021164194988918461563281257241799725606965068423413596429617302656461329418768921910116446345071881625696223490056820540387704221111928924589790986076392");
return two_pi;
}
};
template <>
struct define_half_pi<ttmath_big>
: public define_half_pi<ttmath::Big<1,4> >
{};
template <>
struct define_pi<ttmath_big>
: public define_pi<ttmath::Big<1,4> >
{};
template <>
struct define_two_pi<ttmath_big>
: public define_two_pi<ttmath::Big<1,4> >
{};
template <ttmath::uint Exponent, ttmath::uint Mantissa>
struct equals_with_epsilon<ttmath::Big<Exponent, Mantissa>, false>
{

View File

@@ -107,9 +107,12 @@ struct ewkt_policy
{
};
template <typename Geometry,
geometry_type_ogc::enum_t OgcType,
std::size_t Dim = dimension<Geometry>::value>
template
<
typename Geometry,
geometry_type_ogc::enum_t OgcType,
std::size_t Dim = dimension<Geometry>::value
>
struct geometry_type_impl
{
static bool check(boost::uint32_t value)
@@ -123,8 +126,11 @@ struct geometry_type_impl
}
};
template <typename Geometry,
geometry_type_ogc::enum_t OgcType>
template
<
typename Geometry,
geometry_type_ogc::enum_t OgcType
>
struct geometry_type_impl<Geometry, OgcType, 3>
{
static bool check(boost::uint32_t value)

View File

@@ -17,7 +17,6 @@
#include <boost/assert.hpp>
#include <boost/concept_check.hpp>
#include <boost/core/ignore_unused.hpp>
#include <boost/cstdint.hpp>
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/is_same.hpp>
@@ -152,11 +151,10 @@ template <typename P, std::size_t N>
struct parsing_assigner<P, N, N>
{
template <typename Iterator>
static void run(Iterator& it, Iterator end, P& point,
byte_order_type::enum_t order)
static void run(Iterator& /*it*/, Iterator /*end*/, P& /*point*/,
byte_order_type::enum_t /*order*/)
{
// terminate
boost::ignore_unused(it, end, point, order);
}
};

View File

@@ -16,7 +16,6 @@
#include <limits>
#include <boost/concept_check.hpp>
#include <boost/core/ignore_unused.hpp>
#include <boost/cstdint.hpp>
#include <boost/range.hpp>
#include <boost/static_assert.hpp>
@@ -67,13 +66,16 @@ namespace detail { namespace wkb
}
};
template <typename P,
std::size_t I = 0,
std::size_t N = dimension<P>::value>
template
<
typename Point,
std::size_t I = 0,
std::size_t N = dimension<Point>::value
>
struct writer_assigner
{
template <typename OutputIterator>
static void run(P const& point,
static void run(Point const& point,
OutputIterator& iter,
byte_order_type::enum_t byte_order)
{
@@ -83,28 +85,27 @@ namespace detail { namespace wkb
iter,
byte_order);
writer_assigner<P, I+1, N>::run(point, iter, byte_order);
writer_assigner<Point, I+1, N>::run(point, iter, byte_order);
}
};
template <typename P, std::size_t N>
struct writer_assigner<P, N, N>
template <typename Point, std::size_t N>
struct writer_assigner<Point, N, N>
{
template <typename OutputIterator>
static void run(P const& point,
OutputIterator& iter,
byte_order_type::enum_t byte_order)
static void run(Point const& /*point*/,
OutputIterator& /*iter*/,
byte_order_type::enum_t /*byte_order*/)
{
// terminate
boost::ignore_unused(point, iter, byte_order);
}
};
template <typename P>
template <typename Point>
struct point_writer
{
template <typename OutputIterator>
static bool write(P const& point,
static bool write(Point const& point,
OutputIterator& iter,
byte_order_type::enum_t byte_order)
{
@@ -112,21 +113,21 @@ namespace detail { namespace wkb
value_writer<uint8_t>::write(byte_order, iter, byte_order);
// write geometry type
uint32_t type = geometry_type<P>::get();
uint32_t type = geometry_type<Point>::get();
value_writer<uint32_t>::write(type, iter, byte_order);
// write point's x, y, z
writer_assigner<P>::run(point, iter, byte_order);
writer_assigner<Point>::run(point, iter, byte_order);
return true;
}
};
template <typename L>
template <typename Linestring>
struct linestring_writer
{
template <typename OutputIterator>
static bool write(L const& linestring,
static bool write(Linestring const& linestring,
OutputIterator& iter,
byte_order_type::enum_t byte_order)
{
@@ -134,20 +135,20 @@ namespace detail { namespace wkb
value_writer<uint8_t>::write(byte_order, iter, byte_order);
// write geometry type
uint32_t type = geometry_type<L>::get();
uint32_t type = geometry_type<Linestring>::get();
value_writer<uint32_t>::write(type, iter, byte_order);
// write num points
uint32_t num_points = boost::size(linestring);
value_writer<uint32_t>::write(num_points, iter, byte_order);
for(typename boost::range_iterator<L const>::type
for(typename boost::range_iterator<Linestring const>::type
point_iter = boost::begin(linestring);
point_iter != boost::end(linestring);
++point_iter)
{
// write point's x, y, z
writer_assigner<typename point_type<L>::type>
writer_assigner<typename point_type<Linestring>::type>
::run(*point_iter, iter, byte_order);
}
@@ -155,11 +156,11 @@ namespace detail { namespace wkb
}
};
template <typename P>
template <typename Polygon>
struct polygon_writer
{
template <typename OutputIterator>
static bool write(P const& polygon,
static bool write(Polygon const& polygon,
OutputIterator& iter,
byte_order_type::enum_t byte_order)
{
@@ -167,7 +168,7 @@ namespace detail { namespace wkb
value_writer<uint8_t>::write(byte_order, iter, byte_order);
// write geometry type
uint32_t type = geometry_type<P>::get();
uint32_t type = geometry_type<Polygon>::get();
value_writer<uint32_t>::write(type, iter, byte_order);
// write num rings
@@ -175,10 +176,10 @@ namespace detail { namespace wkb
value_writer<uint32_t>::write(num_rings, iter, byte_order);
// write exterior ring
typedef typename geometry::ring_type<P const>::type
typedef typename geometry::ring_type<Polygon const>::type
ring_type;
typename geometry::ring_return_type<P const>::type
typename geometry::ring_return_type<Polygon const>::type
exterior_ring = geometry::exterior_ring(polygon);
value_writer<uint32_t>::write(geometry::num_points(exterior_ring),
@@ -191,15 +192,15 @@ namespace detail { namespace wkb
++point_iter)
{
// write point's x, y, z
writer_assigner<typename point_type<P>::type>
writer_assigner<typename point_type<Polygon>::type>
::run(*point_iter, iter, byte_order);
}
// write interor rings
typedef typename geometry::interior_type<P const>::type
typedef typename geometry::interior_type<Polygon const>::type
interior_rings_type;
typename geometry::interior_return_type<P const>::type
typename geometry::interior_return_type<Polygon const>::type
interior_rings = geometry::interior_rings(polygon);
for(typename boost::range_iterator<interior_rings_type const>::type
@@ -217,7 +218,7 @@ namespace detail { namespace wkb
++point_iter)
{
// write point's x, y, z
writer_assigner<typename point_type<P>::type>
writer_assigner<typename point_type<Polygon>::type>
::run(*point_iter, iter, byte_order);
}
}

View File

@@ -1,9 +1,14 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
// Copyright (c) 2014-2015 Adam Wulkiewicz, Lodz, Poland.
// This file was modified by Oracle on 2015.
// Modifications copyright (c) 2015, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, 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.
@@ -28,7 +33,7 @@
#include <boost/geometry/algorithms/detail/interior_iterator.hpp>
#include <boost/geometry/algorithms/assign.hpp>
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/algorithms/disjoint.hpp>
#include <boost/geometry/algorithms/detail/disjoint/point_point.hpp>
#include <boost/geometry/algorithms/not_implemented.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
#include <boost/geometry/core/interior_rings.hpp>
@@ -150,7 +155,7 @@ struct wkt_range
// optionally, close range to ring by repeating the first point
if (force_closed
&& boost::size(range) > 1
&& geometry::disjoint(*begin, *(end - 1)))
&& detail::disjoint::disjoint_point_point(*begin, *(end - 1)))
{
os << ",";
stream_type::apply(os, *begin);

View File

@@ -1,6 +1,11 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2012-2014 Barend Gehrels, Amsterdam, the Netherlands.
// 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.
// Contributed and/or modified by Menelaos Karavelas, 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
@@ -62,8 +67,7 @@ private :
DistanceType const& buffer_distance,
RangeOut& range_out) const
{
PromotedType const two = 2.0;
PromotedType const two_pi = two * geometry::math::pi<PromotedType>();
PromotedType const two_pi = geometry::math::two_pi<PromotedType>();
std::size_t point_buffer_count = m_points_per_circle;

View File

@@ -2,6 +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.
// Contributed and/or modified by Menelaos Karavelas, 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)
@@ -76,8 +81,7 @@ private :
PromotedType const dx2 = get<0>(perp2) - get<0>(vertex);
PromotedType const dy2 = get<1>(perp2) - get<1>(vertex);
PromotedType const two = 2.0;
PromotedType const two_pi = two * geometry::math::pi<PromotedType>();
PromotedType const two_pi = geometry::math::two_pi<PromotedType>();
PromotedType const angle1 = atan2(dy1, dx1);
PromotedType angle2 = atan2(dy2, dx2);

View File

@@ -85,8 +85,7 @@ public :
promoted_type const buffer_distance = distance_strategy.apply(point, point,
strategy::buffer::buffer_side_left);
promoted_type const two = 2.0;
promoted_type const two_pi = two * geometry::math::pi<promoted_type>();
promoted_type const two_pi = geometry::math::two_pi<promoted_type>();
promoted_type const diff = two_pi / promoted_type(m_count);
promoted_type a = 0;

View File

@@ -1,6 +1,11 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2015.
// Modifications copyright (c) 2015, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, 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
@@ -39,10 +44,9 @@ crossing polygons and for polygons with holes. However, some cases (especially
180 meridian cases) must still be checked.
\note The version which sums angles, which is often seen, doesn't handle non-convex
polygons correctly.
\note The version which sums longitudes, see
http://trs-new.jpl.nasa.gov/dspace/bitstream/2014/40409/1/07-03.pdf, is simple
and works well in most cases but not in 180 meridian crossing cases. This probably
could be solved.
\note The version which sums longitudes, see http://hdl.handle.net/2014/40409,
is simple and works well in most cases but not in 180 meridian crossing cases.
This probably could be solved.
\note This version is made for spherical equatorial coordinate systems
@@ -113,8 +117,10 @@ public :
calculation_type const half = 0.5;
calculation_type const two = 2.0;
calculation_type const four = 4.0;
calculation_type const two_pi = two * geometry::math::pi<calculation_type>();
calculation_type const half_pi = half * geometry::math::pi<calculation_type>();
calculation_type const two_pi
= geometry::math::two_pi<calculation_type>();
calculation_type const half_pi
= geometry::math::half_pi<calculation_type>();
// Distance p1 p2
calculation_type a = state.distance_over_unit_sphere.apply(p1, p2);

View File

@@ -354,7 +354,8 @@ struct modulo<Fundamental, true>
/*!
\brief Short construct to enable partial specialization for PI, currently not possible in Math.
\brief Short constructs to enable partial specialization for PI, 2*PI
and PI/2, currently not possible in Math.
*/
template <typename T>
struct define_pi
@@ -366,6 +367,26 @@ struct define_pi
}
};
template <typename T>
struct define_two_pi
{
static inline T apply()
{
// Default calls Boost.Math
return boost::math::constants::two_pi<T>();
}
};
template <typename T>
struct define_half_pi
{
static inline T apply()
{
// Default calls Boost.Math
return boost::math::constants::half_pi<T>();
}
};
template <typename T>
struct relaxed_epsilon
{
@@ -407,6 +428,12 @@ struct round<Result, Source, true, false>
template <typename T>
inline T pi() { return detail::define_pi<T>::apply(); }
template <typename T>
inline T two_pi() { return detail::define_two_pi<T>::apply(); }
template <typename T>
inline T half_pi() { return detail::define_half_pi<T>::apply(); }
template <typename T>
inline T relaxed_epsilon(T const& factor)
{

View File

@@ -56,6 +56,15 @@ void test_polygon()
// should (1.5 1) be returned?
// if yes, then all other Polygons degenerated to Linestrings should be handled
test_centroid<Polygon>("POLYGON((1 1,2 1,1 1,1 1))", 1.0, 1.0);
// reported 2015.04.24
// input INT, result FP
test_centroid
<
bg::model::polygon<bg::model::d2::point_xy<int> >,
typename bg::point_type<Polygon>::type,
typename bg::coordinate_type<Polygon>::type
>("POLYGON((1 1, 1 2, 2 2, 2 1, 1 1))", 1.5, 1.5);
}
@@ -97,6 +106,23 @@ void test_2d()
test_centroid<bg::model::box<P> >("POLYGON((1 2,3 4))", 2, 3);
test_centroid<P>("POINT(3 3)", 3, 3);
// INT -> FP
test_centroid
<
bg::model::ring<bg::model::d2::point_xy<int> >,
P, typename bg::coordinate_type<P>::type
>("POLYGON((1 1, 1 2, 2 2, 2 1, 1 1))", 1.5, 1.5);
test_centroid
<
bg::model::linestring<bg::model::d2::point_xy<int> >,
P, typename bg::coordinate_type<P>::type
>("LINESTRING(1 1, 2 2)", 1.5, 1.5);
test_centroid
<
bg::model::box<bg::model::d2::point_xy<int> >,
P, typename bg::coordinate_type<P>::type
>("BOX(1 1, 2 2)", 1.5, 1.5);
}

View File

@@ -30,6 +30,7 @@ struct check_result
static void apply(Point1 const& actual, Point2 const& expected)
{
check_result<D-1>::apply(actual, expected);
BOOST_CHECK_CLOSE(bg::get<D-1>(actual), bg::get<D-1>(expected), 0.001);
}
};
@@ -48,9 +49,9 @@ void test_with_other_calculation_type(Geometry const& geometry, Point& c1)
{
typedef typename bg::point_type<Geometry>::type point_type;
// Calculate it with user defined strategy
point_type c2;
Point c2;
bg::centroid(geometry, c2,
bg::strategy::centroid::bashein_detmer<point_type, point_type, CalculationType>());
bg::strategy::centroid::bashein_detmer<Point, point_type, CalculationType>());
std::cout << typeid(CalculationType).name() << ": " << std::setprecision(20)
<< bg::get<0>(c2) << " " << bg::get<1>(c2)
@@ -58,13 +59,13 @@ void test_with_other_calculation_type(Geometry const& geometry, Point& c1)
<< std::endl;
}
template <typename Geometry, typename T>
template <typename Geometry, typename Point, typename T>
void test_centroid(std::string const& wkt, T const& d1, T const& d2, T const& d3 = T(), T const& d4 = T(), T const& d5 = T())
{
Geometry geometry;
bg::read_wkt(wkt, geometry);
typedef typename bg::point_type<Geometry>::type point_type;
point_type c1;
Point c1;
bg::centroid(geometry, c1);
check_result<bg::dimension<Geometry>::type::value>::apply(c1, boost::make_tuple(d1, d2, d3, d4, d5));
@@ -85,6 +86,12 @@ void test_centroid(std::string const& wkt, T const& d1, T const& d2, T const& d3
#endif
}
template <typename Geometry, typename T>
void test_centroid(std::string const& wkt, T const& d1, T const& d2, T const& d3 = T(), T const& d4 = T(), T const& d5 = T())
{
test_centroid<Geometry, typename bg::point_type<Geometry>::type>(wkt, d1, d2, d3, d4, d5);
}
template <typename Geometry>
void test_centroid_exception()
{