123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- #ifndef BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_KARNEY_HPP
- #define BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_KARNEY_HPP
- #include <boost/geometry/strategies/geographic/distance.hpp>
- #include <boost/geometry/strategies/geographic/parameters.hpp>
- namespace boost { namespace geometry
- {
- namespace strategy { namespace distance
- {
- template
- <
- typename Spheroid = srs::spheroid<double>,
- typename CalculationType = void
- >
- class karney
- : public strategy::distance::geographic
- <
- strategy::karney, Spheroid, CalculationType
- >
- {
- typedef strategy::distance::geographic
- <
- strategy::karney, Spheroid, CalculationType
- > base_type;
- public:
- inline karney()
- : base_type()
- {}
- explicit inline karney(Spheroid const& spheroid)
- : base_type(spheroid)
- {}
- };
- #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
- namespace services
- {
- template <typename Spheroid, typename CalculationType>
- struct tag<karney<Spheroid, CalculationType> >
- {
- typedef strategy_tag_distance_point_point type;
- };
- template <typename Spheroid, typename CalculationType, typename P1, typename P2>
- struct return_type<karney<Spheroid, CalculationType>, P1, P2>
- : karney<Spheroid, CalculationType>::template calculation_type<P1, P2>
- {};
- template <typename Spheroid, typename CalculationType>
- struct comparable_type<karney<Spheroid, CalculationType> >
- {
- typedef karney<Spheroid, CalculationType> type;
- };
- template <typename Spheroid, typename CalculationType>
- struct get_comparable<karney<Spheroid, CalculationType> >
- {
- static inline karney<Spheroid, CalculationType> apply(karney<Spheroid, CalculationType> const& input)
- {
- return input;
- }
- };
- template <typename Spheroid, typename CalculationType, typename P1, typename P2>
- struct result_from_distance<karney<Spheroid, CalculationType>, P1, P2 >
- {
- template <typename T>
- static inline typename return_type<karney<Spheroid, CalculationType>, P1, P2>::type
- apply(karney<Spheroid, CalculationType> const& , T const& value)
- {
- return value;
- }
- };
- }
- #endif
- }}
- }}
- #endif
|