summaryrefslogtreecommitdiff
path: root/boost/geometry/strategies/geographic/distance_vincenty.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/geometry/strategies/geographic/distance_vincenty.hpp')
-rw-r--r--boost/geometry/strategies/geographic/distance_vincenty.hpp67
1 files changed, 16 insertions, 51 deletions
diff --git a/boost/geometry/strategies/geographic/distance_vincenty.hpp b/boost/geometry/strategies/geographic/distance_vincenty.hpp
index e79e9aeb46..41146db9ff 100644
--- a/boost/geometry/strategies/geographic/distance_vincenty.hpp
+++ b/boost/geometry/strategies/geographic/distance_vincenty.hpp
@@ -2,8 +2,8 @@
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
-// This file was modified by Oracle on 2014, 2016.
-// Modifications copyright (c) 2014-2016 Oracle and/or its affiliates.
+// This file was modified by Oracle on 2014-2017.
+// Modifications copyright (c) 2014-2017 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@@ -15,15 +15,9 @@
#define BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_VINCENTY_HPP
-#include <boost/geometry/core/coordinate_type.hpp>
-#include <boost/geometry/core/radian_access.hpp>
+#include <boost/geometry/strategies/geographic/distance.hpp>
+#include <boost/geometry/strategies/geographic/parameters.hpp>
-#include <boost/geometry/strategies/distance.hpp>
-
-#include <boost/geometry/util/promote_floating_point.hpp>
-#include <boost/geometry/util/select_calculation_type.hpp>
-
-#include <boost/geometry/formulas/vincenty_inverse.hpp>
namespace boost { namespace geometry
{
@@ -47,57 +41,28 @@ namespace strategy { namespace distance
*/
template
<
- typename Spheroid,
+ typename Spheroid = srs::spheroid<double>,
typename CalculationType = void
>
class vincenty
+ : public strategy::distance::geographic
+ <
+ strategy::vincenty, Spheroid, CalculationType
+ >
{
-public :
- template <typename Point1, typename Point2>
- struct calculation_type
- : promote_floating_point
- <
- typename select_calculation_type
- <
- Point1,
- Point2,
- CalculationType
- >::type
- >
- {};
-
- typedef Spheroid model_type;
+ typedef strategy::distance::geographic
+ <
+ strategy::vincenty, Spheroid, CalculationType
+ > base_type;
+public:
inline vincenty()
- : m_spheroid()
+ : base_type()
{}
explicit inline vincenty(Spheroid const& spheroid)
- : m_spheroid(spheroid)
+ : base_type(spheroid)
{}
-
- template <typename Point1, typename Point2>
- inline typename calculation_type<Point1, Point2>::type
- apply(Point1 const& point1, Point2 const& point2) const
- {
- return geometry::formula::vincenty_inverse
- <
- typename calculation_type<Point1, Point2>::type,
- true, false
- >::apply(get_as_radian<0>(point1),
- get_as_radian<1>(point1),
- get_as_radian<0>(point2),
- get_as_radian<1>(point2),
- m_spheroid).distance;
- }
-
- inline Spheroid const& model() const
- {
- return m_spheroid;
- }
-
-private :
- Spheroid m_spheroid;
};
#ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS