3 // Copyright (c) 2020-2021, Oracle and/or its affiliates.
5 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
7 // Licensed under the Boost Software License version 1.0.
8 // http://www.boost.org/users/license.html
10 #ifndef BOOST_GEOMETRY_STRATEGIES_EXPAND_GEOGRAPHIC_HPP
11 #define BOOST_GEOMETRY_STRATEGIES_EXPAND_GEOGRAPHIC_HPP
14 #include <type_traits>
16 #include <boost/geometry/strategy/geographic/expand_segment.hpp>
18 #include <boost/geometry/strategies/detail.hpp>
19 #include <boost/geometry/strategies/expand/spherical.hpp>
22 namespace boost { namespace geometry
25 namespace strategies { namespace expand
30 typename FormulaPolicy = strategy::andoyer,
31 typename Spheroid = srs::spheroid<double>,
32 typename CalculationType = void
35 : public strategies::detail::geographic_base<Spheroid>
37 using base_t = strategies::detail::geographic_base<Spheroid>;
40 geographic() = default;
42 explicit geographic(Spheroid const& spheroid)
46 template <typename Box, typename Geometry>
47 static auto expand(Box const&, Geometry const&,
48 typename util::enable_if_point_t<Geometry> * = nullptr)
50 return strategy::expand::spherical_point();
53 template <typename Box, typename Geometry>
54 static auto expand(Box const&, Geometry const&,
55 typename util::enable_if_box_t<Geometry> * = nullptr)
57 return strategy::expand::spherical_box();
60 template <typename Box, typename Geometry>
61 auto expand(Box const&, Geometry const&,
62 typename util::enable_if_segment_t<Geometry> * = nullptr) const
64 return strategy::expand::geographic_segment
66 FormulaPolicy, Spheroid, CalculationType
67 >(base_t::m_spheroid);
75 template <typename Box, typename Geometry>
76 struct default_strategy<Box, Geometry, geographic_tag>
78 using type = strategies::expand::geographic<>;
82 template <typename FP, typename S, typename CT>
83 struct strategy_converter<strategy::expand::geographic_segment<FP, S, CT> >
85 static auto get(strategy::expand::geographic_segment<FP, S, CT> const& s)
87 return strategies::expand::geographic<FP, S, CT>(s.model());
92 } // namespace services
94 }} // namespace strategies::envelope
96 }} // namespace boost::geometry
98 #endif // BOOST_GEOMETRY_STRATEGIES_EXPAND_GEOGRAPHIC_HPP