File indexing completed on 2025-01-18 09:35:41
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040 #ifndef BOOST_GEOMETRY_PROJECTIONS_ECK3_HPP
0041 #define BOOST_GEOMETRY_PROJECTIONS_ECK3_HPP
0042
0043 #include <boost/core/ignore_unused.hpp>
0044
0045 #include <boost/geometry/srs/projections/impl/base_static.hpp>
0046 #include <boost/geometry/srs/projections/impl/base_dynamic.hpp>
0047 #include <boost/geometry/srs/projections/impl/projects.hpp>
0048 #include <boost/geometry/srs/projections/impl/factory_entry.hpp>
0049 #include <boost/geometry/srs/projections/impl/aasincos.hpp>
0050
0051 namespace boost { namespace geometry
0052 {
0053
0054 namespace projections
0055 {
0056 #ifndef DOXYGEN_NO_DETAIL
0057 namespace detail { namespace eck3
0058 {
0059
0060 template <typename T>
0061 struct par_eck3
0062 {
0063 T C_x, C_y, A, B;
0064 };
0065
0066 template <typename T, typename Parameters>
0067 struct base_eck3_spheroid
0068 {
0069 par_eck3<T> m_proj_parm;
0070
0071
0072
0073 inline void fwd(Parameters const& , T const& lp_lon, T const& lp_lat, T& xy_x, T& xy_y) const
0074 {
0075 xy_y = this->m_proj_parm.C_y * lp_lat;
0076 xy_x = this->m_proj_parm.C_x * lp_lon * (this->m_proj_parm.A + asqrt(1. - this->m_proj_parm.B * lp_lat * lp_lat));
0077 }
0078
0079
0080
0081 inline void inv(Parameters const& , T const& xy_x, T const& xy_y, T& lp_lon, T& lp_lat) const
0082 {
0083 T denominator;
0084 lp_lat = xy_y / this->m_proj_parm.C_y;
0085 denominator = (this->m_proj_parm.C_x * (this->m_proj_parm.A + asqrt(1. - this->m_proj_parm.B * lp_lat * lp_lat)));
0086 if ( denominator == 0.0) {
0087 lp_lon = HUGE_VAL;
0088 lp_lat = HUGE_VAL;
0089 } else
0090 lp_lon = xy_x / denominator;
0091 }
0092
0093 static inline std::string get_name()
0094 {
0095 return "eck3_spheroid";
0096 }
0097
0098 };
0099
0100 template <typename Parameters>
0101 inline void setup(Parameters& par)
0102 {
0103 par.es = 0.;
0104 }
0105
0106
0107
0108 template <typename Parameters, typename T>
0109 inline void setup_eck3(Parameters& par, par_eck3<T>& proj_parm)
0110 {
0111 proj_parm.C_x = 0.42223820031577120149;
0112 proj_parm.C_y = 0.84447640063154240298;
0113 proj_parm.A = 1.0;
0114 proj_parm.B = 0.4052847345693510857755;
0115
0116 setup(par);
0117 }
0118
0119
0120 template <typename Parameters, typename T>
0121 inline void setup_putp1(Parameters& par, par_eck3<T>& proj_parm)
0122 {
0123 proj_parm.C_x = 1.89490;
0124 proj_parm.C_y = 0.94745;
0125 proj_parm.A = -0.5;
0126 proj_parm.B = 0.30396355092701331433;
0127
0128 setup(par);
0129 }
0130
0131
0132 template <typename Parameters, typename T>
0133 inline void setup_wag6(Parameters& par, par_eck3<T>& proj_parm)
0134 {
0135 proj_parm.C_x = proj_parm.C_y = 0.94745;
0136 proj_parm.A = 0.0;
0137 proj_parm.B = 0.30396355092701331433;
0138
0139 setup(par);
0140 }
0141
0142
0143 template <typename Parameters, typename T>
0144 inline void setup_kav7(Parameters& par, par_eck3<T>& proj_parm)
0145 {
0146
0147
0148
0149 proj_parm.C_x = 0.8660254037844;
0150 proj_parm.C_y = 1.0;
0151 proj_parm.A = 0.0;
0152 proj_parm.B = 0.30396355092701331433;
0153
0154 setup(par);
0155 }
0156
0157 }}
0158 #endif
0159
0160
0161
0162
0163
0164
0165
0166
0167
0168
0169
0170
0171
0172 template <typename T, typename Parameters>
0173 struct eck3_spheroid : public detail::eck3::base_eck3_spheroid<T, Parameters>
0174 {
0175 template <typename Params>
0176 inline eck3_spheroid(Params const& , Parameters & par)
0177 {
0178 detail::eck3::setup_eck3(par, this->m_proj_parm);
0179 }
0180 };
0181
0182
0183
0184
0185
0186
0187
0188
0189
0190
0191
0192
0193
0194 template <typename T, typename Parameters>
0195 struct putp1_spheroid : public detail::eck3::base_eck3_spheroid<T, Parameters>
0196 {
0197 template <typename Params>
0198 inline putp1_spheroid(Params const& , Parameters & par)
0199 {
0200 detail::eck3::setup_putp1(par, this->m_proj_parm);
0201 }
0202 };
0203
0204
0205
0206
0207
0208
0209
0210
0211
0212
0213
0214
0215
0216 template <typename T, typename Parameters>
0217 struct wag6_spheroid : public detail::eck3::base_eck3_spheroid<T, Parameters>
0218 {
0219 template <typename Params>
0220 inline wag6_spheroid(Params const& , Parameters & par)
0221 {
0222 detail::eck3::setup_wag6(par, this->m_proj_parm);
0223 }
0224 };
0225
0226
0227
0228
0229
0230
0231
0232
0233
0234
0235
0236
0237
0238 template <typename T, typename Parameters>
0239 struct kav7_spheroid : public detail::eck3::base_eck3_spheroid<T, Parameters>
0240 {
0241 template <typename Params>
0242 inline kav7_spheroid(Params const& , Parameters & par)
0243 {
0244 detail::eck3::setup_kav7(par, this->m_proj_parm);
0245 }
0246 };
0247
0248 #ifndef DOXYGEN_NO_DETAIL
0249 namespace detail
0250 {
0251
0252
0253 BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PROJECTION_FI(srs::spar::proj_eck3, eck3_spheroid)
0254 BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PROJECTION_FI(srs::spar::proj_putp1, putp1_spheroid)
0255 BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PROJECTION_FI(srs::spar::proj_wag6, wag6_spheroid)
0256 BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PROJECTION_FI(srs::spar::proj_kav7, kav7_spheroid)
0257
0258
0259 BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_ENTRY_FI(eck3_entry, eck3_spheroid)
0260 BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_ENTRY_FI(putp1_entry, putp1_spheroid)
0261 BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_ENTRY_FI(wag6_entry, wag6_spheroid)
0262 BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_ENTRY_FI(kav7_entry, kav7_spheroid)
0263
0264 BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_INIT_BEGIN(eck3_init)
0265 {
0266 BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_INIT_ENTRY(eck3, eck3_entry);
0267 BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_INIT_ENTRY(putp1, putp1_entry);
0268 BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_INIT_ENTRY(wag6, wag6_entry);
0269 BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_INIT_ENTRY(kav7, kav7_entry);
0270 }
0271
0272 }
0273 #endif
0274
0275 }
0276
0277 }}
0278
0279 #endif
0280