]>
Commit | Line | Data |
---|---|---|
20effc67 TL |
1 | // Boost.Geometry |
2 | ||
3 | // Copyright (c) 2020, 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_AREA_GEOGRAPHIC_HPP | |
11 | #define BOOST_GEOMETRY_STRATEGIES_AREA_GEOGRAPHIC_HPP | |
12 | ||
13 | ||
14 | #include <boost/geometry/strategy/geographic/area.hpp> | |
15 | ||
16 | #include <boost/geometry/strategies/area/services.hpp> | |
17 | #include <boost/geometry/strategies/detail.hpp> | |
18 | ||
19 | ||
20 | namespace boost { namespace geometry | |
21 | { | |
22 | ||
23 | namespace strategies { namespace area | |
24 | { | |
25 | ||
26 | template | |
27 | < | |
28 | typename FormulaPolicy = strategy::andoyer, | |
29 | std::size_t SeriesOrder = strategy::default_order<FormulaPolicy>::value, | |
30 | typename Spheroid = srs::spheroid<double>, | |
31 | typename CalculationType = void | |
32 | > | |
33 | class geographic : strategies::detail::geographic_base<Spheroid> | |
34 | { | |
35 | using base_t = strategies::detail::geographic_base<Spheroid>; | |
36 | ||
37 | public: | |
38 | geographic() | |
39 | : base_t() | |
40 | {} | |
41 | ||
42 | explicit geographic(Spheroid const& spheroid) | |
43 | : base_t(spheroid) | |
44 | {} | |
45 | ||
46 | template <typename Geometry> | |
47 | auto area(Geometry const&) const | |
48 | { | |
49 | return strategy::area::geographic | |
50 | < | |
51 | FormulaPolicy, SeriesOrder, Spheroid, CalculationType | |
52 | >(base_t::m_spheroid); | |
53 | } | |
54 | }; | |
55 | ||
56 | ||
57 | namespace services | |
58 | { | |
59 | ||
60 | template <typename Geometry> | |
61 | struct default_strategy<Geometry, geographic_tag> | |
62 | { | |
63 | using type = strategies::area::geographic<>; | |
64 | }; | |
65 | ||
66 | ||
67 | template <typename FP, std::size_t SO, typename S, typename CT> | |
68 | struct strategy_converter<strategy::area::geographic<FP, SO, S, CT> > | |
69 | { | |
70 | static auto get(strategy::area::geographic<FP, SO, S, CT> const& strategy) | |
71 | { | |
72 | return strategies::area::geographic<FP, SO, S, CT>(strategy.model()); | |
73 | } | |
74 | }; | |
75 | ||
76 | } // namespace services | |
77 | ||
78 | }} // namespace strategies::area | |
79 | ||
80 | }} // namespace boost::geometry | |
81 | ||
82 | #endif // BOOST_GEOMETRY_STRATEGIES_AREA_GEOGRAPHIC_HPP |