File indexing completed on 2025-01-18 09:36:44
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_GEOMETRY_STRATEGIES_CLOSEST_POINTS_SPHERICAL_HPP
0011 #define BOOST_GEOMETRY_STRATEGIES_CLOSEST_POINTS_SPHERICAL_HPP
0012
0013 #include <boost/geometry/strategies/spherical/closest_points_pt_seg.hpp>
0014
0015 #include <boost/geometry/strategies/detail.hpp>
0016 #include <boost/geometry/strategies/distance/detail.hpp>
0017 #include <boost/geometry/strategies/closest_points/services.hpp>
0018
0019 #include <boost/geometry/strategies/distance/spherical.hpp>
0020
0021 #include <boost/geometry/util/type_traits.hpp>
0022
0023
0024 namespace boost { namespace geometry
0025 {
0026
0027 namespace strategies { namespace closest_points
0028 {
0029
0030 template
0031 <
0032 typename RadiusTypeOrSphere = double,
0033 typename CalculationType = void
0034 >
0035 class spherical
0036 : public strategies::distance::spherical<RadiusTypeOrSphere, CalculationType>
0037 {
0038 using base_t = strategies::distance::spherical<RadiusTypeOrSphere, CalculationType>;
0039
0040 public:
0041 spherical() = default;
0042
0043 template <typename RadiusOrSphere>
0044 explicit spherical(RadiusOrSphere const& radius_or_sphere)
0045 : base_t(radius_or_sphere)
0046 {}
0047
0048 template <typename Geometry1, typename Geometry2>
0049 auto closest_points(Geometry1 const&, Geometry2 const&,
0050 distance::detail::enable_if_ps_t<Geometry1, Geometry2> * = nullptr) const
0051 {
0052 return strategy::closest_points::cross_track<CalculationType>(base_t::radius());
0053 }
0054 };
0055
0056
0057 namespace services
0058 {
0059
0060 template <typename Geometry1, typename Geometry2>
0061 struct default_strategy
0062 <
0063 Geometry1,
0064 Geometry2,
0065 spherical_equatorial_tag,
0066 spherical_equatorial_tag
0067 >
0068 {
0069 using type = strategies::closest_points::spherical<>;
0070 };
0071
0072 }
0073
0074 }}
0075
0076 }}
0077
0078 #endif