File indexing completed on 2025-01-18 09:36:46
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_KARNEY_HPP
0012 #define BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_KARNEY_HPP
0013
0014
0015 #include <boost/geometry/strategies/geographic/distance.hpp>
0016 #include <boost/geometry/strategies/geographic/parameters.hpp>
0017
0018
0019 namespace boost { namespace geometry
0020 {
0021
0022 namespace strategy { namespace distance
0023 {
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 template
0036 <
0037 typename Spheroid = srs::spheroid<double>,
0038 typename CalculationType = void
0039 >
0040 class karney
0041 : public strategy::distance::geographic
0042 <
0043 strategy::karney, Spheroid, CalculationType
0044 >
0045 {
0046 typedef strategy::distance::geographic
0047 <
0048 strategy::karney, Spheroid, CalculationType
0049 > base_type;
0050
0051 public:
0052 inline karney()
0053 : base_type()
0054 {}
0055
0056 explicit inline karney(Spheroid const& spheroid)
0057 : base_type(spheroid)
0058 {}
0059 };
0060
0061 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
0062 namespace services
0063 {
0064
0065 template <typename Spheroid, typename CalculationType>
0066 struct tag<karney<Spheroid, CalculationType> >
0067 {
0068 typedef strategy_tag_distance_point_point type;
0069 };
0070
0071
0072 template <typename Spheroid, typename CalculationType, typename P1, typename P2>
0073 struct return_type<karney<Spheroid, CalculationType>, P1, P2>
0074 : karney<Spheroid, CalculationType>::template calculation_type<P1, P2>
0075 {};
0076
0077
0078 template <typename Spheroid, typename CalculationType>
0079 struct comparable_type<karney<Spheroid, CalculationType> >
0080 {
0081 typedef karney<Spheroid, CalculationType> type;
0082 };
0083
0084
0085 template <typename Spheroid, typename CalculationType>
0086 struct get_comparable<karney<Spheroid, CalculationType> >
0087 {
0088 static inline karney<Spheroid, CalculationType> apply(karney<Spheroid, CalculationType> const& input)
0089 {
0090 return input;
0091 }
0092 };
0093
0094 template <typename Spheroid, typename CalculationType, typename P1, typename P2>
0095 struct result_from_distance<karney<Spheroid, CalculationType>, P1, P2 >
0096 {
0097 template <typename T>
0098 static inline typename return_type<karney<Spheroid, CalculationType>, P1, P2>::type
0099 apply(karney<Spheroid, CalculationType> const& , T const& value)
0100 {
0101 return value;
0102 }
0103 };
0104
0105
0106 }
0107 #endif
0108
0109
0110 }}
0111
0112
0113 }}
0114
0115
0116 #endif