1 // Boost.Geometry 2 3 // Copyright (c) 2021, Oracle and/or its affiliates. 4 5 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle 6 7 // Licensed under the Boost Software License version 1.0. 8 // http://www.boost.org/users/license.html 9 10 #ifndef BOOST_GEOMETRY_STRATEGIES_AZIMUTH_GEOGRAPHIC_HPP 11 #define BOOST_GEOMETRY_STRATEGIES_AZIMUTH_GEOGRAPHIC_HPP 12 13 14 // TODO: move this file to boost/geometry/strategy 15 #include <boost/geometry/strategies/geographic/azimuth.hpp> 16 17 #include <boost/geometry/strategies/azimuth/services.hpp> 18 #include <boost/geometry/strategies/detail.hpp> 19 20 21 namespace boost { namespace geometry 22 { 23 24 namespace strategies { namespace azimuth 25 { 26 27 template 28 < 29 typename FormulaPolicy = strategy::andoyer, 30 typename Spheroid = srs::spheroid<double>, 31 typename CalculationType = void 32 > 33 class geographic : strategies::detail::geographic_base<Spheroid> 34 { 35 using base_t = strategies::detail::geographic_base<Spheroid>; 36 37 public: geographic()38 geographic() 39 : base_t() 40 {} 41 geographic(Spheroid const & spheroid)42 explicit geographic(Spheroid const& spheroid) 43 : base_t(spheroid) 44 {} 45 azimuth() const46 auto azimuth() const 47 { 48 return strategy::azimuth::geographic 49 < 50 FormulaPolicy, Spheroid, CalculationType 51 >(base_t::m_spheroid); 52 } 53 }; 54 55 56 namespace services 57 { 58 59 template <typename Point1, typename Point2> 60 struct default_strategy<Point1, Point2, geographic_tag, geographic_tag> 61 { 62 using type = strategies::azimuth::geographic<>; 63 }; 64 65 66 template <typename FP, typename S, typename CT> 67 struct strategy_converter<strategy::azimuth::geographic<FP, S, CT> > 68 { getboost::geometry::strategies::azimuth::services::strategy_converter69 static auto get(strategy::azimuth::geographic<FP, S, CT> const& strategy) 70 { 71 return strategies::azimuth::geographic<FP, S, CT>(strategy.model()); 72 } 73 }; 74 75 } // namespace services 76 77 }} // namespace strategies::azimuth 78 79 }} // namespace boost::geometry 80 81 #endif // BOOST_GEOMETRY_STRATEGIES_AZIMUTH_GEOGRAPHIC_HPP 82