]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/geometry/strategies/geographic/distance.hpp
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / boost / geometry / strategies / geographic / distance.hpp
index 98ee46a3695ff8fbf9c2b30c3920628f0f0a49de..01f766c10efb8ee0d646a18b10bc0c2e5ab666bc 100644 (file)
@@ -2,8 +2,8 @@
 
 // Copyright (c) 2007-2016 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-2018.
+// Modifications copyright (c) 2014-2018 Oracle and/or its affiliates.
 
 // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
 #include <boost/geometry/core/coordinate_type.hpp>
 #include <boost/geometry/core/radian_access.hpp>
 #include <boost/geometry/core/radius.hpp>
-#include <boost/geometry/core/srs.hpp>
 
 #include <boost/geometry/formulas/andoyer_inverse.hpp>
 #include <boost/geometry/formulas/elliptic_arc_length.hpp>
 #include <boost/geometry/formulas/flattening.hpp>
 
+#include <boost/geometry/srs/spheroid.hpp>
+
 #include <boost/geometry/strategies/distance.hpp>
 #include <boost/geometry/strategies/geographic/parameters.hpp>
 
@@ -34,6 +35,7 @@
 #include <boost/geometry/util/promote_floating_point.hpp>
 #include <boost/geometry/util/select_calculation_type.hpp>
 
+#include <boost/geometry/geometries/point_xy.hpp>
 
 namespace boost { namespace geometry
 {
@@ -41,6 +43,19 @@ namespace boost { namespace geometry
 namespace strategy { namespace distance
 {
 
+/*!
+\brief Distance calculation for geographic coordinates on a spheroid
+\ingroup strategies
+\tparam FormulaPolicy Formula used to calculate azimuths
+\tparam Spheroid The spheroid model
+\tparam CalculationType \tparam_calculation
+
+\qbk{
+[heading See also]
+\* [link geometry.reference.algorithms.distance.distance_3_with_strategy distance (with strategy)]
+\* [link geometry.reference.srs.srs_spheroid srs::spheroid]
+}
+*/
 template
 <
     typename FormulaPolicy = strategy::andoyer,
@@ -110,6 +125,19 @@ public :
         return apply(lon1, lat1, lon2, lat2, m_spheroid);
     }
 
+    // points on a meridian not crossing poles
+    template <typename CT>
+    inline CT meridian(CT lat1, CT lat2) const
+    {
+        typedef typename formula::elliptic_arc_length
+                <
+                CT, strategy::default_order<FormulaPolicy>::value
+                > elliptic_arc_length;
+
+        return elliptic_arc_length::meridian_not_crossing_pole_dist(lat1, lat2,
+                                                                    m_spheroid);
+    }
+
     inline Spheroid const& model() const
     {
         return m_spheroid;