/usr/include/boost/geometry/strategies/geographic
Edit: /usr/include/boost/geometry/strategies/geographic/distance_vincenty.hpp (3547B)
// Boost.Geometry
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// 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
// 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)
#ifndef BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_VINCENTY_HPP
#define BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_VINCENTY_HPP
#include
#include
namespace boost { namespace geometry
{
namespace strategy { namespace distance
{
/*!
\brief Distance calculation formulae on latlong coordinates, after Vincenty, 1975
\ingroup distance
\tparam Spheroid The reference spheroid model
\tparam CalculationType \tparam_calculation
\author See
- http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf
- http://www.icsm.gov.au/gda/gdav2.3.pdf
\author Adapted from various implementations to get it close to the original document
- http://www.movable-type.co.uk/scripts/LatLongVincenty.html
- http://exogen.case.edu/projects/geopy/source/geopy.distance.html
- http://futureboy.homeip.net/fsp/colorize.fsp?fileName=navigation.frink
*/
template
<
typename Spheroid = srs::spheroid,
typename CalculationType = void
>
class vincenty
: public strategy::distance::geographic
<
strategy::vincenty, Spheroid, CalculationType
>
{
typedef strategy::distance::geographic
<
strategy::vincenty, Spheroid, CalculationType
> base_type;
public:
inline vincenty()
: base_type()
{}
explicit inline vincenty(Spheroid const& spheroid)
: base_type(spheroid)
{}
};
#ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
namespace services
{
template
struct tag >
{
typedef strategy_tag_distance_point_point type;
};
template
struct return_type, P1, P2>
: vincenty::template calculation_type
{};
template
struct comparable_type >
{
typedef vincenty type;
};
template
struct get_comparable >
{
static inline vincenty apply(vincenty const& input)
{
return input;
}
};
template
struct result_from_distance, P1, P2 >
{
template
static inline typename return_type, P1, P2>::type
apply(vincenty const& , T const& value)
{
return value;
}
};
} // namespace services
#endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
// We might add a vincenty-like strategy also for point-segment distance, but to calculate the projected point is not trivial
}} // namespace strategy::distance
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_VINCENTY_HPP