File indexing completed on 2025-01-18 09:36:45
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_GEOMETRY_STRATEGIES_EXPAND_GEOGRAPHIC_HPP
0011 #define BOOST_GEOMETRY_STRATEGIES_EXPAND_GEOGRAPHIC_HPP
0012
0013
0014 #include <type_traits>
0015
0016 #include <boost/geometry/strategy/geographic/expand_segment.hpp>
0017
0018 #include <boost/geometry/strategies/detail.hpp>
0019 #include <boost/geometry/strategies/expand/spherical.hpp>
0020
0021
0022 namespace boost { namespace geometry
0023 {
0024
0025 namespace strategies { namespace expand
0026 {
0027
0028 template
0029 <
0030 typename FormulaPolicy = strategy::andoyer,
0031 typename Spheroid = srs::spheroid<double>,
0032 typename CalculationType = void
0033 >
0034 class geographic
0035 : public strategies::detail::geographic_base<Spheroid>
0036 {
0037 using base_t = strategies::detail::geographic_base<Spheroid>;
0038
0039 public:
0040 geographic() = default;
0041
0042 explicit geographic(Spheroid const& spheroid)
0043 : base_t(spheroid)
0044 {}
0045
0046 template <typename Box, typename Geometry>
0047 static auto expand(Box const&, Geometry const&,
0048 typename util::enable_if_point_t<Geometry> * = nullptr)
0049 {
0050 return strategy::expand::spherical_point();
0051 }
0052
0053 template <typename Box, typename Geometry>
0054 static auto expand(Box const&, Geometry const&,
0055 typename util::enable_if_box_t<Geometry> * = nullptr)
0056 {
0057 return strategy::expand::spherical_box();
0058 }
0059
0060 template <typename Box, typename Geometry>
0061 auto expand(Box const&, Geometry const&,
0062 typename util::enable_if_segment_t<Geometry> * = nullptr) const
0063 {
0064 return strategy::expand::geographic_segment
0065 <
0066 FormulaPolicy, Spheroid, CalculationType
0067 >(base_t::m_spheroid);
0068 }
0069 };
0070
0071
0072 namespace services
0073 {
0074
0075 template <typename Box, typename Geometry>
0076 struct default_strategy<Box, Geometry, geographic_tag>
0077 {
0078 using type = strategies::expand::geographic<>;
0079 };
0080
0081
0082 template <typename FP, typename S, typename CT>
0083 struct strategy_converter<strategy::expand::geographic_segment<FP, S, CT> >
0084 {
0085 static auto get(strategy::expand::geographic_segment<FP, S, CT> const& s)
0086 {
0087 return strategies::expand::geographic<FP, S, CT>(s.model());
0088 }
0089 };
0090
0091
0092 }
0093
0094 }}
0095
0096 }}
0097
0098 #endif