File indexing completed on 2025-01-18 09:35:42
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
0041
0042
0043
0044
0045
0046
0047
0048
0049 #ifndef BOOST_GEOMETRY_PROJECTIONS_HEALPIX_HPP
0050 #define BOOST_GEOMETRY_PROJECTIONS_HEALPIX_HPP
0051
0052 #include <boost/geometry/srs/projections/impl/base_static.hpp>
0053 #include <boost/geometry/srs/projections/impl/base_dynamic.hpp>
0054 #include <boost/geometry/srs/projections/impl/factory_entry.hpp>
0055 #include <boost/geometry/srs/projections/impl/pj_auth.hpp>
0056 #include <boost/geometry/srs/projections/impl/pj_param.hpp>
0057 #include <boost/geometry/srs/projections/impl/pj_qsfn.hpp>
0058 #include <boost/geometry/srs/projections/impl/projects.hpp>
0059
0060 #include <boost/geometry/util/math.hpp>
0061
0062 namespace boost { namespace geometry
0063 {
0064
0065 namespace projections
0066 {
0067 #ifndef DOXYGEN_NO_DETAIL
0068 namespace detail { namespace healpix
0069 {
0070
0071
0072 static const double epsilon = 1e-15;
0073
0074 template <typename T>
0075 struct par_healpix
0076 {
0077 T qp;
0078 detail::apa<T> apa;
0079 int north_square;
0080 int south_square;
0081 };
0082
0083 template <typename T>
0084 struct cap_map
0085 {
0086 T x, y;
0087 int cn;
0088 enum region_type {north, south, equatorial} region;
0089 };
0090 template <typename T>
0091 struct point_xy
0092 {
0093 T x, y;
0094 };
0095
0096
0097 static double rot[7][2][2] = {
0098
0099 {{1, 0},{0, 1}},
0100
0101 {{ 0,-1},{ 1, 0}},
0102
0103 {{-1, 0},{ 0,-1}},
0104
0105 {{ 0, 1},{-1, 0}},
0106 {{ 0, 1},{-1, 0}},
0107 {{-1, 0},{ 0,-1}},
0108 {{ 0,-1},{ 1, 0}}
0109 };
0110
0111
0112
0113
0114
0115
0116 template <typename T>
0117 inline T pj_sign (T const& v)
0118 {
0119 return v > 0 ? 1 : (v < 0 ? -1 : 0);
0120 }
0121
0122
0123
0124
0125 inline int get_rotate_index(int index)
0126 {
0127 switch(index) {
0128 case 0:
0129 return 0;
0130 case 1:
0131 return 1;
0132 case 2:
0133 return 2;
0134 case 3:
0135 return 3;
0136 case -1:
0137 return 4;
0138 case -2:
0139 return 5;
0140 case -3:
0141 return 6;
0142 }
0143 return 0;
0144 }
0145
0146
0147
0148
0149
0150
0151
0152 template <typename T>
0153 inline int pnpoly(int nvert, T vert[][2], T const& testx, T const& testy)
0154 {
0155 int i;
0156 int counter = 0;
0157 T xinters;
0158 point_xy<T> p1, p2;
0159
0160
0161 for (i = 0; i < nvert; i++) {
0162 if (testx == vert[i][0] && testy == vert[i][1]) {
0163 return 1;
0164 }
0165 }
0166
0167 p1.x = vert[0][0];
0168 p1.y = vert[0][1];
0169
0170 for (i = 1; i < nvert; i++) {
0171 p2.x = vert[i % nvert][0];
0172 p2.y = vert[i % nvert][1];
0173 if (testy > (std::min)(p1.y, p2.y) &&
0174 testy <= (std::max)(p1.y, p2.y) &&
0175 testx <= (std::max)(p1.x, p2.x) &&
0176 p1.y != p2.y)
0177 {
0178 xinters = (testy-p1.y)*(p2.x-p1.x)/(p2.y-p1.y)+p1.x;
0179 if (p1.x == p2.x || testx <= xinters)
0180 counter++;
0181 }
0182 p1 = p2;
0183 }
0184
0185 if (counter % 2 == 0) {
0186 return 0;
0187 } else {
0188 return 1;
0189 }
0190 }
0191
0192
0193
0194
0195
0196
0197
0198 template <typename T>
0199 inline int in_image(T const& x, T const& y, int proj, int north_square, int south_square)
0200 {
0201 static const T pi = detail::pi<T>();
0202 static const T half_pi = detail::half_pi<T>();
0203 static const T fourth_pi = detail::fourth_pi<T>();
0204
0205 if (proj == 0) {
0206 T healpixVertsJit[][2] = {
0207 {-pi - epsilon, fourth_pi},
0208 {-3.0*fourth_pi, half_pi + epsilon},
0209 {-half_pi, fourth_pi + epsilon},
0210 {-fourth_pi, half_pi + epsilon},
0211 {0.0, fourth_pi + epsilon},
0212 {fourth_pi, half_pi + epsilon},
0213 {half_pi, fourth_pi + epsilon},
0214 {3.0*fourth_pi, half_pi + epsilon},
0215 {pi + epsilon, fourth_pi},
0216 {pi + epsilon, -fourth_pi},
0217 {3.0*fourth_pi, -half_pi - epsilon},
0218 {half_pi, -fourth_pi - epsilon},
0219 {fourth_pi, -half_pi - epsilon},
0220 {0.0, -fourth_pi - epsilon},
0221 {-fourth_pi, -half_pi - epsilon},
0222 {-half_pi, -fourth_pi - epsilon},
0223 {-3.0*fourth_pi, -half_pi - epsilon},
0224 {-pi - epsilon, -fourth_pi}
0225 };
0226 return pnpoly((int)sizeof(healpixVertsJit)/
0227 sizeof(healpixVertsJit[0]), healpixVertsJit, x, y);
0228 } else {
0229 T rhealpixVertsJit[][2] = {
0230 {-pi - epsilon, fourth_pi + epsilon},
0231 {-pi + north_square*half_pi - epsilon, fourth_pi + epsilon},
0232 {-pi + north_square*half_pi - epsilon, 3.0*fourth_pi + epsilon},
0233 {-pi + (north_square + 1.0)*half_pi + epsilon, 3.0*fourth_pi + epsilon},
0234 {-pi + (north_square + 1.0)*half_pi + epsilon, fourth_pi + epsilon},
0235 {pi + epsilon, fourth_pi + epsilon},
0236 {pi + epsilon, -fourth_pi - epsilon},
0237 {-pi + (south_square + 1.0)*half_pi + epsilon, -fourth_pi - epsilon},
0238 {-pi + (south_square + 1.0)*half_pi + epsilon, -3.0*fourth_pi - epsilon},
0239 {-pi + south_square*half_pi - epsilon, -3.0*fourth_pi - epsilon},
0240 {-pi + south_square*half_pi - epsilon, -fourth_pi - epsilon},
0241 {-pi - epsilon, -fourth_pi - epsilon}
0242 };
0243
0244 return pnpoly((int)sizeof(rhealpixVertsJit)/
0245 sizeof(rhealpixVertsJit[0]), rhealpixVertsJit, x, y);
0246 }
0247 }
0248
0249
0250
0251
0252
0253 template <typename Parameters, typename T>
0254 inline T auth_lat(const Parameters& par, const par_healpix<T>& proj_parm, T const& alpha, int inverse)
0255 {
0256 if (inverse == 0) {
0257
0258 T q = pj_qsfn(sin(alpha), par.e, 1.0 - par.es);
0259 T qp = proj_parm.qp;
0260 T ratio = q/qp;
0261
0262 if (math::abs(ratio) > 1) {
0263
0264 ratio = pj_sign(ratio);
0265 }
0266
0267 return asin(ratio);
0268 } else {
0269
0270 return pj_authlat(alpha, proj_parm.apa);
0271 }
0272 }
0273
0274
0275
0276
0277 template <typename T>
0278 inline void healpix_sphere(T const& lp_lam, T const& lp_phi, T& xy_x, T& xy_y)
0279 {
0280 static const T pi = detail::pi<T>();
0281 static const T half_pi = detail::half_pi<T>();
0282 static const T fourth_pi = detail::fourth_pi<T>();
0283
0284 T lam = lp_lam;
0285 T phi = lp_phi;
0286 T phi0 = asin(T(2.0)/T(3.0));
0287
0288
0289 if ( fabsl(phi) <= phi0) {
0290 xy_x = lam;
0291 xy_y = 3.0*pi/8.0*sin(phi);
0292 } else {
0293 T lamc;
0294 T sigma = sqrt(3.0*(1 - math::abs(sin(phi))));
0295 T cn = floor(2*lam / pi + 2);
0296 if (cn >= 4) {
0297 cn = 3;
0298 }
0299 lamc = -3*fourth_pi + half_pi*cn;
0300 xy_x = lamc + (lam - lamc)*sigma;
0301 xy_y = pj_sign(phi)*fourth_pi*(2 - sigma);
0302 }
0303 return;
0304 }
0305
0306
0307
0308 template <typename T>
0309 inline void healpix_sphere_inverse(T const& xy_x, T const& xy_y, T& lp_lam, T& lp_phi)
0310 {
0311 static const T pi = detail::pi<T>();
0312 static const T half_pi = detail::half_pi<T>();
0313 static const T fourth_pi = detail::fourth_pi<T>();
0314
0315 T x = xy_x;
0316 T y = xy_y;
0317 T y0 = fourth_pi;
0318
0319
0320 if (math::abs(y) <= y0) {
0321 lp_lam = x;
0322 lp_phi = asin(8.0*y/(3.0*pi));
0323 } else if (fabsl(y) < half_pi) {
0324 T cn = floor(2.0*x/pi + 2.0);
0325 T xc, tau;
0326 if (cn >= 4) {
0327 cn = 3;
0328 }
0329 xc = -3.0*fourth_pi + (half_pi)*cn;
0330 tau = 2.0 - 4.0*fabsl(y)/pi;
0331 lp_lam = xc + (x - xc)/tau;
0332 lp_phi = pj_sign(y)*asin(1.0 - math::pow(tau, 2)/3.0);
0333 } else {
0334 lp_lam = -1.0*pi;
0335 lp_phi = pj_sign(y)*half_pi;
0336 }
0337 return;
0338 }
0339
0340
0341
0342
0343 template <typename T>
0344 inline void vector_add(const T a[2], const T b[2], T ret[2])
0345 {
0346 int i;
0347 for(i = 0; i < 2; i++) {
0348 ret[i] = a[i] + b[i];
0349 }
0350 }
0351
0352
0353
0354
0355 template <typename T>
0356 inline void vector_sub(const T a[2], const T b[2], T ret[2])
0357 {
0358 int i;
0359 for(i = 0; i < 2; i++) {
0360 ret[i] = a[i] - b[i];
0361 }
0362 }
0363
0364
0365
0366
0367
0368 template <typename T1, typename T2>
0369 inline void dot_product(const T1 a[2][2], const T2 b[2], T2 ret[2])
0370 {
0371 int i, j;
0372 int length = 2;
0373 for(i = 0; i < length; i++) {
0374 ret[i] = 0;
0375 for(j = 0; j < length; j++) {
0376 ret[i] += a[i][j]*b[j];
0377 }
0378 }
0379 }
0380
0381
0382
0383
0384
0385
0386
0387
0388 template <typename T>
0389 inline cap_map<T> get_cap(T x, T const& y, int north_square, int south_square,
0390 int inverse)
0391 {
0392 static const T pi = detail::pi<T>();
0393 static const T half_pi = detail::half_pi<T>();
0394 static const T fourth_pi = detail::fourth_pi<T>();
0395
0396 cap_map<T> capmap;
0397 T c;
0398 capmap.x = x;
0399 capmap.y = y;
0400 if (inverse == 0) {
0401 if (y > fourth_pi) {
0402 capmap.region = cap_map<T>::north;
0403 c = half_pi;
0404 } else if (y < -fourth_pi) {
0405 capmap.region = cap_map<T>::south;
0406 c = -half_pi;
0407 } else {
0408 capmap.region = cap_map<T>::equatorial;
0409 capmap.cn = 0;
0410 return capmap;
0411 }
0412
0413 if (x < -half_pi) {
0414 capmap.cn = 0;
0415 capmap.x = (-3.0*fourth_pi);
0416 capmap.y = c;
0417 } else if (x >= -half_pi && x < 0) {
0418 capmap.cn = 1;
0419 capmap.x = -fourth_pi;
0420 capmap.y = c;
0421 } else if (x >= 0 && x < half_pi) {
0422 capmap.cn = 2;
0423 capmap.x = fourth_pi;
0424 capmap.y = c;
0425 } else {
0426 capmap.cn = 3;
0427 capmap.x = 3.0*fourth_pi;
0428 capmap.y = c;
0429 }
0430 } else {
0431 if (y > fourth_pi) {
0432 capmap.region = cap_map<T>::north;
0433 capmap.x = (-3.0*fourth_pi + north_square*half_pi);
0434 capmap.y = half_pi;
0435 x = x - north_square*half_pi;
0436 } else if (y < -fourth_pi) {
0437 capmap.region = cap_map<T>::south;
0438 capmap.x = (-3.0*fourth_pi + south_square*pi/2);
0439 capmap.y = -half_pi;
0440 x = x - south_square*half_pi;
0441 } else {
0442 capmap.region = cap_map<T>::equatorial;
0443 capmap.cn = 0;
0444 return capmap;
0445 }
0446
0447
0448 if (capmap.region == cap_map<T>::north) {
0449 if (y >= -x - fourth_pi - epsilon && y < x + 5.0*fourth_pi - epsilon) {
0450 capmap.cn = (north_square + 1) % 4;
0451 } else if (y > -x -fourth_pi + epsilon && y >= x + 5.0*fourth_pi - epsilon) {
0452 capmap.cn = (north_square + 2) % 4;
0453 } else if (y <= -x -fourth_pi + epsilon && y > x + 5.0*fourth_pi + epsilon) {
0454 capmap.cn = (north_square + 3) % 4;
0455 } else {
0456 capmap.cn = north_square;
0457 }
0458 } else if (capmap.region == cap_map<T>::south) {
0459 if (y <= x + fourth_pi + epsilon && y > -x - 5.0*fourth_pi + epsilon) {
0460 capmap.cn = (south_square + 1) % 4;
0461 } else if (y < x + fourth_pi - epsilon && y <= -x - 5.0*fourth_pi + epsilon) {
0462 capmap.cn = (south_square + 2) % 4;
0463 } else if (y >= x + fourth_pi - epsilon && y < -x - 5.0*fourth_pi - epsilon) {
0464 capmap.cn = (south_square + 3) % 4;
0465 } else {
0466 capmap.cn = south_square;
0467 }
0468 }
0469 }
0470 return capmap;
0471 }
0472
0473
0474
0475
0476
0477
0478
0479
0480
0481 template <typename T>
0482 inline void combine_caps(T& xy_x, T& xy_y, int north_square, int south_square,
0483 int inverse)
0484 {
0485 static const T half_pi = detail::half_pi<T>();
0486 static const T fourth_pi = detail::fourth_pi<T>();
0487
0488 T v[2];
0489 T c[2];
0490 T vector[2];
0491 T v_min_c[2];
0492 T ret_dot[2];
0493 const double (*tmpRot)[2];
0494 int pole = 0;
0495
0496 cap_map<T> capmap = get_cap(xy_x, xy_y, north_square, south_square, inverse);
0497 if (capmap.region == cap_map<T>::equatorial) {
0498 xy_x = capmap.x;
0499 xy_y = capmap.y;
0500 return;
0501 }
0502
0503 v[0] = xy_x; v[1] = xy_y;
0504 c[0] = capmap.x; c[1] = capmap.y;
0505
0506 if (inverse == 0) {
0507
0508
0509
0510 if (capmap.region == cap_map<T>::north) {
0511 pole = north_square;
0512 tmpRot = rot[get_rotate_index(capmap.cn - pole)];
0513 } else {
0514 pole = south_square;
0515 tmpRot = rot[get_rotate_index(-1*(capmap.cn - pole))];
0516 }
0517 } else {
0518
0519
0520
0521
0522 if (capmap.region == cap_map<T>::north) {
0523 pole = north_square;
0524 tmpRot = rot[get_rotate_index(-1*(capmap.cn - pole))];
0525 } else {
0526 pole = south_square;
0527 tmpRot = rot[get_rotate_index(capmap.cn - pole)];
0528 }
0529 }
0530
0531 vector_sub(v, c, v_min_c);
0532 dot_product(tmpRot, v_min_c, ret_dot);
0533
0534 {
0535 T a[2];
0536
0537 T* pa = a;
0538
0539
0540 pa[0] = -3.0*fourth_pi + ((inverse == 0) ? pole : capmap.cn) *half_pi;
0541 pa[1] = half_pi;
0542 vector_add(ret_dot, a, vector);
0543 }
0544
0545 xy_x = vector[0];
0546 xy_y = vector[1];
0547 }
0548
0549 template <typename T, typename Parameters>
0550 struct base_healpix_ellipsoid
0551 {
0552 par_healpix<T> m_proj_parm;
0553
0554
0555
0556 inline void fwd(Parameters const& par, T const& lp_lon, T lp_lat, T& xy_x, T& xy_y) const
0557 {
0558 lp_lat = auth_lat(par, m_proj_parm, lp_lat, 0);
0559 return healpix_sphere(lp_lon, lp_lat, xy_x, xy_y);
0560 }
0561
0562
0563
0564 inline void inv(Parameters const& par, T const& xy_x, T const& xy_y, T& lp_lon, T& lp_lat) const
0565 {
0566
0567 if (in_image(xy_x, xy_y, 0, 0, 0) == 0) {
0568 lp_lon = HUGE_VAL;
0569 lp_lat = HUGE_VAL;
0570 BOOST_THROW_EXCEPTION( projection_exception(error_invalid_x_or_y) );
0571 }
0572 healpix_sphere_inverse(xy_x, xy_y, lp_lon, lp_lat);
0573 lp_lat = auth_lat(par, m_proj_parm, lp_lat, 1);
0574 }
0575
0576 static inline std::string get_name()
0577 {
0578 return "healpix_ellipsoid";
0579 }
0580
0581 };
0582
0583 template <typename T, typename Parameters>
0584 struct base_healpix_spheroid
0585 {
0586 par_healpix<T> m_proj_parm;
0587
0588
0589
0590 inline void fwd(Parameters const& , T const& lp_lon, T const& lp_lat, T& xy_x, T& xy_y) const
0591 {
0592 return healpix_sphere(lp_lon, lp_lat, xy_x, xy_y);
0593 }
0594
0595
0596
0597 inline void inv(Parameters const& , T const& xy_x, T const& xy_y, T& lp_lon, T& lp_lat) const
0598 {
0599
0600 if (in_image(xy_x, xy_y, 0, 0, 0) == 0) {
0601 lp_lon = HUGE_VAL;
0602 lp_lat = HUGE_VAL;
0603 BOOST_THROW_EXCEPTION( projection_exception(error_invalid_x_or_y) );
0604 }
0605 return healpix_sphere_inverse(xy_x, xy_y, lp_lon, lp_lat);
0606 }
0607
0608 static inline std::string get_name()
0609 {
0610 return "healpix_spheroid";
0611 }
0612
0613 };
0614
0615 template <typename T, typename Parameters>
0616 struct base_rhealpix_ellipsoid
0617 {
0618 par_healpix<T> m_proj_parm;
0619
0620
0621
0622 inline void fwd(Parameters const& par, T const& lp_lon, T lp_lat, T& xy_x, T& xy_y) const
0623 {
0624 lp_lat = auth_lat(par, m_proj_parm, lp_lat, 0);
0625 healpix_sphere(lp_lon, lp_lat, xy_x, xy_y);
0626 combine_caps(xy_x, xy_y, this->m_proj_parm.north_square, this->m_proj_parm.south_square, 0);
0627 }
0628
0629
0630
0631 inline void inv(Parameters const& par, T xy_x, T xy_y, T& lp_lon, T& lp_lat) const
0632 {
0633
0634 if (in_image(xy_x, xy_y, 1, this->m_proj_parm.north_square, this->m_proj_parm.south_square) == 0) {
0635 lp_lon = HUGE_VAL;
0636 lp_lat = HUGE_VAL;
0637 BOOST_THROW_EXCEPTION( projection_exception(error_invalid_x_or_y) );
0638 }
0639 combine_caps(xy_x, xy_y, this->m_proj_parm.north_square, this->m_proj_parm.south_square, 1);
0640 healpix_sphere_inverse(xy_x, xy_y, lp_lon, lp_lat);
0641 lp_lat = auth_lat(par, m_proj_parm, lp_lat, 1);
0642 }
0643
0644 static inline std::string get_name()
0645 {
0646 return "rhealpix_ellipsoid";
0647 }
0648
0649 };
0650
0651 template <typename T, typename Parameters>
0652 struct base_rhealpix_spheroid
0653 {
0654 par_healpix<T> m_proj_parm;
0655
0656
0657
0658 inline void fwd(Parameters const& , T const& lp_lon, T const& lp_lat, T& xy_x, T& xy_y) const
0659 {
0660 healpix_sphere(lp_lon, lp_lat, xy_x, xy_y);
0661 combine_caps(xy_x, xy_y, this->m_proj_parm.north_square, this->m_proj_parm.south_square, 0);
0662 }
0663
0664
0665
0666 inline void inv(Parameters const& , T xy_x, T xy_y, T& lp_lon, T& lp_lat) const
0667 {
0668
0669 if (in_image(xy_x, xy_y, 1, this->m_proj_parm.north_square, this->m_proj_parm.south_square) == 0) {
0670 lp_lon = HUGE_VAL;
0671 lp_lat = HUGE_VAL;
0672 BOOST_THROW_EXCEPTION( projection_exception(error_invalid_x_or_y) );
0673 }
0674 combine_caps(xy_x, xy_y, this->m_proj_parm.north_square, this->m_proj_parm.south_square, 1);
0675 return healpix_sphere_inverse(xy_x, xy_y, lp_lon, lp_lat);
0676 }
0677
0678 static inline std::string get_name()
0679 {
0680 return "rhealpix_spheroid";
0681 }
0682
0683 };
0684
0685
0686 template <typename Parameters, typename T>
0687 inline void setup_healpix(Parameters& par, par_healpix<T>& proj_parm)
0688 {
0689 if (par.es != 0.0) {
0690 proj_parm.apa = pj_authset<T>(par.es);
0691 proj_parm.qp = pj_qsfn(1.0, par.e, par.one_es);
0692 par.a = par.a*sqrt(0.5*proj_parm.qp);
0693 pj_calc_ellipsoid_params(par, par.a, par.es);
0694 } else {
0695 }
0696 }
0697
0698
0699 template <typename Params, typename Parameters, typename T>
0700 inline void setup_rhealpix(Params const& params, Parameters& par, par_healpix<T>& proj_parm)
0701 {
0702 proj_parm.north_square = pj_get_param_i<srs::spar::north_square>(params, "north_square", srs::dpar::north_square);
0703 proj_parm.south_square = pj_get_param_i<srs::spar::south_square>(params, "south_square", srs::dpar::south_square);
0704
0705 if ((proj_parm.north_square < 0) || (proj_parm.north_square > 3)) {
0706 BOOST_THROW_EXCEPTION( projection_exception(error_axis) );
0707 }
0708 if ((proj_parm.south_square < 0) || (proj_parm.south_square > 3)) {
0709 BOOST_THROW_EXCEPTION( projection_exception(error_axis) );
0710 }
0711 if (par.es != 0.0) {
0712 proj_parm.apa = pj_authset<T>(par.es);
0713 proj_parm.qp = pj_qsfn(1.0, par.e, par.one_es);
0714 par.a = par.a*sqrt(0.5*proj_parm.qp);
0715
0716
0717 par.ra = 1.0/par.a;
0718 } else {
0719 }
0720 }
0721
0722 }}
0723 #endif
0724
0725
0726
0727
0728
0729
0730
0731
0732
0733
0734
0735
0736
0737 template <typename T, typename Parameters>
0738 struct healpix_ellipsoid : public detail::healpix::base_healpix_ellipsoid<T, Parameters>
0739 {
0740 template <typename Params>
0741 inline healpix_ellipsoid(Params const& , Parameters & par)
0742 {
0743 detail::healpix::setup_healpix(par, this->m_proj_parm);
0744 }
0745 };
0746
0747
0748
0749
0750
0751
0752
0753
0754
0755
0756
0757
0758
0759 template <typename T, typename Parameters>
0760 struct healpix_spheroid : public detail::healpix::base_healpix_spheroid<T, Parameters>
0761 {
0762 template <typename Params>
0763 inline healpix_spheroid(Params const& , Parameters & par)
0764 {
0765 detail::healpix::setup_healpix(par, this->m_proj_parm);
0766 }
0767 };
0768
0769
0770
0771
0772
0773
0774
0775
0776
0777
0778
0779
0780
0781
0782
0783
0784 template <typename T, typename Parameters>
0785 struct rhealpix_ellipsoid : public detail::healpix::base_rhealpix_ellipsoid<T, Parameters>
0786 {
0787 template <typename Params>
0788 inline rhealpix_ellipsoid(Params const& params, Parameters & par)
0789 {
0790 detail::healpix::setup_rhealpix(params, par, this->m_proj_parm);
0791 }
0792 };
0793
0794
0795
0796
0797
0798
0799
0800
0801
0802
0803
0804
0805
0806
0807
0808
0809 template <typename T, typename Parameters>
0810 struct rhealpix_spheroid : public detail::healpix::base_rhealpix_spheroid<T, Parameters>
0811 {
0812 template <typename Params>
0813 inline rhealpix_spheroid(Params const& params, Parameters & par)
0814 {
0815 detail::healpix::setup_rhealpix(params, par, this->m_proj_parm);
0816 }
0817 };
0818
0819 #ifndef DOXYGEN_NO_DETAIL
0820 namespace detail
0821 {
0822
0823
0824 BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PROJECTION_FI2(srs::spar::proj_healpix, healpix_spheroid, healpix_ellipsoid)
0825 BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PROJECTION_FI2(srs::spar::proj_rhealpix, rhealpix_spheroid, rhealpix_ellipsoid)
0826
0827
0828 BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_ENTRY_FI2(healpix_entry, healpix_spheroid, healpix_ellipsoid)
0829 BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_ENTRY_FI2(rhealpix_entry, rhealpix_spheroid, rhealpix_ellipsoid)
0830
0831 BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_INIT_BEGIN(healpix_init)
0832 {
0833 BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_INIT_ENTRY(healpix, healpix_entry)
0834 BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_INIT_ENTRY(rhealpix, rhealpix_entry)
0835 }
0836
0837 }
0838 #endif
0839
0840 }
0841
0842 }}
0843
0844 #endif
0845