]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/boost/geometry/strategies/io/geographic.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / geometry / strategies / io / geographic.hpp
CommitLineData
1e59de90
TL
1// Boost.Geometry
2
3// Copyright (c) 2019-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_IO_GEOGRAPHIC_HPP
11#define BOOST_GEOMETRY_STRATEGIES_IO_GEOGRAPHIC_HPP
12
13
14#include <boost/geometry/strategies/detail.hpp>
15#include <boost/geometry/strategies/io/services.hpp>
16
17#include <boost/geometry/strategies/geographic/point_order.hpp>
18#include <boost/geometry/strategies/geographic/point_in_poly_winding.hpp>
19#include <boost/geometry/strategies/spherical/point_in_point.hpp>
20
21
22namespace boost { namespace geometry
23{
24
25namespace strategies { namespace io
26{
27
28template
29 <
30 typename FormulaPolicy = strategy::andoyer,
31 typename Spheroid = srs::spheroid<double>,
32 typename CalculationType = void
33 >
34class geographic
35 : public strategies::detail::geographic_base<Spheroid>
36{
37 using base_t = strategies::detail::geographic_base<Spheroid>;
38
39public:
40 geographic() = default;
41
42 explicit geographic(Spheroid const& spheroid)
43 : base_t(spheroid)
44 {}
45
46 auto point_order() const
47 {
48 return strategy::point_order::geographic
49 <
50 FormulaPolicy, Spheroid, CalculationType
51 >(base_t::m_spheroid);
52 }
53
54 template <typename Geometry1, typename Geometry2>
55 static auto relate(Geometry1 const&, Geometry2 const&,
56 std::enable_if_t
57 <
58 util::is_pointlike<Geometry1>::value
59 && util::is_pointlike<Geometry2>::value
60 > * = nullptr)
61 {
62 return strategy::within::spherical_point_point();
63 }
64
65 template <typename Geometry1, typename Geometry2>
66 auto relate(Geometry1 const&, Geometry2 const&,
67 std::enable_if_t
68 <
69 util::is_pointlike<Geometry1>::value
70 && ( util::is_linear<Geometry2>::value
71 || util::is_polygonal<Geometry2>::value )
72 > * = nullptr) const
73 {
74 return strategy::within::geographic_winding
75 <
76 void, void,
77 FormulaPolicy, Spheroid, CalculationType
78 >(base_t::m_spheroid);
79 }
80};
81
82namespace services
83{
84
85template <typename Geometry>
86struct default_strategy<Geometry, geographic_tag>
87{
88 typedef geographic<> type;
89};
90
91} // namespace services
92
93}} // namespace strategies::io
94
95}} // namespace boost::geometry
96
97#endif // BOOST_GEOMETRY_STRATEGIES_IO_GEOGRAPHIC_HPP