geographic.hpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // Boost.Geometry
  2. // Copyright (c) 2020, Oracle and/or its affiliates.
  3. // Contributed and/or modified by Vissarion Fysikopoulos, 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_CONVEX_HULL_GEOGRAPHIC_HPP
  7. #define BOOST_GEOMETRY_STRATEGIES_CONVEX_HULL_GEOGRAPHIC_HPP
  8. #include <boost/geometry/strategies/convex_hull/services.hpp>
  9. #include <boost/geometry/strategies/detail.hpp>
  10. #include <boost/geometry/strategies/geographic/side.hpp>
  11. namespace boost { namespace geometry
  12. {
  13. namespace strategies { namespace convex_hull
  14. {
  15. template
  16. <
  17. typename FormulaPolicy = strategy::andoyer,
  18. typename Spheroid = srs::spheroid<double>,
  19. typename CalculationType = void
  20. >
  21. class geographic : public strategies::detail::geographic_base<Spheroid>
  22. {
  23. using base_t = strategies::detail::geographic_base<Spheroid>;
  24. public:
  25. geographic()
  26. : base_t()
  27. {}
  28. explicit geographic(Spheroid const& spheroid)
  29. : base_t(spheroid)
  30. {}
  31. auto side() const
  32. {
  33. return strategy::side::geographic
  34. <
  35. FormulaPolicy,
  36. Spheroid,
  37. CalculationType
  38. >(base_t::m_spheroid);
  39. }
  40. };
  41. namespace services
  42. {
  43. template <typename Geometry>
  44. struct default_strategy<Geometry, geographic_tag>
  45. {
  46. using type = strategies::convex_hull::geographic<>;
  47. };
  48. } // namespace services
  49. }} // namespace strategies::convex_hull
  50. }} // namespace boost::geometry
  51. #endif // BOOST_GEOMETRY_STRATEGIES_CONVEX_HULL_GEOGRAPHIC_HPP