]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/geometry/srs/projections/proj/wag7.hpp
c752ff33ee4fb726b672015c489e1b63e9b3bda1
[ceph.git] / ceph / src / boost / boost / geometry / srs / projections / proj / wag7.hpp
1 #ifndef BOOST_GEOMETRY_PROJECTIONS_WAG7_HPP
2 #define BOOST_GEOMETRY_PROJECTIONS_WAG7_HPP
3
4 // Boost.Geometry - extensions-gis-projections (based on PROJ4)
5 // This file is automatically generated. DO NOT EDIT.
6
7 // Copyright (c) 2008-2015 Barend Gehrels, Amsterdam, the Netherlands.
8
9 // This file was modified by Oracle on 2017.
10 // Modifications copyright (c) 2017, Oracle and/or its affiliates.
11 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle.
12
13 // Use, modification and distribution is subject to the Boost Software License,
14 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
15 // http://www.boost.org/LICENSE_1_0.txt)
16
17 // This file is converted from PROJ4, http://trac.osgeo.org/proj
18 // PROJ4 is originally written by Gerald Evenden (then of the USGS)
19 // PROJ4 is maintained by Frank Warmerdam
20 // PROJ4 is converted to Boost.Geometry by Barend Gehrels
21
22 // Last updated version of proj: 4.9.1
23
24 // Original copyright notice:
25
26 // Permission is hereby granted, free of charge, to any person obtaining a
27 // copy of this software and associated documentation files (the "Software"),
28 // to deal in the Software without restriction, including without limitation
29 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
30 // and/or sell copies of the Software, and to permit persons to whom the
31 // Software is furnished to do so, subject to the following conditions:
32
33 // The above copyright notice and this permission notice shall be included
34 // in all copies or substantial portions of the Software.
35
36 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
37 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
38 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
39 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
40 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
41 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
42 // DEALINGS IN THE SOFTWARE.
43
44 #include <boost/geometry/srs/projections/impl/base_static.hpp>
45 #include <boost/geometry/srs/projections/impl/base_dynamic.hpp>
46 #include <boost/geometry/srs/projections/impl/projects.hpp>
47 #include <boost/geometry/srs/projections/impl/factory_entry.hpp>
48
49 namespace boost { namespace geometry
50 {
51
52 namespace srs { namespace par4
53 {
54 struct wag7 {};
55
56 }} //namespace srs::par4
57
58 namespace projections
59 {
60 #ifndef DOXYGEN_NO_DETAIL
61 namespace detail { namespace wag7
62 {
63
64 // template class, using CRTP to implement forward/inverse
65 template <typename CalculationType, typename Parameters>
66 struct base_wag7_spheroid : public base_t_f<base_wag7_spheroid<CalculationType, Parameters>,
67 CalculationType, Parameters>
68 {
69
70 typedef CalculationType geographic_type;
71 typedef CalculationType cartesian_type;
72
73
74 inline base_wag7_spheroid(const Parameters& par)
75 : base_t_f<base_wag7_spheroid<CalculationType, Parameters>,
76 CalculationType, Parameters>(*this, par) {}
77
78 // FORWARD(s_forward) sphere
79 // Project coordinates from geographic (lon, lat) to cartesian (x, y)
80 inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& xy_y) const
81 {
82 CalculationType theta, ct, D;
83
84 theta = asin(xy_y = 0.90630778703664996 * sin(lp_lat));
85 xy_x = 2.66723 * (ct = cos(theta)) * sin(lp_lon /= 3.);
86 xy_y *= 1.24104 * (D = 1/(sqrt(0.5 * (1 + ct * cos(lp_lon)))));
87 xy_x *= D;
88 }
89
90 static inline std::string get_name()
91 {
92 return "wag7_spheroid";
93 }
94
95 };
96
97 // Wagner VII
98 template <typename Parameters>
99 inline void setup_wag7(Parameters& par)
100 {
101 par.es = 0.;
102 }
103
104 }} // namespace detail::wag7
105 #endif // doxygen
106
107 /*!
108 \brief Wagner VII projection
109 \ingroup projections
110 \tparam Geographic latlong point type
111 \tparam Cartesian xy point type
112 \tparam Parameters parameter type
113 \par Projection characteristics
114 - Miscellaneous
115 - Spheroid
116 - no inverse
117 \par Example
118 \image html ex_wag7.gif
119 */
120 template <typename CalculationType, typename Parameters>
121 struct wag7_spheroid : public detail::wag7::base_wag7_spheroid<CalculationType, Parameters>
122 {
123 inline wag7_spheroid(const Parameters& par) : detail::wag7::base_wag7_spheroid<CalculationType, Parameters>(par)
124 {
125 detail::wag7::setup_wag7(this->m_par);
126 }
127 };
128
129 #ifndef DOXYGEN_NO_DETAIL
130 namespace detail
131 {
132
133 // Static projection
134 BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PROJECTION(srs::par4::wag7, wag7_spheroid, wag7_spheroid)
135
136 // Factory entry(s)
137 template <typename CalculationType, typename Parameters>
138 class wag7_entry : public detail::factory_entry<CalculationType, Parameters>
139 {
140 public :
141 virtual base_v<CalculationType, Parameters>* create_new(const Parameters& par) const
142 {
143 return new base_v_f<wag7_spheroid<CalculationType, Parameters>, CalculationType, Parameters>(par);
144 }
145 };
146
147 template <typename CalculationType, typename Parameters>
148 inline void wag7_init(detail::base_factory<CalculationType, Parameters>& factory)
149 {
150 factory.add_to_factory("wag7", new wag7_entry<CalculationType, Parameters>);
151 }
152
153 } // namespace detail
154 #endif // doxygen
155
156 } // namespace projections
157
158 }} // namespace boost::geometry
159
160 #endif // BOOST_GEOMETRY_PROJECTIONS_WAG7_HPP
161