]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/geometry/srs/projections/proj/gins8.hpp
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / boost / geometry / srs / projections / proj / gins8.hpp
1 #ifndef BOOST_GEOMETRY_PROJECTIONS_GINS8_HPP
2 #define BOOST_GEOMETRY_PROJECTIONS_GINS8_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 gins8 {};
55
56 }} //namespace srs::par4
57
58 namespace projections
59 {
60 #ifndef DOXYGEN_NO_DETAIL
61 namespace detail { namespace gins8
62 {
63
64 static const double Cl = 0.000952426;
65 static const double Cp = 0.162388;
66 //static const double C12 = 0.08333333333333333;
67
68 template <typename T>
69 inline T C12() { return 0.083333333333333333333333333333333333; }
70
71 // template class, using CRTP to implement forward/inverse
72 template <typename CalculationType, typename Parameters>
73 struct base_gins8_spheroid : public base_t_f<base_gins8_spheroid<CalculationType, Parameters>,
74 CalculationType, Parameters>
75 {
76
77 typedef CalculationType geographic_type;
78 typedef CalculationType cartesian_type;
79
80
81 inline base_gins8_spheroid(const Parameters& par)
82 : base_t_f<base_gins8_spheroid<CalculationType, Parameters>,
83 CalculationType, Parameters>(*this, par) {}
84
85 // FORWARD(s_forward) spheroid
86 // Project coordinates from geographic (lon, lat) to cartesian (x, y)
87 inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& xy_y) const
88 {
89 static const CalculationType C12 = gins8::C12<CalculationType>();
90
91 CalculationType t = lp_lat * lp_lat;
92
93 xy_y = lp_lat * (1. + t * C12);
94 xy_x = lp_lon * (1. - Cp * t);
95 t = lp_lon * lp_lon;
96 xy_x *= (0.87 - Cl * t * t);
97 }
98
99 static inline std::string get_name()
100 {
101 return "gins8_spheroid";
102 }
103
104 };
105
106 // Ginsburg VIII (TsNIIGAiK)
107 template <typename Parameters>
108 inline void setup_gins8(Parameters& par)
109 {
110 par.es = 0.;
111 }
112
113 }} // namespace detail::gins8
114 #endif // doxygen
115
116 /*!
117 \brief Ginsburg VIII (TsNIIGAiK) projection
118 \ingroup projections
119 \tparam Geographic latlong point type
120 \tparam Cartesian xy point type
121 \tparam Parameters parameter type
122 \par Projection characteristics
123 - Pseudocylindrical
124 - Spheroid
125 - no inverse
126 \par Example
127 \image html ex_gins8.gif
128 */
129 template <typename CalculationType, typename Parameters>
130 struct gins8_spheroid : public detail::gins8::base_gins8_spheroid<CalculationType, Parameters>
131 {
132 inline gins8_spheroid(const Parameters& par) : detail::gins8::base_gins8_spheroid<CalculationType, Parameters>(par)
133 {
134 detail::gins8::setup_gins8(this->m_par);
135 }
136 };
137
138 #ifndef DOXYGEN_NO_DETAIL
139 namespace detail
140 {
141
142 // Static projection
143 BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PROJECTION(srs::par4::gins8, gins8_spheroid, gins8_spheroid)
144
145 // Factory entry(s)
146 template <typename CalculationType, typename Parameters>
147 class gins8_entry : public detail::factory_entry<CalculationType, Parameters>
148 {
149 public :
150 virtual base_v<CalculationType, Parameters>* create_new(const Parameters& par) const
151 {
152 return new base_v_f<gins8_spheroid<CalculationType, Parameters>, CalculationType, Parameters>(par);
153 }
154 };
155
156 template <typename CalculationType, typename Parameters>
157 inline void gins8_init(detail::base_factory<CalculationType, Parameters>& factory)
158 {
159 factory.add_to_factory("gins8", new gins8_entry<CalculationType, Parameters>);
160 }
161
162 } // namespace detail
163 #endif // doxygen
164
165 } // namespace projections
166
167 }} // namespace boost::geometry
168
169 #endif // BOOST_GEOMETRY_PROJECTIONS_GINS8_HPP
170