spar.hpp 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030
  1. // Boost.Geometry
  2. // Copyright (c) 2017-2022, Oracle and/or its affiliates.
  3. // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
  4. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  5. // Use, modification and distribution is subject to the Boost Software License,
  6. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. #ifndef BOOST_GEOMETRY_SRS_PROJECTIONS_SPAR_HPP
  9. #define BOOST_GEOMETRY_SRS_PROJECTIONS_SPAR_HPP
  10. #include <string>
  11. #include <type_traits>
  12. #include <vector>
  13. #include <boost/geometry/core/radius.hpp>
  14. #include <boost/geometry/core/static_assert.hpp>
  15. #include <boost/geometry/core/tag.hpp>
  16. #include <boost/geometry/core/tags.hpp>
  17. #include <boost/geometry/srs/projections/impl/pj_datums.hpp>
  18. #include <boost/geometry/srs/projections/impl/pj_ellps.hpp>
  19. #include <boost/geometry/srs/projections/dpar.hpp>
  20. #include <boost/geometry/srs/projections/par_data.hpp>
  21. #include <boost/geometry/srs/sphere.hpp>
  22. #include <boost/geometry/srs/spheroid.hpp>
  23. #include <boost/geometry/util/sequence.hpp>
  24. #include <boost/geometry/util/tuples.hpp>
  25. #include <boost/variant/variant.hpp>
  26. namespace boost { namespace geometry { namespace srs
  27. {
  28. namespace spar
  29. {
  30. // Static parameters holder
  31. template <typename ...>
  32. class parameters {};
  33. namespace detail
  34. {
  35. // TODO: implement this as a sequence utility
  36. template <std::size_t I, typename ...>
  37. struct parameters_base
  38. {
  39. BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
  40. "I out of bounds.",
  41. std::integral_constant<size_t, I>);
  42. };
  43. template <std::size_t I, typename P, typename ...Ps>
  44. struct parameters_base<I, P, Ps...>
  45. {
  46. typedef typename parameters_base<I - 1, Ps...>::type type;
  47. };
  48. template <typename P, typename ...Ps>
  49. struct parameters_base<0, P, Ps...>
  50. {
  51. typedef parameters<P, Ps...> type;
  52. };
  53. } // namespace detail
  54. template <typename P, typename ...Ps>
  55. class parameters<P, Ps...>
  56. : private parameters<Ps...>
  57. {
  58. public:
  59. parameters() = default;
  60. parameters(parameters const&) = default;
  61. parameters(parameters&&) = default;
  62. parameters & operator=(parameters const&) = default;
  63. parameters & operator=(parameters&&) = default;
  64. template
  65. <
  66. typename R, typename ...Rs,
  67. std::enable_if_t<std::is_constructible<P, R>::value, int> = 0
  68. >
  69. explicit parameters(R&& r, Rs&&... rs)
  70. : parameters<Ps...>(std::forward<Rs>(rs)...)
  71. , m_p(std::forward<R>(r))
  72. {}
  73. template <std::size_t I>
  74. auto const& get() const
  75. {
  76. typedef typename detail::parameters_base<I, P, Ps...>::type base_t;
  77. return static_cast<base_t const&>(*this).m_p;
  78. }
  79. private:
  80. P m_p;
  81. template <typename ...>
  82. friend class parameters;
  83. };
  84. } // namespace spar
  85. }}} // namespace boost::geometry::srs
  86. namespace boost { namespace geometry { namespace tuples
  87. {
  88. template <std::size_t I, typename ...Ts>
  89. struct element<I, srs::spar::parameters<Ts...> >
  90. : util::sequence_element<I, util::type_sequence<Ts...> >
  91. {};
  92. template <typename ...Ts>
  93. struct size<srs::spar::parameters<Ts...> >
  94. : std::integral_constant<std::size_t, sizeof...(Ts)>
  95. {};
  96. template <int I, typename ...Ts>
  97. inline typename element<I, srs::spar::parameters<Ts...> >::type const&
  98. get(srs::spar::parameters<Ts...> const& tup)
  99. {
  100. return tup.template get<I>();
  101. }
  102. }}} // namespace boost::geometry::tuples
  103. namespace boost { namespace geometry { namespace srs
  104. {
  105. namespace spar
  106. {
  107. // Static parameters values
  108. struct datum_wgs84 {};
  109. struct datum_ggrs87 {};
  110. struct datum_nad83 {};
  111. struct datum_nad27 {};
  112. struct datum_potsdam {};
  113. struct datum_carthage {};
  114. struct datum_hermannskogel {};
  115. struct datum_ire65 {};
  116. struct datum_nzgd49 {};
  117. struct datum_osgb36 {};
  118. struct ellps_merit {};
  119. struct ellps_sgs85 {};
  120. struct ellps_grs80 {};
  121. struct ellps_iau76 {};
  122. struct ellps_airy {};
  123. struct ellps_apl4_9 {};
  124. struct ellps_nwl9d {};
  125. struct ellps_mod_airy {};
  126. struct ellps_andrae {};
  127. struct ellps_aust_sa {};
  128. struct ellps_grs67 {};
  129. struct ellps_bessel {};
  130. struct ellps_bess_nam {};
  131. struct ellps_clrk66 {};
  132. struct ellps_clrk80 {};
  133. struct ellps_clrk80ign {};
  134. struct ellps_cpm {};
  135. struct ellps_delmbr {};
  136. struct ellps_engelis {};
  137. struct ellps_evrst30 {};
  138. struct ellps_evrst48 {};
  139. struct ellps_evrst56 {};
  140. struct ellps_evrst69 {};
  141. struct ellps_evrstss {};
  142. struct ellps_fschr60 {};
  143. struct ellps_fschr60m {};
  144. struct ellps_fschr68 {};
  145. struct ellps_helmert {};
  146. struct ellps_hough {};
  147. struct ellps_intl {};
  148. struct ellps_krass {};
  149. struct ellps_kaula {};
  150. struct ellps_lerch {};
  151. struct ellps_mprts {};
  152. struct ellps_new_intl {};
  153. struct ellps_plessis {};
  154. struct ellps_seasia {};
  155. struct ellps_walbeck {};
  156. struct ellps_wgs60 {};
  157. struct ellps_wgs66 {};
  158. struct ellps_wgs72 {};
  159. struct ellps_wgs84 {};
  160. struct ellps_sphere {};
  161. struct mode_plane {};
  162. struct mode_di {};
  163. struct mode_dd {};
  164. struct mode_hex {};
  165. struct orient_isea {};
  166. struct orient_pole {};
  167. struct pm_greenwich {};
  168. struct pm_lisbon {};
  169. struct pm_paris {};
  170. struct pm_bogota {};
  171. struct pm_madrid {};
  172. struct pm_rome {};
  173. struct pm_bern {};
  174. struct pm_jakarta {};
  175. struct pm_ferro {};
  176. struct pm_brussels {};
  177. struct pm_stockholm {};
  178. struct pm_athens {};
  179. struct pm_oslo {};
  180. struct proj_aea {}; struct proj_leac {}; // Albers Equal Area, Lambert Equal Area Conic
  181. struct proj_aeqd {}; // Azimuthal Equidistant
  182. struct proj_airy {}; // Airy
  183. struct proj_aitoff {}; struct proj_wintri {}; // Aitoff, Winkel Tripel
  184. struct proj_august {};
  185. struct proj_apian {}; struct proj_ortel {}; struct proj_bacon {};
  186. struct proj_bipc {};
  187. struct proj_boggs {};
  188. struct proj_bonne {};
  189. struct proj_cass {};
  190. struct proj_cc {};
  191. struct proj_cea {};
  192. struct proj_chamb {};
  193. struct proj_col_urban {};
  194. struct proj_collg {};
  195. struct proj_crast {};
  196. struct proj_denoy {};
  197. struct proj_eck1 {};
  198. struct proj_eck2 {};
  199. struct proj_eck3 {}; struct proj_putp1 {}; struct proj_wag6 {}; struct proj_kav7 {};
  200. struct proj_eck4 {};
  201. struct proj_eck5 {};
  202. struct proj_eqc {};
  203. struct proj_eqdc {};
  204. struct proj_etmerc {}; struct proj_utm {};
  205. struct proj_fahey {};
  206. struct proj_fouc_s {};
  207. struct proj_gall {};
  208. struct proj_geocent {};
  209. struct proj_geos {};
  210. struct proj_gins8 {};
  211. struct proj_gn_sinu {}; struct proj_sinu {}; struct proj_eck6 {}; struct proj_mbtfps {};
  212. struct proj_gnom {};
  213. struct proj_goode {};
  214. struct proj_gstmerc {};
  215. struct proj_hammer {};
  216. struct proj_hatano {};
  217. struct proj_healpix {};
  218. struct proj_rhealpix {};
  219. struct proj_igh {};
  220. struct proj_imw_p {};
  221. struct proj_isea {};
  222. struct proj_krovak {};
  223. struct proj_labrd {};
  224. struct proj_laea {};
  225. struct proj_lagrng {};
  226. struct proj_larr {};
  227. struct proj_lask {};
  228. struct proj_lonlat {}; struct proj_latlon {}; struct proj_latlong {}; struct proj_longlat {};
  229. struct proj_lcc {};
  230. struct proj_lcca {};
  231. struct proj_loxim {};
  232. struct proj_lsat {};
  233. struct proj_mbt_fps {};
  234. struct proj_mbtfpp {};
  235. struct proj_mbtfpq {};
  236. struct proj_merc {};
  237. struct proj_mill {};
  238. struct proj_mil_os {}; struct proj_lee_os {}; struct proj_gs48 {}; struct proj_alsk {}; struct proj_gs50 {};
  239. struct proj_moll {}; struct proj_wag4 {}; struct proj_wag5 {};
  240. struct proj_natearth {};
  241. struct proj_nell {};
  242. struct proj_nell_h {};
  243. struct proj_nicol {};
  244. struct proj_nsper {}; struct proj_tpers {};
  245. struct proj_nzmg {};
  246. struct proj_ob_tran {};
  247. struct proj_ocea {};
  248. struct proj_oea {};
  249. struct proj_omerc {};
  250. struct proj_ortho {};
  251. struct proj_poly {};
  252. struct proj_putp2 {};
  253. struct proj_putp3 {}; struct proj_putp3p {};
  254. struct proj_putp4p {}; struct proj_weren {};
  255. struct proj_putp5 {}; struct proj_putp5p {};
  256. struct proj_putp6 {}; struct proj_putp6p {};
  257. struct proj_qsc {};
  258. struct proj_robin {};
  259. struct proj_rouss {};
  260. struct proj_rpoly {};
  261. struct proj_euler {}; struct proj_murd1 {}; struct proj_murd2 {}; struct proj_murd3 {}; struct proj_pconic {}; struct proj_tissot {}; struct proj_vitk1 {};
  262. struct proj_somerc {};
  263. struct proj_stere {}; struct proj_ups {};
  264. struct proj_sterea {};
  265. struct proj_kav5 {}; struct proj_qua_aut {}; struct proj_fouc {}; struct proj_mbt_s {};
  266. struct proj_tcc {};
  267. struct proj_tcea {};
  268. struct proj_tmerc {};
  269. struct proj_tpeqd {};
  270. struct proj_urm5 {};
  271. struct proj_urmfps {}; struct proj_wag1 {};
  272. struct proj_vandg {};
  273. struct proj_vandg2 {}; struct proj_vandg3 {};
  274. struct proj_vandg4 {};
  275. struct proj_wag2 {};
  276. struct proj_wag3 {};
  277. struct proj_wag7 {};
  278. struct proj_webmerc {};
  279. struct proj_wink1 {};
  280. struct proj_wink2 {};
  281. struct sweep_x {};
  282. struct sweep_y {};
  283. struct units_km {};
  284. struct units_m {};
  285. struct units_dm {};
  286. struct units_cm {};
  287. struct units_mm {};
  288. struct units_kmi {};
  289. struct units_in {};
  290. struct units_ft {};
  291. struct units_yd {};
  292. struct units_mi {};
  293. struct units_fath {};
  294. struct units_ch {};
  295. struct units_link {};
  296. struct units_us_in {};
  297. struct units_us_ft {};
  298. struct units_us_yd {};
  299. struct units_us_ch {};
  300. struct units_us_mi {};
  301. struct units_ind_yd {};
  302. struct units_ind_ft {};
  303. struct units_ind_ch {};
  304. // Static parameters names
  305. #define BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_F(NAME) \
  306. template <typename T = double> \
  307. struct NAME \
  308. { \
  309. NAME() : value(0) {} \
  310. explicit NAME(T const& v) : value(v) {} \
  311. T value; \
  312. };
  313. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_F(a)
  314. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_F(b)
  315. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_F(e)
  316. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_F(es)
  317. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_F(f)
  318. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_F(gamma)
  319. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_F(h)
  320. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_F(h_0)
  321. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_F(k)
  322. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_F(k_0)
  323. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_F(m)
  324. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_F(n)
  325. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_F(q)
  326. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_F(r)
  327. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_F(rf)
  328. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_F(to_meter)
  329. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_F(vto_meter)
  330. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_F(w)
  331. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_F(x_0)
  332. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_F(y_0)
  333. #define BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_R(NAME) \
  334. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_F(NAME)
  335. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_R(alpha)
  336. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_R(azi)
  337. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_R(lat_0)
  338. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_R(lat_1)
  339. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_R(lat_2)
  340. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_R(lat_b)
  341. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_R(lat_ts)
  342. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_R(lon_0)
  343. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_R(lon_1)
  344. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_R(lon_2)
  345. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_R(lon_wrap)
  346. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_R(lonc)
  347. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_R(o_alpha)
  348. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_R(o_lat_1)
  349. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_R(o_lat_2)
  350. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_R(o_lat_c)
  351. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_R(o_lat_p)
  352. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_R(o_lon_1)
  353. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_R(o_lon_2)
  354. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_R(o_lon_c)
  355. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_R(o_lon_p)
  356. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_R(pm)
  357. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_R(r_lat_a)
  358. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_R(r_lat_g)
  359. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_R(theta)
  360. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_R(tilt)
  361. #define BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_I(NAME) \
  362. template <int I> struct NAME { static const int value = I; };
  363. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_I(aperture)
  364. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_I(lsat)
  365. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_I(north_square)
  366. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_I(path)
  367. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_I(resolution)
  368. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_I(south_square)
  369. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_I(zone)
  370. #define BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_BE(NAME) \
  371. struct NAME {};
  372. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_BE(czech)
  373. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_BE(geoc)
  374. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_BE(guam)
  375. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_BE(no_cut)
  376. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_BE(no_defs)
  377. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_BE(no_rot)
  378. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_BE(ns)
  379. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_BE(over)
  380. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_BE(r_a)
  381. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_BE(r_au)
  382. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_BE(r_g)
  383. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_BE(r_h)
  384. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_BE(r_v)
  385. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_BE(rescale)
  386. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_BE(south)
  387. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_BE(variant_c)
  388. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_BE(no_off)
  389. BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PARAM_BE(hyperbolic)
  390. template
  391. <
  392. typename SpheroidOrSphere
  393. >
  394. struct ellps
  395. {
  396. typedef SpheroidOrSphere model_type;
  397. ellps() : model() {}
  398. explicit ellps(SpheroidOrSphere const& sph) : model(sph) {}
  399. SpheroidOrSphere model;
  400. };
  401. struct nadgrids
  402. : srs::detail::nadgrids
  403. {
  404. typedef srs::detail::nadgrids base_t;
  405. nadgrids(std::string const& g0) : base_t(g0) {}
  406. nadgrids(std::string const& g0, std::string const& g1) : base_t(g0, g1) {}
  407. nadgrids(std::string const& g0, std::string const& g1, std::string const& g2) : base_t(g0, g1, g2) {}
  408. nadgrids(std::string const& g0, std::string const& g1, std::string const& g2, std::string const& g3) : base_t(g0, g1, g2, g3) {}
  409. nadgrids(std::string const& g0, std::string const& g1, std::string const& g2, std::string const& g3, std::string const& g4) : base_t(g0, g1, g2, g3, g4) {}
  410. nadgrids(std::initializer_list<std::string> l) : base_t(l) {}
  411. };
  412. template <typename Proj>
  413. struct o_proj
  414. {
  415. typedef Proj type;
  416. };
  417. template <typename T = double>
  418. struct towgs84
  419. : srs::detail::towgs84<T>
  420. {
  421. typedef srs::detail::towgs84<T> base_t;
  422. towgs84(T const& v0, T const& v1, T const& v2)
  423. : base_t(v0, v1, v2)
  424. {}
  425. towgs84(T const& v0, T const& v1, T const& v2, T const& v3, T const& v4, T const& v5, T const& v6)
  426. : base_t(v0, v1, v2, v3, v4, v5, v6)
  427. {}
  428. towgs84(std::initializer_list<T> l) : base_t(l) {}
  429. };
  430. struct axis
  431. : srs::detail::axis
  432. {
  433. typedef srs::detail::axis base_t;
  434. axis(int const& v0, int const& v1, int const& v2)
  435. : base_t(v0, v1, v2)
  436. {}
  437. axis(std::initializer_list<int> l) : base_t(l) {}
  438. };
  439. template <typename Units>
  440. struct vunits
  441. {
  442. typedef Units type;
  443. };
  444. // Static parameters traits
  445. #ifndef DOXYGEN_NO_DETAIL
  446. namespace detail
  447. {
  448. template <typename D>
  449. struct datum_traits
  450. {
  451. static const bool is_specialized = false;
  452. typedef void ellps_type;
  453. typedef void def_type;
  454. };
  455. #define BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_DATUM(NAME, ELLPS, DEF_T, DEF_V) \
  456. template <> \
  457. struct datum_traits<spar::NAME> \
  458. { \
  459. static const bool is_specialized = true; \
  460. typedef spar::ELLPS ellps_type; \
  461. typedef spar::DEF_T def_type; \
  462. static spar::DEF_T def() { return spar::DEF_T DEF_V; } \
  463. static const dpar::value_datum id = dpar::NAME; \
  464. };
  465. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_DATUM(datum_wgs84, ellps_wgs84, towgs84<double>, (0,0,0))
  466. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_DATUM(datum_ggrs87, ellps_grs80, towgs84<double>, (-199.87,74.79,246.62))
  467. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_DATUM(datum_nad83, ellps_grs80, towgs84<double>, (0,0,0))
  468. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_DATUM(datum_nad27, ellps_clrk66, nadgrids, ("@conus","@alaska","@ntv2_0.gsb","@ntv1_can.dat"))
  469. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_DATUM(datum_potsdam, ellps_bessel, towgs84<double>, (598.1,73.7,418.2,0.202,0.045,-2.455,6.7))
  470. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_DATUM(datum_carthage, ellps_clrk80ign, towgs84<double>, (-263.0,6.0,431.0))
  471. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_DATUM(datum_hermannskogel, ellps_bessel, towgs84<double>, (577.326,90.129,463.919,5.137,1.474,5.297,2.4232))
  472. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_DATUM(datum_ire65, ellps_mod_airy, towgs84<double>, (482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15))
  473. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_DATUM(datum_nzgd49, ellps_intl, towgs84<double>, (59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993))
  474. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_DATUM(datum_osgb36, ellps_airy, towgs84<double>, (446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894))
  475. template <typename E>
  476. struct ellps_traits
  477. {
  478. static const bool is_specialized = false;
  479. template <typename T> struct model_type
  480. {
  481. typedef void type;
  482. };
  483. };
  484. template <typename E>
  485. struct ellps_traits<spar::ellps<E> >
  486. {
  487. static const bool is_specialized = true;
  488. template <typename T> struct model_type
  489. {
  490. // TODO: transform to spheroid<T> or sphere<T>
  491. typedef typename spar::ellps<E>::model_type type;
  492. };
  493. template <typename T>
  494. static typename spar::ellps<E>::model_type const& model(spar::ellps<E> const& e)
  495. {
  496. return e.model;
  497. }
  498. };
  499. // TODO: Implement as RadiusType-agnostic, member struct template defining model
  500. // and function template returning it
  501. #define BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(NAME) \
  502. template <> \
  503. struct ellps_traits<spar::NAME> \
  504. { \
  505. static const bool is_specialized = true; \
  506. template <typename T> struct model_type \
  507. { \
  508. typedef srs::spheroid<T> type; \
  509. }; \
  510. template <typename T> \
  511. static srs::spheroid<T> model(spar::NAME const&) { \
  512. return srs::spheroid<T>(projections::detail::pj_get_ellps<T>().first[dpar::NAME].a, \
  513. projections::detail::pj_get_ellps<T>().first[dpar::NAME].b); \
  514. } \
  515. };
  516. #define BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_SPHERE(NAME) \
  517. template <> \
  518. struct ellps_traits<spar::NAME> \
  519. { \
  520. static const bool is_specialized = true; \
  521. template <typename T> struct model_type \
  522. { \
  523. typedef srs::sphere<T> type; \
  524. }; \
  525. template <typename T> \
  526. static srs::sphere<T> model(spar::NAME const&) { \
  527. return srs::sphere<T>(projections::detail::pj_get_ellps<T>().first[dpar::NAME].a); \
  528. } \
  529. };
  530. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_merit)
  531. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_sgs85)
  532. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_grs80)
  533. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_iau76)
  534. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_airy)
  535. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_apl4_9)
  536. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_nwl9d)
  537. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_mod_airy)
  538. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_andrae)
  539. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_aust_sa)
  540. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_grs67)
  541. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_bessel)
  542. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_bess_nam)
  543. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_clrk66)
  544. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_clrk80)
  545. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_clrk80ign)
  546. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_cpm)
  547. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_delmbr)
  548. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_engelis)
  549. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_evrst30)
  550. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_evrst48)
  551. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_evrst56)
  552. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_evrst69)
  553. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_evrstss)
  554. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_fschr60)
  555. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_fschr60m)
  556. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_fschr68)
  557. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_helmert)
  558. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_hough)
  559. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_intl)
  560. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_krass)
  561. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_kaula)
  562. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_lerch)
  563. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_mprts)
  564. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_new_intl)
  565. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_plessis)
  566. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_seasia)
  567. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_walbeck)
  568. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_wgs60)
  569. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_wgs66)
  570. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_wgs72)
  571. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ELLPS(ellps_wgs84)
  572. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_SPHERE(ellps_sphere)
  573. template <typename M>
  574. struct mode_traits
  575. {
  576. static const bool is_specialized = false;
  577. typedef void type;
  578. };
  579. #define BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_MODE(NAME) \
  580. template <> \
  581. struct mode_traits<spar::NAME> \
  582. { \
  583. static const bool is_specialized = true; \
  584. typedef spar::NAME type; \
  585. };
  586. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_MODE(mode_plane)
  587. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_MODE(mode_di)
  588. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_MODE(mode_dd)
  589. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_MODE(mode_hex)
  590. template <typename O>
  591. struct orient_traits
  592. {
  593. static const bool is_specialized = false;
  594. typedef void type;
  595. };
  596. #define BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ORIENT(NAME) \
  597. template <> \
  598. struct orient_traits<spar::NAME> \
  599. { \
  600. static const bool is_specialized = true; \
  601. typedef spar::NAME type; \
  602. };
  603. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ORIENT(orient_isea)
  604. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_ORIENT(orient_pole)
  605. template <typename M>
  606. struct pm_traits
  607. {
  608. static const bool is_specialized = false;
  609. typedef void type;
  610. };
  611. template <typename T>
  612. struct pm_traits<spar::pm<T> >
  613. {
  614. static const bool is_specialized = true;
  615. typedef T type;
  616. static T const& value(spar::pm<T> const& p) { return p.value; }
  617. };
  618. #define BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PM(NAME, INDEX) \
  619. template <> \
  620. struct pm_traits<spar::NAME> \
  621. { \
  622. static const bool is_specialized = true; \
  623. typedef double type; \
  624. static double value(spar::NAME const& ) { return projections::detail::pj_prime_meridians[INDEX].deg; } \
  625. };
  626. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PM(pm_greenwich, 0)
  627. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PM(pm_lisbon, 1)
  628. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PM(pm_paris, 2)
  629. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PM(pm_bogota, 3)
  630. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PM(pm_madrid, 4)
  631. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PM(pm_rome, 5)
  632. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PM(pm_bern, 6)
  633. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PM(pm_jakarta, 7)
  634. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PM(pm_ferro, 8)
  635. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PM(pm_brussels, 9)
  636. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PM(pm_stockholm, 10)
  637. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PM(pm_athens, 11)
  638. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PM(pm_oslo, 12)
  639. template <typename P>
  640. struct proj_traits
  641. {
  642. static const bool is_specialized = false;
  643. typedef void type;
  644. };
  645. #define BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(NAME) \
  646. template <> \
  647. struct proj_traits<spar::NAME> \
  648. { \
  649. static const bool is_specialized = true; \
  650. typedef spar::NAME type; \
  651. static const srs::dpar::value_proj id = dpar::NAME; \
  652. };
  653. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_aea)
  654. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_leac)
  655. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_aeqd)
  656. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_airy)
  657. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_aitoff)
  658. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_wintri)
  659. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_august)
  660. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_apian)
  661. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_ortel)
  662. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_bacon)
  663. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_bipc)
  664. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_boggs)
  665. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_bonne)
  666. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_cass)
  667. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_cc)
  668. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_cea)
  669. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_chamb)
  670. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_col_urban)
  671. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_collg)
  672. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_crast)
  673. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_denoy)
  674. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_eck1)
  675. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_eck2)
  676. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_eck3)
  677. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_putp1)
  678. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_wag6)
  679. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_kav7)
  680. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_eck4)
  681. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_eck5)
  682. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_eqc)
  683. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_eqdc)
  684. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_etmerc)
  685. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_utm)
  686. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_fahey)
  687. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_fouc_s)
  688. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_gall)
  689. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_geocent)
  690. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_geos)
  691. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_gins8)
  692. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_gn_sinu)
  693. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_sinu)
  694. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_eck6)
  695. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_mbtfps)
  696. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_gnom)
  697. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_goode)
  698. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_gstmerc)
  699. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_hammer)
  700. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_hatano)
  701. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_healpix)
  702. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_rhealpix)
  703. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_igh)
  704. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_imw_p)
  705. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_isea)
  706. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_krovak)
  707. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_labrd)
  708. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_laea)
  709. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_lagrng)
  710. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_larr)
  711. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_lask)
  712. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_lonlat)
  713. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_latlon)
  714. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_latlong)
  715. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_longlat)
  716. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_lcc)
  717. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_lcca)
  718. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_loxim)
  719. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_lsat)
  720. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_mbt_fps)
  721. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_mbtfpp)
  722. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_mbtfpq)
  723. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_merc)
  724. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_mill)
  725. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_mil_os)
  726. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_lee_os)
  727. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_gs48)
  728. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_alsk)
  729. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_gs50)
  730. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_moll)
  731. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_wag4)
  732. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_wag5)
  733. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_natearth)
  734. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_nell)
  735. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_nell_h)
  736. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_nicol)
  737. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_nsper)
  738. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_tpers)
  739. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_nzmg)
  740. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_ob_tran)
  741. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_ocea)
  742. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_oea)
  743. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_omerc)
  744. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_ortho)
  745. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_poly)
  746. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_putp2)
  747. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_putp3)
  748. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_putp3p)
  749. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_putp4p)
  750. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_weren)
  751. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_putp5)
  752. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_putp5p)
  753. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_putp6)
  754. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_putp6p)
  755. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_qsc)
  756. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_robin)
  757. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_rouss)
  758. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_rpoly)
  759. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_euler)
  760. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_murd1)
  761. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_murd2)
  762. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_murd3)
  763. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_pconic)
  764. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_tissot)
  765. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_vitk1)
  766. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_somerc)
  767. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_stere)
  768. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_ups)
  769. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_sterea)
  770. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_kav5)
  771. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_qua_aut)
  772. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_fouc)
  773. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_mbt_s)
  774. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_tcc)
  775. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_tcea)
  776. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_tmerc)
  777. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_tpeqd)
  778. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_urm5)
  779. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_urmfps)
  780. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_wag1)
  781. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_vandg)
  782. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_vandg2)
  783. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_vandg3)
  784. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_vandg4)
  785. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_wag2)
  786. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_wag3)
  787. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_wag7)
  788. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_webmerc)
  789. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_wink1)
  790. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_PROJ(proj_wink2)
  791. template <typename S>
  792. struct sweep_traits
  793. {
  794. static const bool is_specialized = false;
  795. typedef void type;
  796. };
  797. #define BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_SWEEP(NAME) \
  798. template <> \
  799. struct sweep_traits<spar::NAME> \
  800. { \
  801. static const bool is_specialized = true; \
  802. typedef spar::NAME type; \
  803. };
  804. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_SWEEP(sweep_x)
  805. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_SWEEP(sweep_y)
  806. template <typename S>
  807. struct units_traits
  808. {
  809. static const bool is_specialized = false;
  810. typedef void type;
  811. };
  812. #define BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_UNITS(NAME) \
  813. template <> \
  814. struct units_traits<spar::NAME> \
  815. { \
  816. static const bool is_specialized = true; \
  817. typedef spar::NAME type; \
  818. static const srs::dpar::value_units id = dpar::NAME; \
  819. };
  820. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_UNITS(units_km)
  821. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_UNITS(units_m)
  822. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_UNITS(units_dm)
  823. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_UNITS(units_cm)
  824. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_UNITS(units_mm)
  825. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_UNITS(units_kmi)
  826. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_UNITS(units_in)
  827. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_UNITS(units_ft)
  828. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_UNITS(units_yd)
  829. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_UNITS(units_mi)
  830. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_UNITS(units_fath)
  831. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_UNITS(units_ch)
  832. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_UNITS(units_link)
  833. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_UNITS(units_us_in)
  834. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_UNITS(units_us_ft)
  835. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_UNITS(units_us_yd)
  836. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_UNITS(units_us_ch)
  837. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_UNITS(units_us_mi)
  838. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_UNITS(units_ind_yd)
  839. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_UNITS(units_ind_ft)
  840. BOOST_GEOMETRY_PROJECTIONS_DETAIL_REGISTER_UNITS(units_ind_ch)
  841. template <typename T, template <typename> class Param>
  842. struct is_same_t : std::false_type {};
  843. template <typename T, template <typename> class Param>
  844. struct is_same_t<Param<T>, Param> : std::true_type {};
  845. template <typename T, template <int> class Param>
  846. struct is_same_i : std::false_type {};
  847. template <int I, template <int> class Param>
  848. struct is_same_i<Param<I>, Param> : std::true_type {};
  849. template <typename T, template <typename> class Traits>
  850. struct it_traits_specialized
  851. : std::integral_constant
  852. <
  853. bool,
  854. Traits<T>::is_specialized
  855. >
  856. {};
  857. template <typename Param>
  858. struct is_param
  859. {
  860. template <typename T>
  861. struct pred : std::is_same<T, Param> {};
  862. };
  863. template <template <typename> class Param>
  864. struct is_param_t
  865. {
  866. template <typename T>
  867. struct pred : is_same_t<T, Param> {};
  868. };
  869. template <template <int> class Param>
  870. struct is_param_i
  871. {
  872. template <typename T>
  873. struct pred : is_same_i<T, Param> {};
  874. };
  875. template <template <typename> class Traits>
  876. struct is_param_tr
  877. {
  878. template <typename T>
  879. struct pred : it_traits_specialized<T, Traits> {};
  880. };
  881. // pick proj static name
  882. template <typename Tuple>
  883. struct pick_proj_tag
  884. {
  885. typedef typename geometry::tuples::find_if
  886. <
  887. Tuple,
  888. is_param_tr<proj_traits>::pred
  889. >::type proj_type;
  890. static const bool is_found = geometry::tuples::is_found<proj_type>::value;
  891. BOOST_GEOMETRY_STATIC_ASSERT((is_found), "Projection not named.", Tuple);
  892. typedef proj_traits<proj_type> traits_type;
  893. typedef typename traits_type::type type;
  894. };
  895. template <typename Tuple>
  896. struct pick_o_proj_tag
  897. {
  898. typedef typename geometry::tuples::find_if
  899. <
  900. Tuple,
  901. is_param_t<o_proj>::pred
  902. >::type o_proj_type;
  903. static const bool is_found = geometry::tuples::is_found<o_proj_type>::value;
  904. BOOST_GEOMETRY_STATIC_ASSERT((is_found), "Expected o_proj parameter.", Tuple);
  905. typedef proj_traits<typename o_proj_type::type> traits_type;
  906. typedef typename traits_type::type type;
  907. };
  908. } // namespace detail
  909. #endif // DOXYGEN_NO_DETAIL
  910. } // namespace spar
  911. }}} // namespace boost::geometry::srs
  912. #endif // BOOST_GEOMETRY_SRS_PROJECTIONS_SPAR_HPP