]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/geometry/strategies/densify/geographic.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / geometry / strategies / densify / geographic.hpp
1 // Boost.Geometry
2
3 // Copyright (c) 2021, Oracle and/or its affiliates.
4
5 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
6
7 // Licensed under the Boost Software License version 1.0.
8 // http://www.boost.org/users/license.html
9
10 #ifndef BOOST_GEOMETRY_STRATEGIES_DENSIFY_GEOGRAPHIC_HPP
11 #define BOOST_GEOMETRY_STRATEGIES_DENSIFY_GEOGRAPHIC_HPP
12
13
14 #include <boost/geometry/strategies/detail.hpp>
15 #include <boost/geometry/strategies/densify/services.hpp>
16
17 #include <boost/geometry/strategies/geographic/densify.hpp>
18
19
20 namespace boost { namespace geometry
21 {
22
23 namespace strategies { namespace densify
24 {
25
26 template
27 <
28 typename FormulaPolicy = strategy::andoyer,
29 typename Spheroid = srs::spheroid<double>,
30 typename CalculationType = void
31 >
32 class geographic
33 : public strategies::detail::geographic_base<Spheroid>
34 {
35 using base_t = strategies::detail::geographic_base<Spheroid>;
36
37 public:
38 geographic() = default;
39
40 explicit geographic(Spheroid const& spheroid)
41 : base_t(spheroid)
42 {}
43
44 template <typename Geometry>
45 auto densify(Geometry const&) const
46 {
47 return strategy::densify::geographic
48 <
49 FormulaPolicy, Spheroid, CalculationType
50 >(base_t::m_spheroid);
51 }
52 };
53
54
55 namespace services
56 {
57
58 template <typename Geometry>
59 struct default_strategy<Geometry, geographic_tag>
60 {
61 using type = strategies::densify::geographic<>;
62 };
63
64
65 template <typename FP, typename S, typename CT>
66 struct strategy_converter<strategy::densify::geographic<FP, S, CT> >
67 {
68 static auto get(strategy::densify::geographic<FP, S, CT> const& s)
69 {
70 return strategies::densify::geographic<FP, S, CT>(s.model());
71 }
72 };
73
74
75 } // namespace services
76
77 }} // namespace strategies::densify
78
79 }} // namespace boost::geometry
80
81 #endif // BOOST_GEOMETRY_STRATEGIES_DENSIFY_GEOGRAPHIC_HPP