diff options
Diffstat (limited to 'boost/geometry/strategies/geographic/distance.hpp')
-rw-r--r-- | boost/geometry/strategies/geographic/distance.hpp | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/boost/geometry/strategies/geographic/distance.hpp b/boost/geometry/strategies/geographic/distance.hpp index 98ee46a369..01f766c10e 100644 --- a/boost/geometry/strategies/geographic/distance.hpp +++ b/boost/geometry/strategies/geographic/distance.hpp @@ -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 @@ -20,12 +20,13 @@ #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; |