geographic.hpp 1.9 KB

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