File indexing completed on 2025-01-18 09:36:44
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_GEOMETRY_STRATEGIES_CONVEX_HULL_GEOGRAPHIC_HPP
0012 #define BOOST_GEOMETRY_STRATEGIES_CONVEX_HULL_GEOGRAPHIC_HPP
0013
0014
0015 #include <boost/geometry/strategies/convex_hull/services.hpp>
0016 #include <boost/geometry/strategies/compare.hpp>
0017 #include <boost/geometry/strategies/detail.hpp>
0018 #include <boost/geometry/strategies/geographic/side.hpp>
0019 #include <boost/geometry/strategies/spherical/point_in_point.hpp>
0020
0021 #include <boost/geometry/util/type_traits.hpp>
0022
0023
0024 namespace boost { namespace geometry
0025 {
0026
0027 namespace strategies { namespace convex_hull
0028 {
0029
0030 template
0031 <
0032 typename FormulaPolicy = strategy::andoyer,
0033 typename Spheroid = srs::spheroid<double>,
0034 typename CalculationType = void
0035 >
0036 class geographic : public strategies::detail::geographic_base<Spheroid>
0037 {
0038 using base_t = strategies::detail::geographic_base<Spheroid>;
0039
0040 public:
0041 geographic() = default;
0042
0043 explicit geographic(Spheroid const& spheroid)
0044 : base_t(spheroid)
0045 {}
0046
0047 template <typename Geometry1, typename Geometry2>
0048 static auto relate(Geometry1 const&, Geometry2 const&,
0049 std::enable_if_t
0050 <
0051 util::is_pointlike<Geometry1>::value
0052 && util::is_pointlike<Geometry2>::value
0053 > * = nullptr)
0054 {
0055 return strategy::within::spherical_point_point();
0056 }
0057
0058 auto side() const
0059 {
0060 return strategy::side::geographic
0061 <
0062 FormulaPolicy,
0063 Spheroid,
0064 CalculationType
0065 >(base_t::m_spheroid);
0066 }
0067
0068 template <typename ComparePolicy, typename EqualsPolicy>
0069 using compare_type = typename strategy::compare::spherical
0070 <
0071 ComparePolicy,
0072 EqualsPolicy,
0073 -1
0074 >;
0075 };
0076
0077 namespace services
0078 {
0079
0080 template <typename Geometry>
0081 struct default_strategy<Geometry, geographic_tag>
0082 {
0083 using type = strategies::convex_hull::geographic<>;
0084 };
0085
0086 }
0087
0088 }}
0089
0090 }}
0091
0092 #endif