maplibre-gl-components 0.16.2 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. package/README.md +4 -3
  2. package/dist/{ControlGrid-DQ4w_Nf9.js → ControlGrid-C6zp03Vq.js} +125375 -115454
  3. package/dist/ControlGrid-DIAcXRBe.cjs +17278 -0
  4. package/dist/DuckDBConverter-5a2FWwmf.js +354 -0
  5. package/dist/DuckDBConverter-pfXSUi_l.cjs +23 -0
  6. package/dist/ShapefileConverter-DGCXPY_S.cjs +1 -0
  7. package/dist/ShapefileConverter-DN3fVOuo.js +102 -0
  8. package/dist/basedecoder-BliCKuUS.js +62 -0
  9. package/dist/basedecoder-Zw0CbD9L.cjs +1 -0
  10. package/dist/deflate-DBL0msKQ.js +10 -0
  11. package/dist/deflate-DNeBKDsy.cjs +1 -0
  12. package/dist/esm-Bp6m44bk.js +811 -0
  13. package/dist/esm-oEp_aN1n.cjs +1 -0
  14. package/dist/geojson-Bnoe76Pm.js +2002 -0
  15. package/dist/geojson-CxMdRvJX.cjs +1 -0
  16. package/dist/geotiff-Bzy-Zyc2.js +1882 -0
  17. package/dist/geotiff-DYylEFA9.cjs +8 -0
  18. package/dist/globals-B4iCNAg9.cjs +1 -0
  19. package/dist/globals-BKIWameS.js +572 -0
  20. package/dist/index.cjs +1 -1
  21. package/dist/index.mjs +150 -147
  22. package/dist/jpeg-B6Sg6W8k.cjs +1 -0
  23. package/dist/jpeg-CJcNvScS.js +545 -0
  24. package/dist/lerc-2QwcA_K7.js +840 -0
  25. package/dist/lerc-DQRITnja.cjs +1 -0
  26. package/dist/lib-B4jvG7hB.cjs +4 -0
  27. package/dist/lib-CNQtqzfc.js +4060 -0
  28. package/dist/lzw-1HaU0PJK.cjs +1 -0
  29. package/dist/lzw-DF5VHuii.js +76 -0
  30. package/dist/main-dist-CbHNdsir.js +18314 -0
  31. package/dist/main-dist-DOx_Axbx.cjs +2 -0
  32. package/dist/maplibre-geoman.es-C0F1ydoG.cjs +213 -0
  33. package/dist/maplibre-geoman.es-D1CztSQd.js +27213 -0
  34. package/dist/maplibre-gl-components.css +2 -1
  35. package/dist/packbits-CK8RPU_B.js +22 -0
  36. package/dist/packbits-D5Zovac7.cjs +1 -0
  37. package/dist/pako.esm-DFyPB7cO.cjs +1 -0
  38. package/dist/pako.esm-hTfpTBhd.js +1536 -0
  39. package/dist/raw-Brljg6vy.js +9 -0
  40. package/dist/raw-C-CSxCoU.cjs +1 -0
  41. package/dist/react.cjs +1 -1
  42. package/dist/react.mjs +1357 -1004
  43. package/dist/{types → src}/lib/core/CogLayer.d.ts.map +1 -1
  44. package/dist/{types → src}/lib/core/PMTilesLayer.d.ts.map +1 -1
  45. package/dist/{types → src}/lib/core/SpinGlobeControl.d.ts +6 -7
  46. package/dist/src/lib/core/SpinGlobeControl.d.ts.map +1 -0
  47. package/dist/{types → src}/lib/core/StacLayer.d.ts.map +1 -1
  48. package/dist/{types → src}/lib/core/types.d.ts +3 -1
  49. package/dist/{types → src}/lib/core/types.d.ts.map +1 -1
  50. package/dist/{types → src}/lib/utils/color.d.ts +8 -0
  51. package/dist/src/lib/utils/color.d.ts.map +1 -0
  52. package/dist/{types → src}/lib/utils/index.d.ts +1 -1
  53. package/dist/{types → src}/lib/utils/index.d.ts.map +1 -1
  54. package/dist/webimage-Bh2pNwjN.cjs +1 -0
  55. package/dist/webimage-rg-Z9Sbn.js +25 -0
  56. package/dist/zstd-B3Xa90HD.cjs +1 -0
  57. package/dist/zstd-BwwN0X3K.js +51 -0
  58. package/package.json +66 -53
  59. package/dist/ControlGrid-Bukna_at.cjs +0 -17062
  60. package/dist/DuckDBConverter-B98M0DFs.cjs +0 -23
  61. package/dist/DuckDBConverter-RPq48-t0.js +0 -434
  62. package/dist/ShapefileConverter-AjbEjEyq.cjs +0 -1
  63. package/dist/ShapefileConverter-trvt8J3z.js +0 -125
  64. package/dist/decoder-CLokFc0V.js +0 -8
  65. package/dist/decoder-D9LU4bUo.cjs +0 -1
  66. package/dist/deflate-Bay-vzHJ.cjs +0 -1
  67. package/dist/deflate-yeu3ogBn.js +0 -10
  68. package/dist/geojson-BQSVgKFt.cjs +0 -1
  69. package/dist/geojson-BSUuDj5k.js +0 -2551
  70. package/dist/geotiff-BNxc90fm.cjs +0 -8
  71. package/dist/geotiff-BUZniE5g.js +0 -3105
  72. package/dist/index-8ZZtuDTp.js +0 -705
  73. package/dist/index-DQXdX5y1.js +0 -4666
  74. package/dist/index-Dh1kpCb6.cjs +0 -1
  75. package/dist/index-IrsIiQNM.cjs +0 -4
  76. package/dist/jpeg-B7yImnpY.js +0 -533
  77. package/dist/jpeg-BiN8bMT5.cjs +0 -1
  78. package/dist/lerc-BvSjGMM2.cjs +0 -1
  79. package/dist/lerc-CqgA9njy.js +0 -1031
  80. package/dist/lzw-C-_B7Jis.cjs +0 -1
  81. package/dist/lzw-DL9RcHOz.js +0 -84
  82. package/dist/main-dist-Bymiy5aM.cjs +0 -2
  83. package/dist/main-dist-Cv8AKwrY.js +0 -629
  84. package/dist/maplibre-geoman.es-Bxdg-2EU.cjs +0 -129
  85. package/dist/maplibre-geoman.es-CFgM2ajb.js +0 -22827
  86. package/dist/packbits-DRGSjtn-.cjs +0 -1
  87. package/dist/packbits-YEJGULcy.js +0 -24
  88. package/dist/pako.esm-Bx5X36Wo.js +0 -1074
  89. package/dist/pako.esm-DZC2QrbJ.cjs +0 -1
  90. package/dist/raw-CoQHiEnn.js +0 -9
  91. package/dist/raw-D6OidBKc.cjs +0 -1
  92. package/dist/types/lib/core/SpinGlobeControl.d.ts.map +0 -1
  93. package/dist/types/lib/utils/color.d.ts.map +0 -1
  94. package/dist/webimage-BXLN-zu8.js +0 -19
  95. package/dist/webimage-mWTez3Wv.cjs +0 -1
  96. /package/dist/{types → src}/index.d.ts +0 -0
  97. /package/dist/{types → src}/index.d.ts.map +0 -0
  98. /package/dist/{types → src}/lib/adapters/AddVectorAdapter.d.ts +0 -0
  99. /package/dist/{types → src}/lib/adapters/AddVectorAdapter.d.ts.map +0 -0
  100. /package/dist/{types → src}/lib/adapters/CogLayerAdapter.d.ts +0 -0
  101. /package/dist/{types → src}/lib/adapters/CogLayerAdapter.d.ts.map +0 -0
  102. /package/dist/{types → src}/lib/adapters/PMTilesLayerAdapter.d.ts +0 -0
  103. /package/dist/{types → src}/lib/adapters/PMTilesLayerAdapter.d.ts.map +0 -0
  104. /package/dist/{types → src}/lib/adapters/StacLayerAdapter.d.ts +0 -0
  105. /package/dist/{types → src}/lib/adapters/StacLayerAdapter.d.ts.map +0 -0
  106. /package/dist/{types → src}/lib/adapters/ZarrLayerAdapter.d.ts +0 -0
  107. /package/dist/{types → src}/lib/adapters/ZarrLayerAdapter.d.ts.map +0 -0
  108. /package/dist/{types → src}/lib/adapters/index.d.ts +0 -0
  109. /package/dist/{types → src}/lib/adapters/index.d.ts.map +0 -0
  110. /package/dist/{types → src}/lib/addControlGrid.d.ts +0 -0
  111. /package/dist/{types → src}/lib/addControlGrid.d.ts.map +0 -0
  112. /package/dist/{types → src}/lib/colormaps/diverging.d.ts +0 -0
  113. /package/dist/{types → src}/lib/colormaps/diverging.d.ts.map +0 -0
  114. /package/dist/{types → src}/lib/colormaps/index.d.ts +0 -0
  115. /package/dist/{types → src}/lib/colormaps/index.d.ts.map +0 -0
  116. /package/dist/{types → src}/lib/colormaps/misc.d.ts +0 -0
  117. /package/dist/{types → src}/lib/colormaps/misc.d.ts.map +0 -0
  118. /package/dist/{types → src}/lib/colormaps/sequential.d.ts +0 -0
  119. /package/dist/{types → src}/lib/colormaps/sequential.d.ts.map +0 -0
  120. /package/dist/{types → src}/lib/converters/DuckDBConverter.d.ts +0 -0
  121. /package/dist/{types → src}/lib/converters/DuckDBConverter.d.ts.map +0 -0
  122. /package/dist/{types → src}/lib/converters/ShapefileConverter.d.ts +0 -0
  123. /package/dist/{types → src}/lib/converters/ShapefileConverter.d.ts.map +0 -0
  124. /package/dist/{types → src}/lib/converters/index.d.ts +0 -0
  125. /package/dist/{types → src}/lib/converters/index.d.ts.map +0 -0
  126. /package/dist/{types → src}/lib/converters/types.d.ts +0 -0
  127. /package/dist/{types → src}/lib/converters/types.d.ts.map +0 -0
  128. /package/dist/{types → src}/lib/core/AddVector.d.ts +0 -0
  129. /package/dist/{types → src}/lib/core/AddVector.d.ts.map +0 -0
  130. /package/dist/{types → src}/lib/core/Basemap.d.ts +0 -0
  131. /package/dist/{types → src}/lib/core/Basemap.d.ts.map +0 -0
  132. /package/dist/{types → src}/lib/core/BasemapReact.d.ts +0 -0
  133. /package/dist/{types → src}/lib/core/BasemapReact.d.ts.map +0 -0
  134. /package/dist/{types → src}/lib/core/BookmarkControl.d.ts +0 -0
  135. /package/dist/{types → src}/lib/core/BookmarkControl.d.ts.map +0 -0
  136. /package/dist/{types → src}/lib/core/ChoroplethControl.d.ts +0 -0
  137. /package/dist/{types → src}/lib/core/ChoroplethControl.d.ts.map +0 -0
  138. /package/dist/{types → src}/lib/core/CogLayer.d.ts +0 -0
  139. /package/dist/{types → src}/lib/core/CogLayerReact.d.ts +0 -0
  140. /package/dist/{types → src}/lib/core/CogLayerReact.d.ts.map +0 -0
  141. /package/dist/{types → src}/lib/core/Colorbar.d.ts +0 -0
  142. /package/dist/{types → src}/lib/core/Colorbar.d.ts.map +0 -0
  143. /package/dist/{types → src}/lib/core/ColorbarGuiControl.d.ts +0 -0
  144. /package/dist/{types → src}/lib/core/ColorbarGuiControl.d.ts.map +0 -0
  145. /package/dist/{types → src}/lib/core/ColorbarReact.d.ts +0 -0
  146. /package/dist/{types → src}/lib/core/ColorbarReact.d.ts.map +0 -0
  147. /package/dist/{types → src}/lib/core/ControlGrid.d.ts +0 -0
  148. /package/dist/{types → src}/lib/core/ControlGrid.d.ts.map +0 -0
  149. /package/dist/{types → src}/lib/core/ControlGridReact.d.ts +0 -0
  150. /package/dist/{types → src}/lib/core/ControlGridReact.d.ts.map +0 -0
  151. /package/dist/{types → src}/lib/core/HtmlControl.d.ts +0 -0
  152. /package/dist/{types → src}/lib/core/HtmlControl.d.ts.map +0 -0
  153. /package/dist/{types → src}/lib/core/HtmlControlReact.d.ts +0 -0
  154. /package/dist/{types → src}/lib/core/HtmlControlReact.d.ts.map +0 -0
  155. /package/dist/{types → src}/lib/core/HtmlGuiControl.d.ts +0 -0
  156. /package/dist/{types → src}/lib/core/HtmlGuiControl.d.ts.map +0 -0
  157. /package/dist/{types → src}/lib/core/InspectControl.d.ts +0 -0
  158. /package/dist/{types → src}/lib/core/InspectControl.d.ts.map +0 -0
  159. /package/dist/{types → src}/lib/core/InspectControlReact.d.ts +0 -0
  160. /package/dist/{types → src}/lib/core/InspectControlReact.d.ts.map +0 -0
  161. /package/dist/{types → src}/lib/core/Legend.d.ts +0 -0
  162. /package/dist/{types → src}/lib/core/Legend.d.ts.map +0 -0
  163. /package/dist/{types → src}/lib/core/LegendGuiControl.d.ts +0 -0
  164. /package/dist/{types → src}/lib/core/LegendGuiControl.d.ts.map +0 -0
  165. /package/dist/{types → src}/lib/core/LegendReact.d.ts +0 -0
  166. /package/dist/{types → src}/lib/core/LegendReact.d.ts.map +0 -0
  167. /package/dist/{types → src}/lib/core/MeasureControl.d.ts +0 -0
  168. /package/dist/{types → src}/lib/core/MeasureControl.d.ts.map +0 -0
  169. /package/dist/{types → src}/lib/core/MinimapControl.d.ts +0 -0
  170. /package/dist/{types → src}/lib/core/MinimapControl.d.ts.map +0 -0
  171. /package/dist/{types → src}/lib/core/MinimapControlReact.d.ts +0 -0
  172. /package/dist/{types → src}/lib/core/MinimapControlReact.d.ts.map +0 -0
  173. /package/dist/{types → src}/lib/core/PMTilesLayer.d.ts +0 -0
  174. /package/dist/{types → src}/lib/core/PrintControl.d.ts +0 -0
  175. /package/dist/{types → src}/lib/core/PrintControl.d.ts.map +0 -0
  176. /package/dist/{types → src}/lib/core/SearchControl.d.ts +0 -0
  177. /package/dist/{types → src}/lib/core/SearchControl.d.ts.map +0 -0
  178. /package/dist/{types → src}/lib/core/SearchControlReact.d.ts +0 -0
  179. /package/dist/{types → src}/lib/core/SearchControlReact.d.ts.map +0 -0
  180. /package/dist/{types → src}/lib/core/StacLayer.d.ts +0 -0
  181. /package/dist/{types → src}/lib/core/StacSearch.d.ts +0 -0
  182. /package/dist/{types → src}/lib/core/StacSearch.d.ts.map +0 -0
  183. /package/dist/{types → src}/lib/core/Terrain.d.ts +0 -0
  184. /package/dist/{types → src}/lib/core/Terrain.d.ts.map +0 -0
  185. /package/dist/{types → src}/lib/core/TerrainReact.d.ts +0 -0
  186. /package/dist/{types → src}/lib/core/TerrainReact.d.ts.map +0 -0
  187. /package/dist/{types → src}/lib/core/TileLayerControl.d.ts +0 -0
  188. /package/dist/{types → src}/lib/core/TileLayerControl.d.ts.map +0 -0
  189. /package/dist/{types → src}/lib/core/VectorDataset.d.ts +0 -0
  190. /package/dist/{types → src}/lib/core/VectorDataset.d.ts.map +0 -0
  191. /package/dist/{types → src}/lib/core/VectorDatasetReact.d.ts +0 -0
  192. /package/dist/{types → src}/lib/core/VectorDatasetReact.d.ts.map +0 -0
  193. /package/dist/{types → src}/lib/core/ViewStateControl.d.ts +0 -0
  194. /package/dist/{types → src}/lib/core/ViewStateControl.d.ts.map +0 -0
  195. /package/dist/{types → src}/lib/core/ViewStateControlReact.d.ts +0 -0
  196. /package/dist/{types → src}/lib/core/ViewStateControlReact.d.ts.map +0 -0
  197. /package/dist/{types → src}/lib/core/ZarrLayer.d.ts +0 -0
  198. /package/dist/{types → src}/lib/core/ZarrLayer.d.ts.map +0 -0
  199. /package/dist/{types → src}/lib/hooks/index.d.ts +0 -0
  200. /package/dist/{types → src}/lib/hooks/index.d.ts.map +0 -0
  201. /package/dist/{types → src}/lib/hooks/useBasemap.d.ts +0 -0
  202. /package/dist/{types → src}/lib/hooks/useBasemap.d.ts.map +0 -0
  203. /package/dist/{types → src}/lib/hooks/useCogLayer.d.ts +0 -0
  204. /package/dist/{types → src}/lib/hooks/useCogLayer.d.ts.map +0 -0
  205. /package/dist/{types → src}/lib/hooks/useColorbar.d.ts +0 -0
  206. /package/dist/{types → src}/lib/hooks/useColorbar.d.ts.map +0 -0
  207. /package/dist/{types → src}/lib/hooks/useControlGrid.d.ts +0 -0
  208. /package/dist/{types → src}/lib/hooks/useControlGrid.d.ts.map +0 -0
  209. /package/dist/{types → src}/lib/hooks/useHtmlControl.d.ts +0 -0
  210. /package/dist/{types → src}/lib/hooks/useHtmlControl.d.ts.map +0 -0
  211. /package/dist/{types → src}/lib/hooks/useInspectControl.d.ts +0 -0
  212. /package/dist/{types → src}/lib/hooks/useInspectControl.d.ts.map +0 -0
  213. /package/dist/{types → src}/lib/hooks/useLegend.d.ts +0 -0
  214. /package/dist/{types → src}/lib/hooks/useLegend.d.ts.map +0 -0
  215. /package/dist/{types → src}/lib/hooks/useMinimapControl.d.ts +0 -0
  216. /package/dist/{types → src}/lib/hooks/useMinimapControl.d.ts.map +0 -0
  217. /package/dist/{types → src}/lib/hooks/useSearchControl.d.ts +0 -0
  218. /package/dist/{types → src}/lib/hooks/useSearchControl.d.ts.map +0 -0
  219. /package/dist/{types → src}/lib/hooks/useTerrain.d.ts +0 -0
  220. /package/dist/{types → src}/lib/hooks/useTerrain.d.ts.map +0 -0
  221. /package/dist/{types → src}/lib/hooks/useVectorDataset.d.ts +0 -0
  222. /package/dist/{types → src}/lib/hooks/useVectorDataset.d.ts.map +0 -0
  223. /package/dist/{types → src}/lib/hooks/useViewState.d.ts +0 -0
  224. /package/dist/{types → src}/lib/hooks/useViewState.d.ts.map +0 -0
  225. /package/dist/{types → src}/lib/utils/fileHelpers.d.ts +0 -0
  226. /package/dist/{types → src}/lib/utils/fileHelpers.d.ts.map +0 -0
  227. /package/dist/{types → src}/lib/utils/helpers.d.ts +0 -0
  228. /package/dist/{types → src}/lib/utils/helpers.d.ts.map +0 -0
  229. /package/dist/{types → src}/lib/utils/providers.d.ts +0 -0
  230. /package/dist/{types → src}/lib/utils/providers.d.ts.map +0 -0
  231. /package/dist/{types → src}/react.d.ts +0 -0
  232. /package/dist/{types → src}/react.d.ts.map +0 -0
@@ -0,0 +1,4060 @@
1
+ function ti(t) {
2
+ t("EPSG:4326", "+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"), t("EPSG:4269", "+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"), t("EPSG:3857", "+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");
3
+ for (var a = 1; a <= 60; ++a)
4
+ t("EPSG:" + (32600 + a), "+proj=utm +zone=" + a + " +datum=WGS84 +units=m"), t("EPSG:" + (32700 + a), "+proj=utm +zone=" + a + " +south +datum=WGS84 +units=m");
5
+ t("EPSG:5041", "+title=WGS 84 / UPS North (E,N) +proj=stere +lat_0=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"), t("EPSG:5042", "+title=WGS 84 / UPS South (E,N) +proj=stere +lat_0=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"), t.WGS84 = t["EPSG:4326"], t["EPSG:3785"] = t["EPSG:3857"], t.GOOGLE = t["EPSG:3857"], t["EPSG:900913"] = t["EPSG:3857"], t["EPSG:102113"] = t["EPSG:3857"];
6
+ }
7
+ var ha = 6378137, ai = 6356752314e-3, na = 0.0066943799901413165, ct = 484813681109536e-20, M = Math.PI / 2, ii = 0.16666666666666666, si = 0.04722222222222222, ei = 0.022156084656084655, Na = 1e-10, I = 0.017453292519943295, z = 57.29577951308232, G = Math.PI / 4, dt = Math.PI * 2, R = 3.14159265359, k = {};
8
+ k.greenwich = 0;
9
+ k.lisbon = -9.131906111111;
10
+ k.paris = 2.337229166667;
11
+ k.bogota = -74.080916666667;
12
+ k.madrid = -3.687938888889;
13
+ k.rome = 12.452333333333;
14
+ k.bern = 7.439583333333;
15
+ k.jakarta = 106.807719444444;
16
+ k.ferro = -17.666666666667;
17
+ k.brussels = 4.367975;
18
+ k.stockholm = 18.058277777778;
19
+ k.athens = 23.7163375;
20
+ k.oslo = 10.722916666667;
21
+ var ri = {
22
+ mm: { to_meter: 1e-3 },
23
+ cm: { to_meter: 0.01 },
24
+ ft: { to_meter: 0.3048 },
25
+ "us-ft": { to_meter: 1200 / 3937 },
26
+ fath: { to_meter: 1.8288 },
27
+ kmi: { to_meter: 1852 },
28
+ "us-ch": { to_meter: 20.1168402336805 },
29
+ "us-mi": { to_meter: 1609.34721869444 },
30
+ km: { to_meter: 1e3 },
31
+ "ind-ft": { to_meter: 0.30479841 },
32
+ "ind-yd": { to_meter: 0.91439523 },
33
+ mi: { to_meter: 1609.344 },
34
+ yd: { to_meter: 0.9144 },
35
+ ch: { to_meter: 20.1168 },
36
+ link: { to_meter: 0.201168 },
37
+ dm: { to_meter: 0.1 },
38
+ in: { to_meter: 0.0254 },
39
+ "ind-ch": { to_meter: 20.11669506 },
40
+ "us-in": { to_meter: 0.025400050800101 },
41
+ "us-yd": { to_meter: 0.914401828803658 }
42
+ }, oa = /[\s_\-\/\(\)]/g;
43
+ function V(t, a) {
44
+ if (t[a]) return t[a];
45
+ for (var i = Object.keys(t), e = a.toLowerCase().replace(oa, ""), s = -1, r, n; ++s < i.length; )
46
+ if (r = i[s], n = r.toLowerCase().replace(oa, ""), n === e) return t[r];
47
+ }
48
+ function Wt(t) {
49
+ var a = {}, i = t.split("+").map(function(h) {
50
+ return h.trim();
51
+ }).filter(function(h) {
52
+ return h;
53
+ }).reduce(function(h, o) {
54
+ var f = o.split("=");
55
+ return f.push(!0), h[f[0].toLowerCase()] = f[1], h;
56
+ }, {}), e, s, r, n = {
57
+ proj: "projName",
58
+ datum: "datumCode",
59
+ rf: function(h) {
60
+ a.rf = parseFloat(h);
61
+ },
62
+ lat_0: function(h) {
63
+ a.lat0 = h * I;
64
+ },
65
+ lat_1: function(h) {
66
+ a.lat1 = h * I;
67
+ },
68
+ lat_2: function(h) {
69
+ a.lat2 = h * I;
70
+ },
71
+ lat_ts: function(h) {
72
+ a.lat_ts = h * I;
73
+ },
74
+ lon_0: function(h) {
75
+ a.long0 = h * I;
76
+ },
77
+ lon_1: function(h) {
78
+ a.long1 = h * I;
79
+ },
80
+ lon_2: function(h) {
81
+ a.long2 = h * I;
82
+ },
83
+ alpha: function(h) {
84
+ a.alpha = parseFloat(h) * I;
85
+ },
86
+ gamma: function(h) {
87
+ a.rectified_grid_angle = parseFloat(h) * I;
88
+ },
89
+ lonc: function(h) {
90
+ a.longc = h * I;
91
+ },
92
+ x_0: function(h) {
93
+ a.x0 = parseFloat(h);
94
+ },
95
+ y_0: function(h) {
96
+ a.y0 = parseFloat(h);
97
+ },
98
+ k_0: function(h) {
99
+ a.k0 = parseFloat(h);
100
+ },
101
+ k: function(h) {
102
+ a.k0 = parseFloat(h);
103
+ },
104
+ a: function(h) {
105
+ a.a = parseFloat(h);
106
+ },
107
+ b: function(h) {
108
+ a.b = parseFloat(h);
109
+ },
110
+ r: function(h) {
111
+ a.a = a.b = parseFloat(h);
112
+ },
113
+ r_a: function() {
114
+ a.R_A = !0;
115
+ },
116
+ zone: function(h) {
117
+ a.zone = parseInt(h, 10);
118
+ },
119
+ south: function() {
120
+ a.utmSouth = !0;
121
+ },
122
+ towgs84: function(h) {
123
+ a.datum_params = h.split(",").map(function(o) {
124
+ return parseFloat(o);
125
+ });
126
+ },
127
+ to_meter: function(h) {
128
+ a.to_meter = parseFloat(h);
129
+ },
130
+ units: function(h) {
131
+ a.units = h;
132
+ var o = V(ri, h);
133
+ o && (a.to_meter = o.to_meter);
134
+ },
135
+ from_greenwich: function(h) {
136
+ a.from_greenwich = h * I;
137
+ },
138
+ pm: function(h) {
139
+ var o = V(k, h);
140
+ a.from_greenwich = (o || parseFloat(h)) * I;
141
+ },
142
+ nadgrids: function(h) {
143
+ h === "@null" ? a.datumCode = "none" : a.nadgrids = h;
144
+ },
145
+ axis: function(h) {
146
+ var o = "ewnsud";
147
+ h.length === 3 && o.indexOf(h.substr(0, 1)) !== -1 && o.indexOf(h.substr(1, 1)) !== -1 && o.indexOf(h.substr(2, 1)) !== -1 && (a.axis = h);
148
+ },
149
+ approx: function() {
150
+ a.approx = !0;
151
+ },
152
+ over: function() {
153
+ a.over = !0;
154
+ }
155
+ };
156
+ for (e in i)
157
+ s = i[e], e in n ? (r = n[e], typeof r == "function" ? r(s) : a[r] = s) : a[e] = s;
158
+ return typeof a.datumCode == "string" && a.datumCode !== "WGS84" && (a.datumCode = a.datumCode.toLowerCase()), a.projStr = t, a;
159
+ }
160
+ var Ia = class {
161
+ static getId(t) {
162
+ const a = t.find((i) => Array.isArray(i) && i[0] === "ID");
163
+ return a && a.length >= 3 ? {
164
+ authority: a[1],
165
+ code: parseInt(a[2], 10)
166
+ } : null;
167
+ }
168
+ static convertUnit(t, a = "unit") {
169
+ if (!t || t.length < 3) return {
170
+ type: a,
171
+ name: "unknown",
172
+ conversion_factor: null
173
+ };
174
+ const i = t[1], e = parseFloat(t[2]) || null, s = t.find((r) => Array.isArray(r) && r[0] === "ID");
175
+ return {
176
+ type: a,
177
+ name: i,
178
+ conversion_factor: e,
179
+ id: s ? {
180
+ authority: s[1],
181
+ code: parseInt(s[2], 10)
182
+ } : null
183
+ };
184
+ }
185
+ static convertAxis(t) {
186
+ const a = t[1] || "Unknown";
187
+ let i;
188
+ const e = a.match(/^\((.)\)$/);
189
+ if (e) {
190
+ const o = e[1].toUpperCase();
191
+ if (o === "E") i = "east";
192
+ else if (o === "N") i = "north";
193
+ else if (o === "U") i = "up";
194
+ else if (t[2]) i = t[2];
195
+ else throw new Error(`Unknown axis abbreviation: ${o}`);
196
+ } else i = t[2] || "unknown";
197
+ const s = t.find((o) => Array.isArray(o) && o[0] === "ORDER"), r = s ? parseInt(s[1], 10) : null, n = t.find((o) => Array.isArray(o) && (o[0] === "LENGTHUNIT" || o[0] === "ANGLEUNIT" || o[0] === "SCALEUNIT")), h = this.convertUnit(n);
198
+ return {
199
+ name: a,
200
+ direction: i,
201
+ unit: h,
202
+ order: r
203
+ };
204
+ }
205
+ static extractAxes(t) {
206
+ return t.filter((a) => Array.isArray(a) && a[0] === "AXIS").map((a) => this.convertAxis(a)).sort((a, i) => (a.order || 0) - (i.order || 0));
207
+ }
208
+ static convert(t, a = {}) {
209
+ switch (t[0]) {
210
+ case "PROJCRS":
211
+ a.type = "ProjectedCRS", a.name = t[1], a.base_crs = t.find((l) => Array.isArray(l) && l[0] === "BASEGEOGCRS") ? this.convert(t.find((l) => Array.isArray(l) && l[0] === "BASEGEOGCRS")) : null, a.conversion = t.find((l) => Array.isArray(l) && l[0] === "CONVERSION") ? this.convert(t.find((l) => Array.isArray(l) && l[0] === "CONVERSION")) : null;
212
+ const i = t.find((l) => Array.isArray(l) && l[0] === "CS");
213
+ i && (a.coordinate_system = {
214
+ type: i[1],
215
+ axis: this.extractAxes(t)
216
+ });
217
+ const e = t.find((l) => Array.isArray(l) && l[0] === "LENGTHUNIT");
218
+ if (e) {
219
+ const l = this.convertUnit(e);
220
+ a.coordinate_system.unit = l;
221
+ }
222
+ a.id = this.getId(t);
223
+ break;
224
+ case "BASEGEOGCRS":
225
+ case "GEOGCRS":
226
+ case "GEODCRS":
227
+ a.type = t[0] === "GEODCRS" ? "GeodeticCRS" : "GeographicCRS", a.name = t[1];
228
+ const s = t.find((l) => Array.isArray(l) && (l[0] === "DATUM" || l[0] === "ENSEMBLE"));
229
+ if (s) {
230
+ const l = this.convert(s);
231
+ s[0] === "ENSEMBLE" ? a.datum_ensemble = l : a.datum = l;
232
+ const c = t.find((v) => Array.isArray(v) && v[0] === "PRIMEM");
233
+ c && c[1] !== "Greenwich" && (l.prime_meridian = {
234
+ name: c[1],
235
+ longitude: parseFloat(c[2])
236
+ });
237
+ }
238
+ a.coordinate_system = {
239
+ type: "ellipsoidal",
240
+ axis: this.extractAxes(t)
241
+ }, a.id = this.getId(t);
242
+ break;
243
+ case "DATUM":
244
+ a.type = "GeodeticReferenceFrame", a.name = t[1], a.ellipsoid = t.find((l) => Array.isArray(l) && l[0] === "ELLIPSOID") ? this.convert(t.find((l) => Array.isArray(l) && l[0] === "ELLIPSOID")) : null;
245
+ break;
246
+ case "ENSEMBLE":
247
+ a.type = "DatumEnsemble", a.name = t[1], a.members = t.filter((l) => Array.isArray(l) && l[0] === "MEMBER").map((l) => ({
248
+ type: "DatumEnsembleMember",
249
+ name: l[1],
250
+ id: this.getId(l)
251
+ }));
252
+ const r = t.find((l) => Array.isArray(l) && l[0] === "ENSEMBLEACCURACY");
253
+ r && (a.accuracy = parseFloat(r[1]));
254
+ const n = t.find((l) => Array.isArray(l) && l[0] === "ELLIPSOID");
255
+ n && (a.ellipsoid = this.convert(n)), a.id = this.getId(t);
256
+ break;
257
+ case "ELLIPSOID":
258
+ a.type = "Ellipsoid", a.name = t[1], a.semi_major_axis = parseFloat(t[2]), a.inverse_flattening = parseFloat(t[3]), t.find((l) => Array.isArray(l) && l[0] === "LENGTHUNIT") && this.convert(t.find((l) => Array.isArray(l) && l[0] === "LENGTHUNIT"), a);
259
+ break;
260
+ case "CONVERSION":
261
+ a.type = "Conversion", a.name = t[1], a.method = t.find((l) => Array.isArray(l) && l[0] === "METHOD") ? this.convert(t.find((l) => Array.isArray(l) && l[0] === "METHOD")) : null, a.parameters = t.filter((l) => Array.isArray(l) && l[0] === "PARAMETER").map((l) => this.convert(l));
262
+ break;
263
+ case "METHOD":
264
+ a.type = "Method", a.name = t[1], a.id = this.getId(t);
265
+ break;
266
+ case "PARAMETER":
267
+ a.type = "Parameter", a.name = t[1], a.value = parseFloat(t[2]), a.unit = this.convertUnit(t.find((l) => Array.isArray(l) && (l[0] === "LENGTHUNIT" || l[0] === "ANGLEUNIT" || l[0] === "SCALEUNIT"))), a.id = this.getId(t);
268
+ break;
269
+ case "BOUNDCRS":
270
+ a.type = "BoundCRS";
271
+ const h = t.find((l) => Array.isArray(l) && l[0] === "SOURCECRS");
272
+ if (h) {
273
+ const l = h.find((c) => Array.isArray(c));
274
+ a.source_crs = l ? this.convert(l) : null;
275
+ }
276
+ const o = t.find((l) => Array.isArray(l) && l[0] === "TARGETCRS");
277
+ if (o) {
278
+ const l = o.find((c) => Array.isArray(c));
279
+ a.target_crs = l ? this.convert(l) : null;
280
+ }
281
+ const f = t.find((l) => Array.isArray(l) && l[0] === "ABRIDGEDTRANSFORMATION");
282
+ f ? a.transformation = this.convert(f) : a.transformation = null;
283
+ break;
284
+ case "ABRIDGEDTRANSFORMATION":
285
+ if (a.type = "Transformation", a.name = t[1], a.method = t.find((l) => Array.isArray(l) && l[0] === "METHOD") ? this.convert(t.find((l) => Array.isArray(l) && l[0] === "METHOD")) : null, a.parameters = t.filter((l) => Array.isArray(l) && (l[0] === "PARAMETER" || l[0] === "PARAMETERFILE")).map((l) => {
286
+ if (l[0] === "PARAMETER") return this.convert(l);
287
+ if (l[0] === "PARAMETERFILE") return {
288
+ name: l[1],
289
+ value: l[2],
290
+ id: {
291
+ authority: "EPSG",
292
+ code: 8656
293
+ }
294
+ };
295
+ }), a.parameters.length === 7) {
296
+ const l = a.parameters[6];
297
+ l.name === "Scale difference" && (l.value = Math.round((l.value - 1) * 1e12) / 1e6);
298
+ }
299
+ a.id = this.getId(t);
300
+ break;
301
+ case "AXIS":
302
+ a.coordinate_system || (a.coordinate_system = {
303
+ type: "unspecified",
304
+ axis: []
305
+ }), a.coordinate_system.axis.push(this.convertAxis(t));
306
+ break;
307
+ case "LENGTHUNIT":
308
+ const _ = this.convertUnit(t, "LinearUnit");
309
+ a.coordinate_system && a.coordinate_system.axis && a.coordinate_system.axis.forEach((l) => {
310
+ l.unit || (l.unit = _);
311
+ }), _.conversion_factor && _.conversion_factor !== 1 && a.semi_major_axis && (a.semi_major_axis = {
312
+ value: a.semi_major_axis,
313
+ unit: _
314
+ });
315
+ break;
316
+ default:
317
+ a.keyword = t[0];
318
+ break;
319
+ }
320
+ return a;
321
+ }
322
+ }, hi = class extends Ia {
323
+ static convert(t, a = {}) {
324
+ return super.convert(t, a), a.coordinate_system && a.coordinate_system.subtype === "Cartesian" && delete a.coordinate_system, a.usage && delete a.usage, a;
325
+ }
326
+ }, ni = class extends Ia {
327
+ static convert(t, a = {}) {
328
+ super.convert(t, a);
329
+ const i = t.find((s) => Array.isArray(s) && s[0] === "CS");
330
+ i && (a.coordinate_system = {
331
+ subtype: i[1],
332
+ axis: this.extractAxes(t)
333
+ });
334
+ const e = t.find((s) => Array.isArray(s) && s[0] === "USAGE");
335
+ if (e) {
336
+ const s = e.find((h) => Array.isArray(h) && h[0] === "SCOPE"), r = e.find((h) => Array.isArray(h) && h[0] === "AREA"), n = e.find((h) => Array.isArray(h) && h[0] === "BBOX");
337
+ a.usage = {}, s && (a.usage.scope = s[1]), r && (a.usage.area = r[1]), n && (a.usage.bbox = n.slice(1));
338
+ }
339
+ return a;
340
+ }
341
+ };
342
+ function oi(t) {
343
+ return t.find((a) => Array.isArray(a) && a[0] === "USAGE") ? "2019" : (t.find((a) => Array.isArray(a) && a[0] === "CS") || t[0] === "BOUNDCRS" || t[0] === "PROJCRS" || t[0] === "GEOGCRS", "2015");
344
+ }
345
+ function li(t) {
346
+ return (oi(t) === "2019" ? ni : hi).convert(t);
347
+ }
348
+ function fi(t) {
349
+ const a = t.toUpperCase();
350
+ return a.includes("PROJCRS") || a.includes("GEOGCRS") || a.includes("BOUNDCRS") || a.includes("VERTCRS") || a.includes("LENGTHUNIT") || a.includes("ANGLEUNIT") || a.includes("SCALEUNIT") ? "WKT2" : (a.includes("PROJCS") || a.includes("GEOGCS") || a.includes("LOCAL_CS") || a.includes("VERT_CS") || a.includes("UNIT"), "WKT1");
351
+ }
352
+ var _i = Mi, mt = 1, Ca = 2, Ra = 3, Ot = 4, Oa = 5, Kt = -1, ci = /\s/, ui = /[A-Za-z]/, vi = /[A-Za-z84_]/, Ft = /[,\]]/, Ta = /[\d\.E\-\+]/;
353
+ function Q(t) {
354
+ if (typeof t != "string") throw new Error("not a string");
355
+ this.text = t.trim(), this.level = 0, this.place = 0, this.root = null, this.stack = [], this.currentObject = null, this.state = mt;
356
+ }
357
+ Q.prototype.readCharicter = function() {
358
+ var t = this.text[this.place++];
359
+ if (this.state !== Ot) for (; ci.test(t); ) {
360
+ if (this.place >= this.text.length) return;
361
+ t = this.text[this.place++];
362
+ }
363
+ switch (this.state) {
364
+ case mt:
365
+ return this.neutral(t);
366
+ case Ca:
367
+ return this.keyword(t);
368
+ case Ot:
369
+ return this.quoted(t);
370
+ case Oa:
371
+ return this.afterquote(t);
372
+ case Ra:
373
+ return this.number(t);
374
+ case Kt:
375
+ return;
376
+ }
377
+ };
378
+ Q.prototype.afterquote = function(t) {
379
+ if (t === '"') {
380
+ this.word += '"', this.state = Ot;
381
+ return;
382
+ }
383
+ if (Ft.test(t)) {
384
+ this.word = this.word.trim(), this.afterItem(t);
385
+ return;
386
+ }
387
+ throw new Error(`havn't handled "` + t + '" in afterquote yet, index ' + this.place);
388
+ };
389
+ Q.prototype.afterItem = function(t) {
390
+ if (t === ",") {
391
+ this.word !== null && this.currentObject.push(this.word), this.word = null, this.state = mt;
392
+ return;
393
+ }
394
+ if (t === "]") {
395
+ this.level--, this.word !== null && (this.currentObject.push(this.word), this.word = null), this.state = mt, this.currentObject = this.stack.pop(), this.currentObject || (this.state = Kt);
396
+ return;
397
+ }
398
+ };
399
+ Q.prototype.number = function(t) {
400
+ if (Ta.test(t)) {
401
+ this.word += t;
402
+ return;
403
+ }
404
+ if (Ft.test(t)) {
405
+ this.word = parseFloat(this.word), this.afterItem(t);
406
+ return;
407
+ }
408
+ throw new Error(`havn't handled "` + t + '" in number yet, index ' + this.place);
409
+ };
410
+ Q.prototype.quoted = function(t) {
411
+ if (t === '"') {
412
+ this.state = Oa;
413
+ return;
414
+ }
415
+ this.word += t;
416
+ };
417
+ Q.prototype.keyword = function(t) {
418
+ if (vi.test(t)) {
419
+ this.word += t;
420
+ return;
421
+ }
422
+ if (t === "[") {
423
+ var a = [];
424
+ a.push(this.word), this.level++, this.root === null ? this.root = a : this.currentObject.push(a), this.stack.push(this.currentObject), this.currentObject = a, this.state = mt;
425
+ return;
426
+ }
427
+ if (Ft.test(t)) {
428
+ this.afterItem(t);
429
+ return;
430
+ }
431
+ throw new Error(`havn't handled "` + t + '" in keyword yet, index ' + this.place);
432
+ };
433
+ Q.prototype.neutral = function(t) {
434
+ if (ui.test(t)) {
435
+ this.word = t, this.state = Ca;
436
+ return;
437
+ }
438
+ if (t === '"') {
439
+ this.word = "", this.state = Ot;
440
+ return;
441
+ }
442
+ if (Ta.test(t)) {
443
+ this.word = t, this.state = Ra;
444
+ return;
445
+ }
446
+ if (Ft.test(t)) {
447
+ this.afterItem(t);
448
+ return;
449
+ }
450
+ throw new Error(`havn't handled "` + t + '" in neutral yet, index ' + this.place);
451
+ };
452
+ Q.prototype.output = function() {
453
+ for (; this.place < this.text.length; ) this.readCharicter();
454
+ if (this.state === Kt) return this.root;
455
+ throw new Error('unable to parse string "' + this.text + '". State is ' + this.state);
456
+ };
457
+ function Mi(t) {
458
+ return new Q(t).output();
459
+ }
460
+ function Dt(t, a, i) {
461
+ Array.isArray(a) && (i.unshift(a), a = null);
462
+ var e = a ? {} : t, s = i.reduce(function(r, n) {
463
+ return at(n, r), r;
464
+ }, e);
465
+ a && (t[a] = s);
466
+ }
467
+ function at(t, a) {
468
+ if (!Array.isArray(t)) {
469
+ a[t] = !0;
470
+ return;
471
+ }
472
+ var i = t.shift();
473
+ if (i === "PARAMETER" && (i = t.shift()), t.length === 1) {
474
+ if (Array.isArray(t[0])) {
475
+ a[i] = {}, at(t[0], a[i]);
476
+ return;
477
+ }
478
+ a[i] = t[0];
479
+ return;
480
+ }
481
+ if (!t.length) {
482
+ a[i] = !0;
483
+ return;
484
+ }
485
+ if (i === "TOWGS84") {
486
+ a[i] = t;
487
+ return;
488
+ }
489
+ if (i === "AXIS") {
490
+ i in a || (a[i] = []), a[i].push(t);
491
+ return;
492
+ }
493
+ Array.isArray(i) || (a[i] = {});
494
+ var e;
495
+ switch (i) {
496
+ case "UNIT":
497
+ case "PRIMEM":
498
+ case "VERT_DATUM":
499
+ a[i] = {
500
+ name: t[0].toLowerCase(),
501
+ convert: t[1]
502
+ }, t.length === 3 && at(t[2], a[i]);
503
+ return;
504
+ case "SPHEROID":
505
+ case "ELLIPSOID":
506
+ a[i] = {
507
+ name: t[0],
508
+ a: t[1],
509
+ rf: t[2]
510
+ }, t.length === 4 && at(t[3], a[i]);
511
+ return;
512
+ case "EDATUM":
513
+ case "ENGINEERINGDATUM":
514
+ case "LOCAL_DATUM":
515
+ case "DATUM":
516
+ case "VERT_CS":
517
+ case "VERTCRS":
518
+ case "VERTICALCRS":
519
+ t[0] = ["name", t[0]], Dt(a, i, t);
520
+ return;
521
+ case "COMPD_CS":
522
+ case "COMPOUNDCRS":
523
+ case "FITTED_CS":
524
+ case "PROJECTEDCRS":
525
+ case "PROJCRS":
526
+ case "GEOGCS":
527
+ case "GEOCCS":
528
+ case "PROJCS":
529
+ case "LOCAL_CS":
530
+ case "GEODCRS":
531
+ case "GEODETICCRS":
532
+ case "GEODETICDATUM":
533
+ case "ENGCRS":
534
+ case "ENGINEERINGCRS":
535
+ t[0] = ["name", t[0]], Dt(a, i, t), a[i].type = i;
536
+ return;
537
+ default:
538
+ for (e = -1; ++e < t.length; ) if (!Array.isArray(t[e])) return at(t, a[i]);
539
+ return Dt(a, i, t);
540
+ }
541
+ }
542
+ var gi = 0.017453292519943295;
543
+ function $(t) {
544
+ return t * gi;
545
+ }
546
+ function pa(t) {
547
+ const a = (t.projName || "").toLowerCase().replace(/_/g, " ");
548
+ t.long0 === void 0 && t.longc !== void 0 && (t.long0 = t.longc), !t.lat_ts && t.lat1 && (a === "stereographic south pole" || a === "polar stereographic (variant b)") ? (t.lat0 = $(t.lat1 > 0 ? 90 : -90), t.lat_ts = t.lat1, delete t.lat1) : !t.lat_ts && t.lat0 && (a === "polar stereographic" || a === "polar stereographic (variant a)") && (t.lat_ts = t.lat0, t.lat0 = $(t.lat0 > 0 ? 90 : -90), delete t.lat1);
549
+ }
550
+ function la(t) {
551
+ let a = {
552
+ units: null,
553
+ to_meter: void 0
554
+ };
555
+ return typeof t == "string" ? (a.units = t.toLowerCase(), a.units === "metre" && (a.units = "meter"), a.units === "meter" && (a.to_meter = 1)) : t && t.name && (a.units = t.name.toLowerCase(), a.units === "metre" && (a.units = "meter"), a.to_meter = t.conversion_factor), a;
556
+ }
557
+ function fa(t) {
558
+ return typeof t == "object" ? t.value * t.unit.conversion_factor : t;
559
+ }
560
+ function _a(t, a) {
561
+ t.ellipsoid.radius ? (a.a = t.ellipsoid.radius, a.rf = 0) : (a.a = fa(t.ellipsoid.semi_major_axis), t.ellipsoid.inverse_flattening !== void 0 ? a.rf = t.ellipsoid.inverse_flattening : t.ellipsoid.semi_major_axis !== void 0 && t.ellipsoid.semi_minor_axis !== void 0 && (a.rf = a.a / (a.a - fa(t.ellipsoid.semi_minor_axis))));
562
+ }
563
+ function Tt(t, a = {}) {
564
+ return !t || typeof t != "object" ? t : t.type === "BoundCRS" ? (Tt(t.source_crs, a), t.transformation && (t.transformation.method && t.transformation.method.name === "NTv2" ? a.nadgrids = t.transformation.parameters[0].value : a.datum_params = t.transformation.parameters.map((i) => i.value)), a) : (Object.keys(t).forEach((i) => {
565
+ const e = t[i];
566
+ if (e !== null)
567
+ switch (i) {
568
+ case "name":
569
+ if (a.srsCode) break;
570
+ a.name = e, a.srsCode = e;
571
+ break;
572
+ case "type":
573
+ e === "GeographicCRS" ? a.projName = "longlat" : e === "GeodeticCRS" ? t.coordinate_system && t.coordinate_system.subtype === "Cartesian" ? a.projName = "geocent" : a.projName = "longlat" : e === "ProjectedCRS" && t.conversion && t.conversion.method && (a.projName = t.conversion.method.name);
574
+ break;
575
+ case "datum":
576
+ case "datum_ensemble":
577
+ e.ellipsoid && (a.ellps = e.ellipsoid.name, _a(e, a)), e.prime_meridian && (a.from_greenwich = e.prime_meridian.longitude * Math.PI / 180);
578
+ break;
579
+ case "ellipsoid":
580
+ a.ellps = e.name, _a(e, a);
581
+ break;
582
+ case "prime_meridian":
583
+ a.long0 = (e.longitude || 0) * Math.PI / 180;
584
+ break;
585
+ case "coordinate_system":
586
+ if (e.axis) {
587
+ const s = {
588
+ east: "e",
589
+ north: "n",
590
+ west: "w",
591
+ south: "s",
592
+ up: "u",
593
+ down: "d",
594
+ geocentricx: "e",
595
+ geocentricy: "n",
596
+ geocentricz: "u"
597
+ }, r = e.axis.map((n) => s[n.direction.toLowerCase()]);
598
+ if (r.every(Boolean) && (a.axis = r.join(""), a.axis.length === 2 && (a.axis += "u")), e.unit) {
599
+ const { units: n, to_meter: h } = la(e.unit);
600
+ a.units = n, a.to_meter = h;
601
+ } else if (e.axis[0] && e.axis[0].unit) {
602
+ const { units: n, to_meter: h } = la(e.axis[0].unit);
603
+ a.units = n, a.to_meter = h;
604
+ }
605
+ }
606
+ break;
607
+ case "id":
608
+ e.authority && e.code && (a.title = e.authority + ":" + e.code);
609
+ break;
610
+ case "conversion":
611
+ e.method && e.method.name && (a.projName = e.method.name), e.parameters && e.parameters.forEach((s) => {
612
+ const r = s.name.toLowerCase().replace(/\s+/g, "_"), n = s.value;
613
+ s.unit && s.unit.conversion_factor ? a[r] = n * s.unit.conversion_factor : s.unit === "degree" ? a[r] = n * Math.PI / 180 : a[r] = n;
614
+ });
615
+ break;
616
+ case "unit":
617
+ e.name && (a.units = e.name.toLowerCase(), a.units === "metre" && (a.units = "meter")), e.conversion_factor && (a.to_meter = e.conversion_factor);
618
+ break;
619
+ case "base_crs":
620
+ Tt(e, a), a.datumCode = e.id ? e.id.authority + "_" + e.id.code : e.name;
621
+ break;
622
+ default:
623
+ break;
624
+ }
625
+ }), a.latitude_of_false_origin !== void 0 && (a.lat0 = a.latitude_of_false_origin), a.longitude_of_false_origin !== void 0 && (a.long0 = a.longitude_of_false_origin), a.latitude_of_standard_parallel !== void 0 && (a.lat0 = a.latitude_of_standard_parallel, a.lat1 = a.latitude_of_standard_parallel), a.latitude_of_1st_standard_parallel !== void 0 && (a.lat1 = a.latitude_of_1st_standard_parallel), a.latitude_of_2nd_standard_parallel !== void 0 && (a.lat2 = a.latitude_of_2nd_standard_parallel), a.latitude_of_projection_centre !== void 0 && (a.lat0 = a.latitude_of_projection_centre), a.longitude_of_projection_centre !== void 0 && (a.longc = a.longitude_of_projection_centre), a.easting_at_false_origin !== void 0 && (a.x0 = a.easting_at_false_origin), a.northing_at_false_origin !== void 0 && (a.y0 = a.northing_at_false_origin), a.latitude_of_natural_origin !== void 0 && (a.lat0 = a.latitude_of_natural_origin), a.longitude_of_natural_origin !== void 0 && (a.long0 = a.longitude_of_natural_origin), a.longitude_of_origin !== void 0 && (a.long0 = a.longitude_of_origin), a.false_easting !== void 0 && (a.x0 = a.false_easting), a.easting_at_projection_centre && (a.x0 = a.easting_at_projection_centre), a.false_northing !== void 0 && (a.y0 = a.false_northing), a.northing_at_projection_centre && (a.y0 = a.northing_at_projection_centre), a.standard_parallel_1 !== void 0 && (a.lat1 = a.standard_parallel_1), a.standard_parallel_2 !== void 0 && (a.lat2 = a.standard_parallel_2), a.scale_factor_at_natural_origin !== void 0 && (a.k0 = a.scale_factor_at_natural_origin), a.scale_factor_at_projection_centre !== void 0 && (a.k0 = a.scale_factor_at_projection_centre), a.scale_factor_on_pseudo_standard_parallel !== void 0 && (a.k0 = a.scale_factor_on_pseudo_standard_parallel), a.azimuth !== void 0 && (a.alpha = a.azimuth), a.azimuth_at_projection_centre !== void 0 && (a.alpha = a.azimuth_at_projection_centre), a.angle_from_rectified_to_skew_grid && (a.rectified_grid_angle = a.angle_from_rectified_to_skew_grid), pa(a), a);
626
+ }
627
+ var di = [
628
+ "PROJECTEDCRS",
629
+ "PROJCRS",
630
+ "GEOGCS",
631
+ "GEOCCS",
632
+ "PROJCS",
633
+ "LOCAL_CS",
634
+ "GEODCRS",
635
+ "GEODETICCRS",
636
+ "GEODETICDATUM",
637
+ "ENGCRS",
638
+ "ENGINEERINGCRS"
639
+ ];
640
+ function mi(t, a) {
641
+ var i = a[0], e = a[1];
642
+ !(i in t) && e in t && (t[i] = t[e], a.length === 3 && (t[i] = a[2](t[i])));
643
+ }
644
+ function La(t) {
645
+ for (var a = Object.keys(t), i = 0, e = a.length; i < e; ++i) {
646
+ var s = a[i];
647
+ di.indexOf(s) !== -1 && yi(t[s]), typeof t[s] == "object" && La(t[s]);
648
+ }
649
+ }
650
+ function yi(t) {
651
+ if (t.AUTHORITY) {
652
+ var a = Object.keys(t.AUTHORITY)[0];
653
+ a && a in t.AUTHORITY && (t.title = a + ":" + t.AUTHORITY[a]);
654
+ }
655
+ if (t.type === "GEOGCS" ? t.projName = "longlat" : t.type === "LOCAL_CS" ? (t.projName = "identity", t.local = !0) : typeof t.PROJECTION == "object" ? t.projName = Object.keys(t.PROJECTION)[0] : t.projName = t.PROJECTION, t.AXIS) {
656
+ for (var i = "", e = 0, s = t.AXIS.length; e < s; ++e) {
657
+ var r = [t.AXIS[e][0].toLowerCase(), t.AXIS[e][1].toLowerCase()];
658
+ r[0].indexOf("north") !== -1 || (r[0] === "y" || r[0] === "lat") && r[1] === "north" ? i += "n" : r[0].indexOf("south") !== -1 || (r[0] === "y" || r[0] === "lat") && r[1] === "south" ? i += "s" : r[0].indexOf("east") !== -1 || (r[0] === "x" || r[0] === "lon") && r[1] === "east" ? i += "e" : (r[0].indexOf("west") !== -1 || (r[0] === "x" || r[0] === "lon") && r[1] === "west") && (i += "w");
659
+ }
660
+ i.length === 2 && (i += "u"), i.length === 3 && (t.axis = i);
661
+ }
662
+ t.UNIT && (t.units = t.UNIT.name.toLowerCase(), t.units === "metre" && (t.units = "meter"), t.UNIT.convert && (t.type === "GEOGCS" ? t.DATUM && t.DATUM.SPHEROID && (t.to_meter = t.UNIT.convert * t.DATUM.SPHEROID.a) : t.to_meter = t.UNIT.convert));
663
+ var n = t.GEOGCS;
664
+ t.type === "GEOGCS" && (n = t), n && (n.PRIMEM && n.PRIMEM.convert && (t.from_greenwich = $(n.PRIMEM.convert)), n.DATUM ? t.datumCode = n.DATUM.name.toLowerCase() : t.datumCode = n.name.toLowerCase(), t.datumCode.slice(0, 2) === "d_" && (t.datumCode = t.datumCode.slice(2)), t.datumCode === "new_zealand_1949" && (t.datumCode = "nzgd49"), (t.datumCode === "wgs_1984" || t.datumCode === "world_geodetic_system_1984") && (t.PROJECTION === "Mercator_Auxiliary_Sphere" && (t.sphere = !0), t.datumCode = "wgs84"), t.datumCode === "belge_1972" && (t.datumCode = "rnb72"), n.DATUM && n.DATUM.SPHEROID && (t.ellps = n.DATUM.SPHEROID.name.replace("_19", "").replace(/[Cc]larke\_18/, "clrk"), t.ellps.toLowerCase().slice(0, 13) === "international" && (t.ellps = "intl"), t.a = n.DATUM.SPHEROID.a, t.rf = parseFloat(n.DATUM.SPHEROID.rf)), n.DATUM && n.DATUM.TOWGS84 && (t.datum_params = n.DATUM.TOWGS84), ~t.datumCode.indexOf("osgb_1936") && (t.datumCode = "osgb36"), ~t.datumCode.indexOf("osni_1952") && (t.datumCode = "osni52"), (~t.datumCode.indexOf("tm65") || ~t.datumCode.indexOf("geodetic_datum_of_1965")) && (t.datumCode = "ire65"), t.datumCode === "ch1903+" && (t.datumCode = "ch1903"), ~t.datumCode.indexOf("israel") && (t.datumCode = "isr93")), t.b && !isFinite(t.b) && (t.b = t.a), t.rectified_grid_angle && (t.rectified_grid_angle = $(t.rectified_grid_angle));
665
+ function h(f) {
666
+ return f * (t.to_meter || 1);
667
+ }
668
+ var o = function(f) {
669
+ return mi(t, f);
670
+ };
671
+ [
672
+ ["standard_parallel_1", "Standard_Parallel_1"],
673
+ ["standard_parallel_1", "Latitude of 1st standard parallel"],
674
+ ["standard_parallel_2", "Standard_Parallel_2"],
675
+ ["standard_parallel_2", "Latitude of 2nd standard parallel"],
676
+ ["false_easting", "False_Easting"],
677
+ ["false_easting", "False easting"],
678
+ ["false-easting", "Easting at false origin"],
679
+ ["false_northing", "False_Northing"],
680
+ ["false_northing", "False northing"],
681
+ ["false_northing", "Northing at false origin"],
682
+ ["central_meridian", "Central_Meridian"],
683
+ ["central_meridian", "Longitude of natural origin"],
684
+ ["central_meridian", "Longitude of false origin"],
685
+ ["latitude_of_origin", "Latitude_Of_Origin"],
686
+ ["latitude_of_origin", "Central_Parallel"],
687
+ ["latitude_of_origin", "Latitude of natural origin"],
688
+ ["latitude_of_origin", "Latitude of false origin"],
689
+ ["scale_factor", "Scale_Factor"],
690
+ ["k0", "scale_factor"],
691
+ ["latitude_of_center", "Latitude_Of_Center"],
692
+ ["latitude_of_center", "Latitude_of_center"],
693
+ [
694
+ "lat0",
695
+ "latitude_of_center",
696
+ $
697
+ ],
698
+ ["longitude_of_center", "Longitude_Of_Center"],
699
+ ["longitude_of_center", "Longitude_of_center"],
700
+ [
701
+ "longc",
702
+ "longitude_of_center",
703
+ $
704
+ ],
705
+ [
706
+ "x0",
707
+ "false_easting",
708
+ h
709
+ ],
710
+ [
711
+ "y0",
712
+ "false_northing",
713
+ h
714
+ ],
715
+ [
716
+ "long0",
717
+ "central_meridian",
718
+ $
719
+ ],
720
+ [
721
+ "lat0",
722
+ "latitude_of_origin",
723
+ $
724
+ ],
725
+ [
726
+ "lat0",
727
+ "standard_parallel_1",
728
+ $
729
+ ],
730
+ [
731
+ "lat1",
732
+ "standard_parallel_1",
733
+ $
734
+ ],
735
+ [
736
+ "lat2",
737
+ "standard_parallel_2",
738
+ $
739
+ ],
740
+ ["azimuth", "Azimuth"],
741
+ [
742
+ "alpha",
743
+ "azimuth",
744
+ $
745
+ ],
746
+ ["srsCode", "name"]
747
+ ].forEach(o), pa(t);
748
+ }
749
+ function pt(t) {
750
+ if (typeof t == "object") return Tt(t);
751
+ const a = fi(t);
752
+ var i = _i(t);
753
+ if (a === "WKT2") return Tt(li(i));
754
+ var e = i[0], s = {};
755
+ return at(i, s), La(s), s[e];
756
+ }
757
+ function O(t) {
758
+ var a = this;
759
+ if (arguments.length === 2) {
760
+ var i = arguments[1];
761
+ typeof i == "string" ? i.charAt(0) === "+" ? O[t] = Wt(arguments[1]) : O[t] = pt(arguments[1]) : i && typeof i == "object" && !("projName" in i) ? O[t] = pt(arguments[1]) : (O[t] = i, i || delete O[t]);
762
+ } else if (arguments.length === 1) {
763
+ if (Array.isArray(t)) return t.map(function(e) {
764
+ return Array.isArray(e) ? O.apply(a, e) : O(e);
765
+ });
766
+ if (typeof t == "string") {
767
+ if (t in O) return O[t];
768
+ } else "EPSG" in t ? O["EPSG:" + t.EPSG] = t : "ESRI" in t ? O["ESRI:" + t.ESRI] = t : "IAU2000" in t ? O["IAU2000:" + t.IAU2000] = t : console.log(t);
769
+ return;
770
+ }
771
+ }
772
+ ti(O);
773
+ function Ei(t) {
774
+ return typeof t == "string";
775
+ }
776
+ function Si(t) {
777
+ return t in O;
778
+ }
779
+ function wi(t) {
780
+ return t.indexOf("+") !== 0 && t.indexOf("[") !== -1 || typeof t == "object" && !("srsCode" in t);
781
+ }
782
+ var ca = [
783
+ "3857",
784
+ "900913",
785
+ "3785",
786
+ "102113"
787
+ ];
788
+ function Pi(t) {
789
+ if (t.title) return t.title.toLowerCase().indexOf("epsg:") === 0 && ca.indexOf(t.title.substr(5)) > -1;
790
+ var a = V(t, "authority");
791
+ if (a) {
792
+ var i = V(a, "epsg");
793
+ return i && ca.indexOf(i) > -1;
794
+ }
795
+ }
796
+ function Gi(t) {
797
+ var a = V(t, "extension");
798
+ if (a)
799
+ return V(a, "proj4");
800
+ }
801
+ function xi(t) {
802
+ return t[0] === "+";
803
+ }
804
+ function bi(t) {
805
+ let a;
806
+ if (Ei(t))
807
+ if (Si(t)) a = O[t];
808
+ else if (wi(t)) {
809
+ a = pt(t);
810
+ var i = Gi(a);
811
+ i && (a = Wt(i));
812
+ } else xi(t) && (a = Wt(t));
813
+ else "projName" in t ? a = t : a = pt(t);
814
+ return a && Pi(a) ? O["EPSG:3857"] : a;
815
+ }
816
+ function ua(t, a) {
817
+ t = t || {};
818
+ var i, e;
819
+ if (!a) return t;
820
+ for (e in a)
821
+ i = a[e], i !== void 0 && (t[e] = i);
822
+ return t;
823
+ }
824
+ function W(t, a, i) {
825
+ var e = t * a;
826
+ return i / Math.sqrt(1 - e * e);
827
+ }
828
+ function St(t) {
829
+ return t < 0 ? -1 : 1;
830
+ }
831
+ function m(t, a) {
832
+ return a || Math.abs(t) <= 3.14159265359 ? t : t - St(t) * dt;
833
+ }
834
+ function B(t, a, i) {
835
+ var e = t * i, s = 0.5 * t;
836
+ return e = Math.pow((1 - e) / (1 + e), s), Math.tan(0.5 * (M - a)) / e;
837
+ }
838
+ function yt(t, a) {
839
+ for (var i = 0.5 * t, e, s, r = M - 2 * Math.atan(a), n = 0; n <= 15; n++)
840
+ if (e = t * Math.sin(r), s = M - 2 * Math.atan(a * Math.pow((1 - e) / (1 + e), i)) - r, r += s, Math.abs(s) <= 1e-10) return r;
841
+ return -9999;
842
+ }
843
+ function Ai() {
844
+ var t = this.b / this.a;
845
+ this.es = 1 - t * t, "x0" in this || (this.x0 = 0), "y0" in this || (this.y0 = 0), this.e = Math.sqrt(this.es), this.lat_ts ? this.sphere ? this.k0 = Math.cos(this.lat_ts) : this.k0 = W(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)) : this.k0 || (this.k ? this.k0 = this.k : this.k0 = 1);
846
+ }
847
+ function Ni(t) {
848
+ var a = t.x, i = t.y;
849
+ if (i * 57.29577951308232 > 90 && i * 57.29577951308232 < -90 && a * 57.29577951308232 > 180 && a * 57.29577951308232 < -180) return null;
850
+ var e, s;
851
+ if (Math.abs(Math.abs(i) - M) <= 1e-10) return null;
852
+ if (this.sphere)
853
+ e = this.x0 + this.a * this.k0 * m(a - this.long0, this.over), s = this.y0 + this.a * this.k0 * Math.log(Math.tan(G + 0.5 * i));
854
+ else {
855
+ var r = Math.sin(i), n = B(this.e, i, r);
856
+ e = this.x0 + this.a * this.k0 * m(a - this.long0, this.over), s = this.y0 - this.a * this.k0 * Math.log(n);
857
+ }
858
+ return t.x = e, t.y = s, t;
859
+ }
860
+ function Ii(t) {
861
+ var a = t.x - this.x0, i = t.y - this.y0, e, s;
862
+ if (this.sphere) s = M - 2 * Math.atan(Math.exp(-i / (this.a * this.k0)));
863
+ else {
864
+ var r = Math.exp(-i / (this.a * this.k0));
865
+ if (s = yt(this.e, r), s === -9999) return null;
866
+ }
867
+ return e = m(this.long0 + a / (this.a * this.k0), this.over), t.x = e, t.y = s, t;
868
+ }
869
+ var Ci = [
870
+ "Mercator",
871
+ "Popular Visualisation Pseudo Mercator",
872
+ "Mercator_1SP",
873
+ "Mercator_Auxiliary_Sphere",
874
+ "Mercator_Variant_A",
875
+ "merc"
876
+ ], Ri = {
877
+ init: Ai,
878
+ forward: Ni,
879
+ inverse: Ii,
880
+ names: Ci
881
+ };
882
+ function Oi() {
883
+ }
884
+ function va(t) {
885
+ return t;
886
+ }
887
+ var qa = ["longlat", "identity"], Ti = {
888
+ init: Oi,
889
+ forward: va,
890
+ inverse: va,
891
+ names: qa
892
+ }, pi = [Ri, Ti], Y = {}, it = [];
893
+ function Ua(t, a) {
894
+ var i = it.length;
895
+ return t.names ? (it[i] = t, t.names.forEach(function(e) {
896
+ Y[e.toLowerCase()] = i;
897
+ }), this) : (console.log(a), !0);
898
+ }
899
+ function ka(t) {
900
+ return t.replace(/[-\(\)\s]+/g, " ").trim().replace(/ /g, "_");
901
+ }
902
+ function Li(t) {
903
+ if (!t) return !1;
904
+ var a = t.toLowerCase();
905
+ if (typeof Y[a] < "u" && it[Y[a]] || (a = ka(a), a in Y && it[Y[a]])) return it[Y[a]];
906
+ }
907
+ function qi() {
908
+ pi.forEach(Ua);
909
+ }
910
+ var Ui = {
911
+ start: qi,
912
+ add: Ua,
913
+ get: Li
914
+ }, $a = {
915
+ MERIT: {
916
+ a: 6378137,
917
+ rf: 298.257,
918
+ ellipseName: "MERIT 1983"
919
+ },
920
+ SGS85: {
921
+ a: 6378136,
922
+ rf: 298.257,
923
+ ellipseName: "Soviet Geodetic System 85"
924
+ },
925
+ GRS80: {
926
+ a: 6378137,
927
+ rf: 298.257222101,
928
+ ellipseName: "GRS 1980(IUGG, 1980)"
929
+ },
930
+ IAU76: {
931
+ a: 6378140,
932
+ rf: 298.257,
933
+ ellipseName: "IAU 1976"
934
+ },
935
+ airy: {
936
+ a: 6377563396e-3,
937
+ b: 635625691e-2,
938
+ ellipseName: "Airy 1830"
939
+ },
940
+ APL4: {
941
+ a: 6378137,
942
+ rf: 298.25,
943
+ ellipseName: "Appl. Physics. 1965"
944
+ },
945
+ NWL9D: {
946
+ a: 6378145,
947
+ rf: 298.25,
948
+ ellipseName: "Naval Weapons Lab., 1965"
949
+ },
950
+ mod_airy: {
951
+ a: 6377340189e-3,
952
+ b: 6356034446e-3,
953
+ ellipseName: "Modified Airy"
954
+ },
955
+ andrae: {
956
+ a: 637710443e-2,
957
+ rf: 300,
958
+ ellipseName: "Andrae 1876 (Den., Iclnd.)"
959
+ },
960
+ aust_SA: {
961
+ a: 6378160,
962
+ rf: 298.25,
963
+ ellipseName: "Australian Natl & S. Amer. 1969"
964
+ },
965
+ GRS67: {
966
+ a: 6378160,
967
+ rf: 298.247167427,
968
+ ellipseName: "GRS 67(IUGG 1967)"
969
+ },
970
+ bessel: {
971
+ a: 6377397155e-3,
972
+ rf: 299.1528128,
973
+ ellipseName: "Bessel 1841"
974
+ },
975
+ bess_nam: {
976
+ a: 6377483865e-3,
977
+ rf: 299.1528128,
978
+ ellipseName: "Bessel 1841 (Namibia)"
979
+ },
980
+ clrk66: {
981
+ a: 63782064e-1,
982
+ b: 63565838e-1,
983
+ ellipseName: "Clarke 1866"
984
+ },
985
+ clrk80: {
986
+ a: 6378249145e-3,
987
+ rf: 293.4663,
988
+ ellipseName: "Clarke 1880 mod."
989
+ },
990
+ clrk80ign: {
991
+ a: 63782492e-1,
992
+ b: 6356515,
993
+ rf: 293.4660213,
994
+ ellipseName: "Clarke 1880 (IGN)"
995
+ },
996
+ clrk58: {
997
+ a: 6378293645208759e-9,
998
+ rf: 294.2606763692654,
999
+ ellipseName: "Clarke 1858"
1000
+ },
1001
+ CPM: {
1002
+ a: 63757387e-1,
1003
+ rf: 334.29,
1004
+ ellipseName: "Comm. des Poids et Mesures 1799"
1005
+ },
1006
+ delmbr: {
1007
+ a: 6376428,
1008
+ rf: 311.5,
1009
+ ellipseName: "Delambre 1810 (Belgium)"
1010
+ },
1011
+ engelis: {
1012
+ a: 637813605e-2,
1013
+ rf: 298.2566,
1014
+ ellipseName: "Engelis 1985"
1015
+ },
1016
+ evrst30: {
1017
+ a: 6377276345e-3,
1018
+ rf: 300.8017,
1019
+ ellipseName: "Everest 1830"
1020
+ },
1021
+ evrst48: {
1022
+ a: 6377304063e-3,
1023
+ rf: 300.8017,
1024
+ ellipseName: "Everest 1948"
1025
+ },
1026
+ evrst56: {
1027
+ a: 6377301243e-3,
1028
+ rf: 300.8017,
1029
+ ellipseName: "Everest 1956"
1030
+ },
1031
+ evrst69: {
1032
+ a: 6377295664e-3,
1033
+ rf: 300.8017,
1034
+ ellipseName: "Everest 1969"
1035
+ },
1036
+ evrstSS: {
1037
+ a: 6377298556e-3,
1038
+ rf: 300.8017,
1039
+ ellipseName: "Everest (Sabah & Sarawak)"
1040
+ },
1041
+ fschr60: {
1042
+ a: 6378166,
1043
+ rf: 298.3,
1044
+ ellipseName: "Fischer (Mercury Datum) 1960"
1045
+ },
1046
+ fschr60m: {
1047
+ a: 6378155,
1048
+ rf: 298.3,
1049
+ ellipseName: "Fischer 1960"
1050
+ },
1051
+ fschr68: {
1052
+ a: 6378150,
1053
+ rf: 298.3,
1054
+ ellipseName: "Fischer 1968"
1055
+ },
1056
+ helmert: {
1057
+ a: 6378200,
1058
+ rf: 298.3,
1059
+ ellipseName: "Helmert 1906"
1060
+ },
1061
+ hough: {
1062
+ a: 6378270,
1063
+ rf: 297,
1064
+ ellipseName: "Hough"
1065
+ },
1066
+ intl: {
1067
+ a: 6378388,
1068
+ rf: 297,
1069
+ ellipseName: "International 1909 (Hayford)"
1070
+ },
1071
+ kaula: {
1072
+ a: 6378163,
1073
+ rf: 298.24,
1074
+ ellipseName: "Kaula 1961"
1075
+ },
1076
+ lerch: {
1077
+ a: 6378139,
1078
+ rf: 298.257,
1079
+ ellipseName: "Lerch 1979"
1080
+ },
1081
+ mprts: {
1082
+ a: 6397300,
1083
+ rf: 191,
1084
+ ellipseName: "Maupertius 1738"
1085
+ },
1086
+ new_intl: {
1087
+ a: 63781575e-1,
1088
+ b: 63567722e-1,
1089
+ ellipseName: "New International 1967"
1090
+ },
1091
+ plessis: {
1092
+ a: 6376523,
1093
+ rf: 6355863,
1094
+ ellipseName: "Plessis 1817 (France)"
1095
+ },
1096
+ krass: {
1097
+ a: 6378245,
1098
+ rf: 298.3,
1099
+ ellipseName: "Krassovsky, 1942"
1100
+ },
1101
+ SEasia: {
1102
+ a: 6378155,
1103
+ b: 63567733205e-4,
1104
+ ellipseName: "Southeast Asia"
1105
+ },
1106
+ walbeck: {
1107
+ a: 6376896,
1108
+ b: 63558348467e-4,
1109
+ ellipseName: "Walbeck"
1110
+ },
1111
+ WGS60: {
1112
+ a: 6378165,
1113
+ rf: 298.3,
1114
+ ellipseName: "WGS 60"
1115
+ },
1116
+ WGS66: {
1117
+ a: 6378145,
1118
+ rf: 298.25,
1119
+ ellipseName: "WGS 66"
1120
+ },
1121
+ WGS7: {
1122
+ a: 6378135,
1123
+ rf: 298.26,
1124
+ ellipseName: "WGS 72"
1125
+ },
1126
+ WGS84: {
1127
+ a: 6378137,
1128
+ rf: 298.257223563,
1129
+ ellipseName: "WGS 84"
1130
+ },
1131
+ sphere: {
1132
+ a: 6370997,
1133
+ b: 6370997,
1134
+ ellipseName: "Normal Sphere (r=6370997)"
1135
+ }
1136
+ }, ki = $a.WGS84;
1137
+ function $i(t, a, i, e) {
1138
+ var s = t * t, r = a * a, n = (s - r) / s, h = 0;
1139
+ e ? (t *= 1 - n * (ii + n * (si + n * ei)), s = t * t, n = 0) : h = Math.sqrt(n);
1140
+ var o = (s - r) / r;
1141
+ return {
1142
+ es: n,
1143
+ e: h,
1144
+ ep2: o
1145
+ };
1146
+ }
1147
+ function Fi(t, a, i, e, s) {
1148
+ if (!t) {
1149
+ var r = V($a, e);
1150
+ r || (r = ki), t = r.a, a = r.b, i = r.rf;
1151
+ }
1152
+ return i && !a && (a = (1 - 1 / i) * t), (i === 0 || Math.abs(t - a) < 1e-10) && (s = !0, a = t), {
1153
+ a: t,
1154
+ b: a,
1155
+ rf: i,
1156
+ sphere: s
1157
+ };
1158
+ }
1159
+ var It = {
1160
+ wgs84: {
1161
+ towgs84: "0,0,0",
1162
+ ellipse: "WGS84",
1163
+ datumName: "WGS84"
1164
+ },
1165
+ ch1903: {
1166
+ towgs84: "674.374,15.056,405.346",
1167
+ ellipse: "bessel",
1168
+ datumName: "swiss"
1169
+ },
1170
+ ggrs87: {
1171
+ towgs84: "-199.87,74.79,246.62",
1172
+ ellipse: "GRS80",
1173
+ datumName: "Greek_Geodetic_Reference_System_1987"
1174
+ },
1175
+ nad83: {
1176
+ towgs84: "0,0,0",
1177
+ ellipse: "GRS80",
1178
+ datumName: "North_American_Datum_1983"
1179
+ },
1180
+ nad27: {
1181
+ nadgrids: "@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",
1182
+ ellipse: "clrk66",
1183
+ datumName: "North_American_Datum_1927"
1184
+ },
1185
+ potsdam: {
1186
+ towgs84: "598.1,73.7,418.2,0.202,0.045,-2.455,6.7",
1187
+ ellipse: "bessel",
1188
+ datumName: "Potsdam Rauenberg 1950 DHDN"
1189
+ },
1190
+ carthage: {
1191
+ towgs84: "-263.0,6.0,431.0",
1192
+ ellipse: "clark80",
1193
+ datumName: "Carthage 1934 Tunisia"
1194
+ },
1195
+ hermannskogel: {
1196
+ towgs84: "577.326,90.129,463.919,5.137,1.474,5.297,2.4232",
1197
+ ellipse: "bessel",
1198
+ datumName: "Hermannskogel"
1199
+ },
1200
+ mgi: {
1201
+ towgs84: "577.326,90.129,463.919,5.137,1.474,5.297,2.4232",
1202
+ ellipse: "bessel",
1203
+ datumName: "Militar-Geographische Institut"
1204
+ },
1205
+ osni52: {
1206
+ towgs84: "482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",
1207
+ ellipse: "airy",
1208
+ datumName: "Irish National"
1209
+ },
1210
+ ire65: {
1211
+ towgs84: "482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",
1212
+ ellipse: "mod_airy",
1213
+ datumName: "Ireland 1965"
1214
+ },
1215
+ rassadiran: {
1216
+ towgs84: "-133.63,-157.5,-158.62",
1217
+ ellipse: "intl",
1218
+ datumName: "Rassadiran"
1219
+ },
1220
+ nzgd49: {
1221
+ towgs84: "59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",
1222
+ ellipse: "intl",
1223
+ datumName: "New Zealand Geodetic Datum 1949"
1224
+ },
1225
+ osgb36: {
1226
+ towgs84: "446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",
1227
+ ellipse: "airy",
1228
+ datumName: "Ordnance Survey of Great Britain 1936"
1229
+ },
1230
+ s_jtsk: {
1231
+ towgs84: "589,76,480",
1232
+ ellipse: "bessel",
1233
+ datumName: "S-JTSK (Ferro)"
1234
+ },
1235
+ beduaram: {
1236
+ towgs84: "-106,-87,188",
1237
+ ellipse: "clrk80",
1238
+ datumName: "Beduaram"
1239
+ },
1240
+ gunung_segara: {
1241
+ towgs84: "-403,684,41",
1242
+ ellipse: "bessel",
1243
+ datumName: "Gunung Segara Jakarta"
1244
+ },
1245
+ rnb72: {
1246
+ towgs84: "106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",
1247
+ ellipse: "intl",
1248
+ datumName: "Reseau National Belge 1972"
1249
+ },
1250
+ EPSG_5451: { towgs84: "6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649" },
1251
+ IGNF_LURESG: { towgs84: "-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43" },
1252
+ EPSG_4614: { towgs84: "-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065" },
1253
+ EPSG_4615: { towgs84: "-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748" },
1254
+ ESRI_37241: { towgs84: "-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031" },
1255
+ ESRI_37249: { towgs84: "-440.296,58.548,296.265,1.128,10.202,4.559,-0.438" },
1256
+ ESRI_37245: { towgs84: "-511.151,-181.269,139.609,1.05,2.703,1.798,3.071" },
1257
+ EPSG_4178: { towgs84: "24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01" },
1258
+ EPSG_4622: { towgs84: "-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984" },
1259
+ EPSG_4625: { towgs84: "126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227" },
1260
+ EPSG_5252: { towgs84: "0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439" },
1261
+ EPSG_4314: { towgs84: "597.1,71.4,412.1,0.894,0.068,-1.563,7.58" },
1262
+ EPSG_4282: { towgs84: "-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166" },
1263
+ EPSG_4231: { towgs84: "-83.11,-97.38,-117.22,0.005693,-0.044698,0.044285,0.1218" },
1264
+ EPSG_4274: { towgs84: "-230.994,102.591,25.199,0.633,-0.239,0.9,1.95" },
1265
+ EPSG_4134: { towgs84: "-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006" },
1266
+ EPSG_4254: { towgs84: "18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013" },
1267
+ EPSG_4159: { towgs84: "-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175" },
1268
+ EPSG_4687: { towgs84: "0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093" },
1269
+ EPSG_4227: { towgs84: "-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225" },
1270
+ EPSG_4746: { towgs84: "599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46" },
1271
+ EPSG_4745: { towgs84: "612.4,77,440.2,-0.054,0.057,-2.797,2.55" },
1272
+ EPSG_6311: { towgs84: "8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926" },
1273
+ EPSG_4289: { towgs84: "565.7381,50.4018,465.2904,-0.395026,0.330772,-1.876073,4.07244" },
1274
+ EPSG_4230: { towgs84: "-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4" },
1275
+ EPSG_4154: { towgs84: "-123.02,-158.95,-168.47" },
1276
+ EPSG_4156: { towgs84: "570.8,85.7,462.8,4.998,1.587,5.261,3.56" },
1277
+ EPSG_4299: { towgs84: "482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15" },
1278
+ EPSG_4179: { towgs84: "33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84" },
1279
+ EPSG_4313: { towgs84: "-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747" },
1280
+ EPSG_4194: { towgs84: "163.511,127.533,-159.789" },
1281
+ EPSG_4195: { towgs84: "105,326,-102.5" },
1282
+ EPSG_4196: { towgs84: "-45,417,-3.5" },
1283
+ EPSG_4611: { towgs84: "-162.619,-276.959,-161.764,0.067753,-2.243648,-1.158828,-1.094246" },
1284
+ EPSG_4633: { towgs84: "137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824" },
1285
+ EPSG_4641: { towgs84: "-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993" },
1286
+ EPSG_4643: { towgs84: "-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002" },
1287
+ EPSG_4300: { towgs84: "482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15" },
1288
+ EPSG_4188: { towgs84: "482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15" },
1289
+ EPSG_4660: { towgs84: "982.6087,552.753,-540.873,6.681627,-31.611492,-19.848161,16.805" },
1290
+ EPSG_4662: { towgs84: "97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259" },
1291
+ EPSG_3906: { towgs84: "577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664" },
1292
+ EPSG_4307: { towgs84: "-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547" },
1293
+ EPSG_6892: { towgs84: "-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686" },
1294
+ EPSG_4690: { towgs84: "221.597,152.441,176.523,2.403,1.3893,0.884,11.4648" },
1295
+ EPSG_4691: { towgs84: "218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817" },
1296
+ EPSG_4629: { towgs84: "72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653" },
1297
+ EPSG_4630: { towgs84: "165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111" },
1298
+ EPSG_4692: { towgs84: "217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093" },
1299
+ EPSG_9333: { towgs84: "0,0,0,-0.008393,0.000749,-0.010276,0" },
1300
+ EPSG_9059: { towgs84: "0,0,0" },
1301
+ EPSG_4312: { towgs84: "601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887" },
1302
+ EPSG_4123: { towgs84: "-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496" },
1303
+ EPSG_4309: { towgs84: "-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365" },
1304
+ ESRI_104106: { towgs84: "-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058" },
1305
+ EPSG_4281: { towgs84: "-219.247,-73.802,269.529" },
1306
+ EPSG_4322: { towgs84: "0,0,4.5" },
1307
+ EPSG_4324: { towgs84: "0,0,1.9" },
1308
+ EPSG_4284: { towgs84: "43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549" },
1309
+ EPSG_4277: { towgs84: "446.448,-125.157,542.06,0.15,0.247,0.842,-20.489" },
1310
+ EPSG_4207: { towgs84: "-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46" },
1311
+ EPSG_4688: { towgs84: "347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647" },
1312
+ EPSG_4689: { towgs84: "410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218" },
1313
+ EPSG_4720: { towgs84: "0,0,4.5" },
1314
+ EPSG_4273: { towgs84: "278.3,93,474.5,7.889,0.05,-6.61,6.21" },
1315
+ EPSG_4240: { towgs84: "204.64,834.74,293.8" },
1316
+ EPSG_4817: { towgs84: "278.3,93,474.5,7.889,0.05,-6.61,6.21" },
1317
+ ESRI_104131: { towgs84: "426.62,142.62,460.09,4.98,4.49,-12.42,-17.1" },
1318
+ EPSG_4265: { towgs84: "-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68" },
1319
+ EPSG_4263: { towgs84: "-111.92,-87.85,114.5,1.875,0.202,0.219,0.032" },
1320
+ EPSG_4298: { towgs84: "-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536" },
1321
+ EPSG_4270: { towgs84: "-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424" },
1322
+ EPSG_4229: { towgs84: "-121.8,98.1,-10.7" },
1323
+ EPSG_4220: { towgs84: "-55.5,-348,-229.2" },
1324
+ EPSG_4214: { towgs84: "12.646,-155.176,-80.863" },
1325
+ EPSG_4232: { towgs84: "-345,3,223" },
1326
+ EPSG_4238: { towgs84: "-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037" },
1327
+ EPSG_4168: { towgs84: "-170,33,326" },
1328
+ EPSG_4131: { towgs84: "199,931,318.9" },
1329
+ EPSG_4152: { towgs84: "-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0" },
1330
+ EPSG_5228: { towgs84: "572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378" },
1331
+ EPSG_8351: { towgs84: "485.021,169.465,483.839,7.786342,4.397554,4.102655,0" },
1332
+ EPSG_4683: { towgs84: "-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06" },
1333
+ EPSG_4133: { towgs84: "0,0,0" },
1334
+ EPSG_7373: { towgs84: "0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693" },
1335
+ EPSG_9075: { towgs84: "-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0" },
1336
+ EPSG_9072: { towgs84: "-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0" },
1337
+ EPSG_9294: { towgs84: "1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388" },
1338
+ EPSG_4212: { towgs84: "-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492" },
1339
+ EPSG_4191: { towgs84: "-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703" },
1340
+ EPSG_4237: { towgs84: "52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191" },
1341
+ EPSG_4740: { towgs84: "-1.08,-0.27,-0.9" },
1342
+ EPSG_4124: { towgs84: "419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496" },
1343
+ EPSG_5681: { towgs84: "584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922" },
1344
+ EPSG_4141: { towgs84: "23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262" },
1345
+ EPSG_4204: { towgs84: "-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194" },
1346
+ EPSG_4319: { towgs84: "226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798" },
1347
+ EPSG_4200: { towgs84: "24.82,-131.21,-82.66" },
1348
+ EPSG_4130: { towgs84: "0,0,0" },
1349
+ EPSG_4127: { towgs84: "-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359" },
1350
+ EPSG_4149: { towgs84: "674.374,15.056,405.346" },
1351
+ EPSG_4617: { towgs84: "-0.991,1.9072,0.5129,0.02579,0.00965,0.01166,0" },
1352
+ EPSG_4663: { towgs84: "-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485" },
1353
+ EPSG_4664: { towgs84: "-211.939,137.626,58.3,-0.089,0.251,0.079,0.384" },
1354
+ EPSG_4665: { towgs84: "-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048" },
1355
+ EPSG_4666: { towgs84: "631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43" },
1356
+ EPSG_4756: { towgs84: "-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188" },
1357
+ EPSG_4723: { towgs84: "-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925" },
1358
+ EPSG_4726: { towgs84: "8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081" },
1359
+ EPSG_4267: { towgs84: "-8.0,160.0,176.0" },
1360
+ EPSG_5365: { towgs84: "-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693" },
1361
+ EPSG_4218: { towgs84: "304.5,306.5,-318.1" },
1362
+ EPSG_4242: { towgs84: "-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95" },
1363
+ EPSG_4216: { towgs84: "-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289" },
1364
+ ESRI_104105: { towgs84: "631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43" },
1365
+ ESRI_104129: { towgs84: "0,0,0" },
1366
+ EPSG_4673: { towgs84: "174.05,-25.49,112.57" },
1367
+ EPSG_4202: { towgs84: "-124,-60,154" },
1368
+ EPSG_4203: { towgs84: "-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191" },
1369
+ EPSG_3819: { towgs84: "595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408" },
1370
+ EPSG_8694: { towgs84: "-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169" },
1371
+ EPSG_4145: { towgs84: "275.57,676.78,229.6" },
1372
+ EPSG_4283: { towgs84: "0.06155,-0.01087,-0.04019,0.039492,0.032722,0.032898,-0.009994" },
1373
+ EPSG_4317: { towgs84: "2.3287,-147.0425,-92.0802,-0.309248,0.324822,0.497299,5.689063" },
1374
+ EPSG_4272: { towgs84: "59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993" },
1375
+ EPSG_4248: { towgs84: "-307.7,265.3,-363.5" },
1376
+ EPSG_5561: { towgs84: "24,-121,-76" },
1377
+ EPSG_5233: { towgs84: "-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338" },
1378
+ ESRI_104130: { towgs84: "-86,-98,-119" },
1379
+ ESRI_104102: { towgs84: "682,-203,480" },
1380
+ ESRI_37207: { towgs84: "7,-10,-26" },
1381
+ EPSG_4675: { towgs84: "59.935,118.4,-10.871" },
1382
+ ESRI_104109: { towgs84: "-89.121,-348.182,260.871" },
1383
+ ESRI_104112: { towgs84: "-185.583,-230.096,281.361" },
1384
+ ESRI_104113: { towgs84: "25.1,-275.6,222.6" },
1385
+ IGNF_WGS72G: { towgs84: "0,12,6" },
1386
+ IGNF_NTFG: { towgs84: "-168,-60,320" },
1387
+ IGNF_EFATE57G: { towgs84: "-127,-769,472" },
1388
+ IGNF_PGP50G: { towgs84: "324.8,153.6,172.1" },
1389
+ IGNF_REUN47G: { towgs84: "94,-948,-1262" },
1390
+ IGNF_CSG67G: { towgs84: "-186,230,110" },
1391
+ IGNF_GUAD48G: { towgs84: "-467,-16,-300" },
1392
+ IGNF_TAHI51G: { towgs84: "162,117,154" },
1393
+ IGNF_TAHAAG: { towgs84: "65,342,77" },
1394
+ IGNF_NUKU72G: { towgs84: "84,274,65" },
1395
+ IGNF_PETRELS72G: { towgs84: "365,194,166" },
1396
+ IGNF_WALL78G: { towgs84: "253,-133,-127" },
1397
+ IGNF_MAYO50G: { towgs84: "-382,-59,-262" },
1398
+ IGNF_TANNAG: { towgs84: "-139,-967,436" },
1399
+ IGNF_IGN72G: { towgs84: "-13,-348,292" },
1400
+ IGNF_ATIGG: { towgs84: "1118,23,66" },
1401
+ IGNF_FANGA84G: { towgs84: "150.57,158.33,118.32" },
1402
+ IGNF_RUSAT84G: { towgs84: "202.13,174.6,-15.74" },
1403
+ IGNF_KAUE70G: { towgs84: "126.74,300.1,-75.49" },
1404
+ IGNF_MOP90G: { towgs84: "-10.8,-1.8,12.77" },
1405
+ IGNF_MHPF67G: { towgs84: "338.08,212.58,-296.17" },
1406
+ IGNF_TAHI79G: { towgs84: "160.61,116.05,153.69" },
1407
+ IGNF_ANAA92G: { towgs84: "1.5,3.84,4.81" },
1408
+ IGNF_MARQUI72G: { towgs84: "330.91,-13.92,58.56" },
1409
+ IGNF_APAT86G: { towgs84: "143.6,197.82,74.05" },
1410
+ IGNF_TUBU69G: { towgs84: "237.17,171.61,-77.84" },
1411
+ IGNF_STPM50G: { towgs84: "11.363,424.148,373.13" },
1412
+ EPSG_4150: { towgs84: "674.374,15.056,405.346" },
1413
+ EPSG_4754: { towgs84: "-208.4058,-109.8777,-2.5764" },
1414
+ ESRI_104101: { towgs84: "372.87,149.23,585.29" },
1415
+ EPSG_4693: { towgs84: "0,-0.15,0.68" },
1416
+ EPSG_6207: { towgs84: "293.17,726.18,245.36" },
1417
+ EPSG_4153: { towgs84: "-133.63,-157.5,-158.62" },
1418
+ EPSG_4132: { towgs84: "-241.54,-163.64,396.06" },
1419
+ EPSG_4221: { towgs84: "-154.5,150.7,100.4" },
1420
+ EPSG_4266: { towgs84: "-80.7,-132.5,41.1" },
1421
+ EPSG_4193: { towgs84: "-70.9,-151.8,-41.4" },
1422
+ EPSG_5340: { towgs84: "-0.41,0.46,-0.35" },
1423
+ EPSG_4246: { towgs84: "-294.7,-200.1,525.5" },
1424
+ EPSG_4318: { towgs84: "-3.2,-5.7,2.8" },
1425
+ EPSG_4121: { towgs84: "-199.87,74.79,246.62" },
1426
+ EPSG_4223: { towgs84: "-260.1,5.5,432.2" },
1427
+ EPSG_4158: { towgs84: "-0.465,372.095,171.736" },
1428
+ EPSG_4285: { towgs84: "-128.16,-282.42,21.93" },
1429
+ EPSG_4613: { towgs84: "-404.78,685.68,45.47" },
1430
+ EPSG_4607: { towgs84: "195.671,332.517,274.607" },
1431
+ EPSG_4475: { towgs84: "-381.788,-57.501,-256.673" },
1432
+ EPSG_4208: { towgs84: "-157.84,308.54,-146.6" },
1433
+ EPSG_4743: { towgs84: "70.995,-335.916,262.898" },
1434
+ EPSG_4710: { towgs84: "-323.65,551.39,-491.22" },
1435
+ EPSG_7881: { towgs84: "-0.077,0.079,0.086" },
1436
+ EPSG_4682: { towgs84: "283.729,735.942,261.143" },
1437
+ EPSG_4739: { towgs84: "-156,-271,-189" },
1438
+ EPSG_4679: { towgs84: "-80.01,253.26,291.19" },
1439
+ EPSG_4750: { towgs84: "-56.263,16.136,-22.856" },
1440
+ EPSG_4644: { towgs84: "-10.18,-350.43,291.37" },
1441
+ EPSG_4695: { towgs84: "-103.746,-9.614,-255.95" },
1442
+ EPSG_4292: { towgs84: "-355,21,72" },
1443
+ EPSG_4302: { towgs84: "-61.702,284.488,472.052" },
1444
+ EPSG_4143: { towgs84: "-124.76,53,466.79" },
1445
+ EPSG_4606: { towgs84: "-153,153,307" },
1446
+ EPSG_4699: { towgs84: "-770.1,158.4,-498.2" },
1447
+ EPSG_4247: { towgs84: "-273.5,110.6,-357.9" },
1448
+ EPSG_4160: { towgs84: "8.88,184.86,106.69" },
1449
+ EPSG_4161: { towgs84: "-233.43,6.65,173.64" },
1450
+ EPSG_9251: { towgs84: "-9.5,122.9,138.2" },
1451
+ EPSG_9253: { towgs84: "-78.1,101.6,133.3" },
1452
+ EPSG_4297: { towgs84: "-198.383,-240.517,-107.909" },
1453
+ EPSG_4269: { towgs84: "0,0,0" },
1454
+ EPSG_4301: { towgs84: "-147,506,687" },
1455
+ EPSG_4618: { towgs84: "-59,-11,-52" },
1456
+ EPSG_4612: { towgs84: "0,0,0" },
1457
+ EPSG_4678: { towgs84: "44.585,-131.212,-39.544" },
1458
+ EPSG_4250: { towgs84: "-130,29,364" },
1459
+ EPSG_4144: { towgs84: "214,804,268" },
1460
+ EPSG_4147: { towgs84: "-17.51,-108.32,-62.39" },
1461
+ EPSG_4259: { towgs84: "-254.1,-5.36,-100.29" },
1462
+ EPSG_4164: { towgs84: "-76,-138,67" },
1463
+ EPSG_4211: { towgs84: "-378.873,676.002,-46.255" },
1464
+ EPSG_4182: { towgs84: "-422.651,-172.995,84.02" },
1465
+ EPSG_4224: { towgs84: "-143.87,243.37,-33.52" },
1466
+ EPSG_4225: { towgs84: "-205.57,168.77,-4.12" },
1467
+ EPSG_5527: { towgs84: "-67.35,3.88,-38.22" },
1468
+ EPSG_4752: { towgs84: "98,390,-22" },
1469
+ EPSG_4310: { towgs84: "-30,190,89" },
1470
+ EPSG_9248: { towgs84: "-192.26,65.72,132.08" },
1471
+ EPSG_4680: { towgs84: "124.5,-63.5,-281" },
1472
+ EPSG_4701: { towgs84: "-79.9,-158,-168.9" },
1473
+ EPSG_4706: { towgs84: "-146.21,112.63,4.05" },
1474
+ EPSG_4805: { towgs84: "682,-203,480" },
1475
+ EPSG_4201: { towgs84: "-165,-11,206" },
1476
+ EPSG_4210: { towgs84: "-157,-2,-299" },
1477
+ EPSG_4183: { towgs84: "-104,167,-38" },
1478
+ EPSG_4139: { towgs84: "11,72,-101" },
1479
+ EPSG_4668: { towgs84: "-86,-98,-119" },
1480
+ EPSG_4717: { towgs84: "-2,151,181" },
1481
+ EPSG_4732: { towgs84: "102,52,-38" },
1482
+ EPSG_4280: { towgs84: "-377,681,-50" },
1483
+ EPSG_4209: { towgs84: "-138,-105,-289" },
1484
+ EPSG_4261: { towgs84: "31,146,47" },
1485
+ EPSG_4658: { towgs84: "-73,46,-86" },
1486
+ EPSG_4721: { towgs84: "265.025,384.929,-194.046" },
1487
+ EPSG_4222: { towgs84: "-136,-108,-292" },
1488
+ EPSG_4601: { towgs84: "-255,-15,71" },
1489
+ EPSG_4602: { towgs84: "725,685,536" },
1490
+ EPSG_4603: { towgs84: "72,213.7,93" },
1491
+ EPSG_4605: { towgs84: "9,183,236" },
1492
+ EPSG_4621: { towgs84: "137,248,-430" },
1493
+ EPSG_4657: { towgs84: "-28,199,5" },
1494
+ EPSG_4316: { towgs84: "103.25,-100.4,-307.19" },
1495
+ EPSG_4642: { towgs84: "-13,-348,292" },
1496
+ EPSG_4698: { towgs84: "145,-187,103" },
1497
+ EPSG_4192: { towgs84: "-206.1,-174.7,-87.7" },
1498
+ EPSG_4311: { towgs84: "-265,120,-358" },
1499
+ EPSG_4135: { towgs84: "58,-283,-182" },
1500
+ ESRI_104138: { towgs84: "198,-226,-347" },
1501
+ EPSG_4245: { towgs84: "-11,851,5" },
1502
+ EPSG_4142: { towgs84: "-125,53,467" },
1503
+ EPSG_4213: { towgs84: "-106,-87,188" },
1504
+ EPSG_4253: { towgs84: "-133,-77,-51" },
1505
+ EPSG_4129: { towgs84: "-132,-110,-335" },
1506
+ EPSG_4713: { towgs84: "-77,-128,142" },
1507
+ EPSG_4239: { towgs84: "217,823,299" },
1508
+ EPSG_4146: { towgs84: "295,736,257" },
1509
+ EPSG_4155: { towgs84: "-83,37,124" },
1510
+ EPSG_4165: { towgs84: "-173,253,27" },
1511
+ EPSG_4672: { towgs84: "175,-38,113" },
1512
+ EPSG_4236: { towgs84: "-637,-549,-203" },
1513
+ EPSG_4251: { towgs84: "-90,40,88" },
1514
+ EPSG_4271: { towgs84: "-2,374,172" },
1515
+ EPSG_4175: { towgs84: "-88,4,101" },
1516
+ EPSG_4716: { towgs84: "298,-304,-375" },
1517
+ EPSG_4315: { towgs84: "-23,259,-9" },
1518
+ EPSG_4744: { towgs84: "-242.2,-144.9,370.3" },
1519
+ EPSG_4244: { towgs84: "-97,787,86" },
1520
+ EPSG_4293: { towgs84: "616,97,-251" },
1521
+ EPSG_4714: { towgs84: "-127,-769,472" },
1522
+ EPSG_4736: { towgs84: "260,12,-147" },
1523
+ EPSG_6883: { towgs84: "-235,-110,393" },
1524
+ EPSG_6894: { towgs84: "-63,176,185" },
1525
+ EPSG_4205: { towgs84: "-43,-163,45" },
1526
+ EPSG_4256: { towgs84: "41,-220,-134" },
1527
+ EPSG_4262: { towgs84: "639,405,60" },
1528
+ EPSG_4604: { towgs84: "174,359,365" },
1529
+ EPSG_4169: { towgs84: "-115,118,426" },
1530
+ EPSG_4620: { towgs84: "-106,-129,165" },
1531
+ EPSG_4184: { towgs84: "-203,141,53" },
1532
+ EPSG_4616: { towgs84: "-289,-124,60" },
1533
+ EPSG_9403: { towgs84: "-307,-92,127" },
1534
+ EPSG_4684: { towgs84: "-133,-321,50" },
1535
+ EPSG_4708: { towgs84: "-491,-22,435" },
1536
+ EPSG_4707: { towgs84: "114,-116,-333" },
1537
+ EPSG_4709: { towgs84: "145,75,-272" },
1538
+ EPSG_4712: { towgs84: "-205,107,53" },
1539
+ EPSG_4711: { towgs84: "124,-234,-25" },
1540
+ EPSG_4718: { towgs84: "230,-199,-752" },
1541
+ EPSG_4719: { towgs84: "211,147,111" },
1542
+ EPSG_4724: { towgs84: "208,-435,-229" },
1543
+ EPSG_4725: { towgs84: "189,-79,-202" },
1544
+ EPSG_4735: { towgs84: "647,1777,-1124" },
1545
+ EPSG_4722: { towgs84: "-794,119,-298" },
1546
+ EPSG_4728: { towgs84: "-307,-92,127" },
1547
+ EPSG_4734: { towgs84: "-632,438,-609" },
1548
+ EPSG_4727: { towgs84: "912,-58,1227" },
1549
+ EPSG_4729: { towgs84: "185,165,42" },
1550
+ EPSG_4730: { towgs84: "170,42,84" },
1551
+ EPSG_4733: { towgs84: "276,-57,149" },
1552
+ ESRI_37218: { towgs84: "230,-199,-752" },
1553
+ ESRI_37240: { towgs84: "-7,215,225" },
1554
+ ESRI_37221: { towgs84: "252,-209,-751" },
1555
+ ESRI_4305: { towgs84: "-123,-206,219" },
1556
+ ESRI_104139: { towgs84: "-73,-247,227" },
1557
+ EPSG_4748: { towgs84: "51,391,-36" },
1558
+ EPSG_4219: { towgs84: "-384,664,-48" },
1559
+ EPSG_4255: { towgs84: "-333,-222,114" },
1560
+ EPSG_4257: { towgs84: "-587.8,519.75,145.76" },
1561
+ EPSG_4646: { towgs84: "-963,510,-359" },
1562
+ EPSG_6881: { towgs84: "-24,-203,268" },
1563
+ EPSG_6882: { towgs84: "-183,-15,273" },
1564
+ EPSG_4715: { towgs84: "-104,-129,239" },
1565
+ IGNF_RGF93GDD: { towgs84: "0,0,0" },
1566
+ IGNF_RGM04GDD: { towgs84: "0,0,0" },
1567
+ IGNF_RGSPM06GDD: { towgs84: "0,0,0" },
1568
+ IGNF_RGTAAF07GDD: { towgs84: "0,0,0" },
1569
+ IGNF_RGFG95GDD: { towgs84: "0,0,0" },
1570
+ IGNF_RGNCG: { towgs84: "0,0,0" },
1571
+ IGNF_RGPFGDD: { towgs84: "0,0,0" },
1572
+ IGNF_ETRS89G: { towgs84: "0,0,0" },
1573
+ IGNF_RGR92GDD: { towgs84: "0,0,0" },
1574
+ EPSG_4173: { towgs84: "0,0,0" },
1575
+ EPSG_4180: { towgs84: "0,0,0" },
1576
+ EPSG_4619: { towgs84: "0,0,0" },
1577
+ EPSG_4667: { towgs84: "0,0,0" },
1578
+ EPSG_4075: { towgs84: "0,0,0" },
1579
+ EPSG_6706: { towgs84: "0,0,0" },
1580
+ EPSG_7798: { towgs84: "0,0,0" },
1581
+ EPSG_4661: { towgs84: "0,0,0" },
1582
+ EPSG_4669: { towgs84: "0,0,0" },
1583
+ EPSG_8685: { towgs84: "0,0,0" },
1584
+ EPSG_4151: { towgs84: "0,0,0" },
1585
+ EPSG_9702: { towgs84: "0,0,0" },
1586
+ EPSG_4758: { towgs84: "0,0,0" },
1587
+ EPSG_4761: { towgs84: "0,0,0" },
1588
+ EPSG_4765: { towgs84: "0,0,0" },
1589
+ EPSG_8997: { towgs84: "0,0,0" },
1590
+ EPSG_4023: { towgs84: "0,0,0" },
1591
+ EPSG_4670: { towgs84: "0,0,0" },
1592
+ EPSG_4694: { towgs84: "0,0,0" },
1593
+ EPSG_4148: { towgs84: "0,0,0" },
1594
+ EPSG_4163: { towgs84: "0,0,0" },
1595
+ EPSG_4167: { towgs84: "0,0,0" },
1596
+ EPSG_4189: { towgs84: "0,0,0" },
1597
+ EPSG_4190: { towgs84: "0,0,0" },
1598
+ EPSG_4176: { towgs84: "0,0,0" },
1599
+ EPSG_4659: { towgs84: "0,0,0" },
1600
+ EPSG_3824: { towgs84: "0,0,0" },
1601
+ EPSG_3889: { towgs84: "0,0,0" },
1602
+ EPSG_4046: { towgs84: "0,0,0" },
1603
+ EPSG_4081: { towgs84: "0,0,0" },
1604
+ EPSG_4558: { towgs84: "0,0,0" },
1605
+ EPSG_4483: { towgs84: "0,0,0" },
1606
+ EPSG_5013: { towgs84: "0,0,0" },
1607
+ EPSG_5264: { towgs84: "0,0,0" },
1608
+ EPSG_5324: { towgs84: "0,0,0" },
1609
+ EPSG_5354: { towgs84: "0,0,0" },
1610
+ EPSG_5371: { towgs84: "0,0,0" },
1611
+ EPSG_5373: { towgs84: "0,0,0" },
1612
+ EPSG_5381: { towgs84: "0,0,0" },
1613
+ EPSG_5393: { towgs84: "0,0,0" },
1614
+ EPSG_5489: { towgs84: "0,0,0" },
1615
+ EPSG_5593: { towgs84: "0,0,0" },
1616
+ EPSG_6135: { towgs84: "0,0,0" },
1617
+ EPSG_6365: { towgs84: "0,0,0" },
1618
+ EPSG_5246: { towgs84: "0,0,0" },
1619
+ EPSG_7886: { towgs84: "0,0,0" },
1620
+ EPSG_8431: { towgs84: "0,0,0" },
1621
+ EPSG_8427: { towgs84: "0,0,0" },
1622
+ EPSG_8699: { towgs84: "0,0,0" },
1623
+ EPSG_8818: { towgs84: "0,0,0" },
1624
+ EPSG_4757: { towgs84: "0,0,0" },
1625
+ EPSG_9140: { towgs84: "0,0,0" },
1626
+ EPSG_8086: { towgs84: "0,0,0" },
1627
+ EPSG_4686: { towgs84: "0,0,0" },
1628
+ EPSG_4737: { towgs84: "0,0,0" },
1629
+ EPSG_4702: { towgs84: "0,0,0" },
1630
+ EPSG_4747: { towgs84: "0,0,0" },
1631
+ EPSG_4749: { towgs84: "0,0,0" },
1632
+ EPSG_4674: { towgs84: "0,0,0" },
1633
+ EPSG_4755: { towgs84: "0,0,0" },
1634
+ EPSG_4759: { towgs84: "0,0,0" },
1635
+ EPSG_4762: { towgs84: "0,0,0" },
1636
+ EPSG_4763: { towgs84: "0,0,0" },
1637
+ EPSG_4764: { towgs84: "0,0,0" },
1638
+ EPSG_4166: { towgs84: "0,0,0" },
1639
+ EPSG_4170: { towgs84: "0,0,0" },
1640
+ EPSG_5546: { towgs84: "0,0,0" },
1641
+ EPSG_7844: { towgs84: "0,0,0" },
1642
+ EPSG_4818: { towgs84: "589,76,480" },
1643
+ EPSG_10328: { towgs84: "0,0,0" },
1644
+ EPSG_9782: { towgs84: "0,0,0" },
1645
+ EPSG_9777: { towgs84: "0,0,0" },
1646
+ EPSG_10690: { towgs84: "0,0,0" },
1647
+ EPSG_10639: { towgs84: "0,0,0" },
1648
+ EPSG_10739: { towgs84: "0,0,0" },
1649
+ EPSG_7686: { towgs84: "0,0,0" },
1650
+ EPSG_8900: { towgs84: "0,0,0" },
1651
+ EPSG_5886: { towgs84: "0,0,0" },
1652
+ EPSG_7683: { towgs84: "0,0,0" },
1653
+ EPSG_6668: { towgs84: "0,0,0" },
1654
+ EPSG_20046: { towgs84: "0,0,0" },
1655
+ EPSG_10299: { towgs84: "0,0,0" },
1656
+ EPSG_10310: { towgs84: "0,0,0" },
1657
+ EPSG_10475: { towgs84: "0,0,0" },
1658
+ EPSG_4742: { towgs84: "0,0,0" },
1659
+ EPSG_10671: { towgs84: "0,0,0" },
1660
+ EPSG_10762: { towgs84: "0,0,0" },
1661
+ EPSG_10725: { towgs84: "0,0,0" },
1662
+ EPSG_10791: { towgs84: "0,0,0" },
1663
+ EPSG_10800: { towgs84: "0,0,0" },
1664
+ EPSG_10305: { towgs84: "0,0,0" },
1665
+ EPSG_10941: { towgs84: "0,0,0" },
1666
+ EPSG_10968: { towgs84: "0,0,0" },
1667
+ EPSG_10875: { towgs84: "0,0,0" },
1668
+ EPSG_6318: { towgs84: "0,0,0" },
1669
+ EPSG_10910: { towgs84: "0,0,0" }
1670
+ };
1671
+ for (var Di in It) {
1672
+ var Bt = It[Di];
1673
+ Bt.datumName && (It[Bt.datumName] = Bt);
1674
+ }
1675
+ function Bi(t, a, i, e, s, r, n) {
1676
+ var h = {};
1677
+ return t === void 0 || t === "none" ? h.datum_type = 5 : h.datum_type = 4, a && (h.datum_params = a.map(parseFloat), (h.datum_params[0] !== 0 || h.datum_params[1] !== 0 || h.datum_params[2] !== 0) && (h.datum_type = 1), h.datum_params.length > 3 && (h.datum_params[3] !== 0 || h.datum_params[4] !== 0 || h.datum_params[5] !== 0 || h.datum_params[6] !== 0) && (h.datum_type = 2, h.datum_params[3] *= ct, h.datum_params[4] *= ct, h.datum_params[5] *= ct, h.datum_params[6] = h.datum_params[6] / 1e6 + 1)), n && (h.datum_type = 3, h.grids = n), h.a = i, h.b = e, h.es = s, h.ep2 = r, h;
1678
+ }
1679
+ var Xt = {};
1680
+ function ji(t, a, i) {
1681
+ return a instanceof ArrayBuffer ? zi(t, a, i) : { ready: Wi(t, a) };
1682
+ }
1683
+ function zi(t, a, i) {
1684
+ var e = !0;
1685
+ i !== void 0 && i.includeErrorFields === !1 && (e = !1);
1686
+ var s = new DataView(a), r = Ki(s), n = Xi(s, r), h = {
1687
+ header: n,
1688
+ subgrids: Vi(s, n, r, e)
1689
+ };
1690
+ return Xt[t] = h, h;
1691
+ }
1692
+ async function Wi(t, a) {
1693
+ for (var i = [], e = await a.getImageCount(), s = e - 1; s >= 0; s--) {
1694
+ var r = await a.getImage(s), n = await r.readRasters(), h = [r.getWidth(), r.getHeight()], o = r.getBoundingBox().map(Ma), f = [r.fileDirectory.ModelPixelScale[0], r.fileDirectory.ModelPixelScale[1]].map(Ma), _ = o[0] + (h[0] - 1) * f[0], l = o[3] - (h[1] - 1) * f[1], c = n[0], v = n[1], u = [];
1695
+ for (let y = h[1] - 1; y >= 0; y--) for (let E = h[0] - 1; E >= 0; E--) {
1696
+ var g = y * h[0] + E;
1697
+ u.push([-K(v[g]), K(c[g])]);
1698
+ }
1699
+ i.push({
1700
+ del: f,
1701
+ lim: h,
1702
+ ll: [-_, l],
1703
+ cvs: u
1704
+ });
1705
+ }
1706
+ var d = {
1707
+ header: { nSubgrids: e },
1708
+ subgrids: i
1709
+ };
1710
+ return Xt[t] = d, d;
1711
+ }
1712
+ function Qi(t) {
1713
+ return t === void 0 ? null : t.split(",").map(Hi);
1714
+ }
1715
+ function Hi(t) {
1716
+ if (t.length === 0) return null;
1717
+ var a = t[0] === "@";
1718
+ return a && (t = t.slice(1)), t === "null" ? {
1719
+ name: "null",
1720
+ mandatory: !a,
1721
+ grid: null,
1722
+ isNull: !0
1723
+ } : {
1724
+ name: t,
1725
+ mandatory: !a,
1726
+ grid: Xt[t] || null,
1727
+ isNull: !1
1728
+ };
1729
+ }
1730
+ function Ma(t) {
1731
+ return t * Math.PI / 180;
1732
+ }
1733
+ function K(t) {
1734
+ return t / 3600 * Math.PI / 180;
1735
+ }
1736
+ function Ki(t) {
1737
+ var a = t.getInt32(8, !1);
1738
+ return a === 11 ? !1 : (a = t.getInt32(8, !0), a !== 11 && console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"), !0);
1739
+ }
1740
+ function Xi(t, a) {
1741
+ return {
1742
+ nFields: t.getInt32(8, a),
1743
+ nSubgridFields: t.getInt32(24, a),
1744
+ nSubgrids: t.getInt32(40, a),
1745
+ shiftType: Qt(t, 56, 64).trim(),
1746
+ fromSemiMajorAxis: t.getFloat64(120, a),
1747
+ fromSemiMinorAxis: t.getFloat64(136, a),
1748
+ toSemiMajorAxis: t.getFloat64(152, a),
1749
+ toSemiMinorAxis: t.getFloat64(168, a)
1750
+ };
1751
+ }
1752
+ function Qt(t, a, i) {
1753
+ return String.fromCharCode.apply(null, new Uint8Array(t.buffer.slice(a, i)));
1754
+ }
1755
+ function Vi(t, a, i, e) {
1756
+ for (var s = 176, r = [], n = 0; n < a.nSubgrids; n++) {
1757
+ var h = Zi(t, s, i), o = Yi(t, s, h, i, e), f = Math.round(1 + (h.upperLongitude - h.lowerLongitude) / h.longitudeInterval), _ = Math.round(1 + (h.upperLatitude - h.lowerLatitude) / h.latitudeInterval);
1758
+ r.push({
1759
+ ll: [K(h.lowerLongitude), K(h.lowerLatitude)],
1760
+ del: [K(h.longitudeInterval), K(h.latitudeInterval)],
1761
+ lim: [f, _],
1762
+ count: h.gridNodeCount,
1763
+ cvs: Ji(o)
1764
+ });
1765
+ var l = 16;
1766
+ e === !1 && (l = 8), s += 176 + h.gridNodeCount * l;
1767
+ }
1768
+ return r;
1769
+ }
1770
+ function Ji(t) {
1771
+ return t.map(function(a) {
1772
+ return [K(a.longitudeShift), K(a.latitudeShift)];
1773
+ });
1774
+ }
1775
+ function Zi(t, a, i) {
1776
+ return {
1777
+ name: Qt(t, a + 8, a + 16).trim(),
1778
+ parent: Qt(t, a + 24, a + 24 + 8).trim(),
1779
+ lowerLatitude: t.getFloat64(a + 72, i),
1780
+ upperLatitude: t.getFloat64(a + 88, i),
1781
+ lowerLongitude: t.getFloat64(a + 104, i),
1782
+ upperLongitude: t.getFloat64(a + 120, i),
1783
+ latitudeInterval: t.getFloat64(a + 136, i),
1784
+ longitudeInterval: t.getFloat64(a + 152, i),
1785
+ gridNodeCount: t.getInt32(a + 168, i)
1786
+ };
1787
+ }
1788
+ function Yi(t, a, i, e, s) {
1789
+ var r = a + 176, n = 16;
1790
+ s === !1 && (n = 8);
1791
+ for (var h = [], o = 0; o < i.gridNodeCount; o++) {
1792
+ var f = {
1793
+ latitudeShift: t.getFloat32(r + o * n, e),
1794
+ longitudeShift: t.getFloat32(r + o * n + 4, e)
1795
+ };
1796
+ s !== !1 && (f.latitudeAccuracy = t.getFloat32(r + o * n + 8, e), f.longitudeAccuracy = t.getFloat32(r + o * n + 12, e)), h.push(f);
1797
+ }
1798
+ return h;
1799
+ }
1800
+ function D(t, a) {
1801
+ if (!(this instanceof D)) return new D(t);
1802
+ this.forward = null, this.inverse = null, this.init = null, this.name, this.names = null, this.title, a = a || function(f) {
1803
+ if (f) throw f;
1804
+ };
1805
+ var i = bi(t);
1806
+ if (typeof i != "object") {
1807
+ a("Could not parse to valid json: " + t);
1808
+ return;
1809
+ }
1810
+ var e = D.projections.get(i.projName);
1811
+ if (!e) {
1812
+ a("Could not get projection name from: " + t);
1813
+ return;
1814
+ }
1815
+ if (i.datumCode && i.datumCode !== "none") {
1816
+ var s = V(It, i.datumCode);
1817
+ s && (i.datum_params = i.datum_params || (s.towgs84 ? s.towgs84.split(",") : null), i.ellps = s.ellipse, i.datumName = s.datumName ? s.datumName : i.datumCode);
1818
+ }
1819
+ i.k0 = i.k0 || 1, i.axis = i.axis || "enu", i.ellps = i.ellps || "wgs84", i.lat1 = i.lat1 || i.lat0;
1820
+ var r = Fi(i.a, i.b, i.rf, i.ellps, i.sphere), n = $i(r.a, r.b, r.rf, i.R_A), h = Qi(i.nadgrids), o = i.datum || Bi(i.datumCode, i.datum_params, r.a, r.b, n.es, n.ep2, h);
1821
+ ua(this, i), ua(this, e), this.a = r.a, this.b = r.b, this.rf = r.rf, this.sphere = r.sphere, this.es = n.es, this.e = n.e, this.ep2 = n.ep2, this.datum = o, "init" in this && typeof this.init == "function" && this.init(), a(null, this);
1822
+ }
1823
+ D.projections = Ui;
1824
+ D.projections.start();
1825
+ function ts(t, a) {
1826
+ return t.datum_type !== a.datum_type || t.a !== a.a || Math.abs(t.es - a.es) > 5e-11 ? !1 : t.datum_type === 1 ? t.datum_params[0] === a.datum_params[0] && t.datum_params[1] === a.datum_params[1] && t.datum_params[2] === a.datum_params[2] : t.datum_type === 2 ? t.datum_params[0] === a.datum_params[0] && t.datum_params[1] === a.datum_params[1] && t.datum_params[2] === a.datum_params[2] && t.datum_params[3] === a.datum_params[3] && t.datum_params[4] === a.datum_params[4] && t.datum_params[5] === a.datum_params[5] && t.datum_params[6] === a.datum_params[6] : !0;
1827
+ }
1828
+ function Fa(t, a, i) {
1829
+ var e = t.x, s = t.y, r = t.z ? t.z : 0, n, h, o, f;
1830
+ if (s < -M && s > -1.001 * M) s = -M;
1831
+ else if (s > M && s < 1.001 * M) s = M;
1832
+ else {
1833
+ if (s < -M) return {
1834
+ x: -1 / 0,
1835
+ y: -1 / 0,
1836
+ z: t.z
1837
+ };
1838
+ if (s > M) return {
1839
+ x: 1 / 0,
1840
+ y: 1 / 0,
1841
+ z: t.z
1842
+ };
1843
+ }
1844
+ return e > Math.PI && (e -= 2 * Math.PI), h = Math.sin(s), f = Math.cos(s), o = h * h, n = i / Math.sqrt(1 - a * o), {
1845
+ x: (n + r) * f * Math.cos(e),
1846
+ y: (n + r) * f * Math.sin(e),
1847
+ z: (n * (1 - a) + r) * h
1848
+ };
1849
+ }
1850
+ function Da(t, a, i, e) {
1851
+ var s = 1e-12, r = s * s, n = 30, h, o, f, _, l, c, v, u, g, d, y, E, S, w = t.x, P = t.y, b = t.z ? t.z : 0, A, T, C;
1852
+ if (h = Math.sqrt(w * w + P * P), o = Math.sqrt(w * w + P * P + b * b), h / i < s) {
1853
+ if (A = 0, o / i < s)
1854
+ return T = M, C = -e, {
1855
+ x: t.x,
1856
+ y: t.y,
1857
+ z: t.z
1858
+ };
1859
+ } else A = Math.atan2(P, w);
1860
+ f = b / o, _ = h / o, l = 1 / Math.sqrt(1 - a * (2 - a) * _ * _), u = _ * (1 - a) * l, g = f * l, S = 0;
1861
+ do
1862
+ S++, v = i / Math.sqrt(1 - a * g * g), C = h * u + b * g - v * (1 - a * g * g), c = a * v / (v + C), l = 1 / Math.sqrt(1 - c * (2 - c) * _ * _), d = _ * (1 - c) * l, y = f * l, E = y * u - d * g, u = d, g = y;
1863
+ while (E * E > r && S < n);
1864
+ return T = Math.atan(y / Math.abs(d)), {
1865
+ x: A,
1866
+ y: T,
1867
+ z: C
1868
+ };
1869
+ }
1870
+ function as(t, a, i) {
1871
+ if (a === 1) return {
1872
+ x: t.x + i[0],
1873
+ y: t.y + i[1],
1874
+ z: t.z + i[2]
1875
+ };
1876
+ if (a === 2) {
1877
+ var e = i[0], s = i[1], r = i[2], n = i[3], h = i[4], o = i[5], f = i[6];
1878
+ return {
1879
+ x: f * (t.x - o * t.y + h * t.z) + e,
1880
+ y: f * (o * t.x + t.y - n * t.z) + s,
1881
+ z: f * (-h * t.x + n * t.y + t.z) + r
1882
+ };
1883
+ }
1884
+ }
1885
+ function is(t, a, i) {
1886
+ if (a === 1) return {
1887
+ x: t.x - i[0],
1888
+ y: t.y - i[1],
1889
+ z: t.z - i[2]
1890
+ };
1891
+ if (a === 2) {
1892
+ var e = i[0], s = i[1], r = i[2], n = i[3], h = i[4], o = i[5], f = i[6], _ = (t.x - e) / f, l = (t.y - s) / f, c = (t.z - r) / f;
1893
+ return {
1894
+ x: _ + o * l - h * c,
1895
+ y: -o * _ + l + n * c,
1896
+ z: h * _ - n * l + c
1897
+ };
1898
+ }
1899
+ }
1900
+ function bt(t) {
1901
+ return t === 1 || t === 2;
1902
+ }
1903
+ function ss(t, a, i) {
1904
+ if (ts(t, a) || t.datum_type === 5 || a.datum_type === 5) return i;
1905
+ var e = t.a, s = t.es;
1906
+ if (t.datum_type === 3) {
1907
+ if (ga(t, !1, i) !== 0) return;
1908
+ e = ha, s = na;
1909
+ }
1910
+ var r = a.a, n = a.b, h = a.es;
1911
+ if (a.datum_type === 3 && (r = ha, n = ai, h = na), s === h && e === r && !bt(t.datum_type) && !bt(a.datum_type)) return i;
1912
+ if (i = Fa(i, s, e), bt(t.datum_type) && (i = as(i, t.datum_type, t.datum_params)), bt(a.datum_type) && (i = is(i, a.datum_type, a.datum_params)), i = Da(i, h, r, n), !(a.datum_type === 3 && ga(a, !0, i) !== 0))
1913
+ return i;
1914
+ }
1915
+ function ga(t, a, i) {
1916
+ if (t.grids === null || t.grids.length === 0)
1917
+ return console.log("Grid shift grids not found"), -1;
1918
+ var e = {
1919
+ x: -i.x,
1920
+ y: i.y
1921
+ }, s = {
1922
+ x: NaN,
1923
+ y: NaN
1924
+ }, r = [];
1925
+ t: for (var n = 0; n < t.grids.length; n++) {
1926
+ var h = t.grids[n];
1927
+ if (r.push(h.name), h.isNull) {
1928
+ s = e;
1929
+ break;
1930
+ }
1931
+ if (h.grid === null) {
1932
+ if (h.mandatory)
1933
+ return console.log("Unable to find mandatory grid '" + h.name + "'"), -1;
1934
+ continue;
1935
+ }
1936
+ for (var o = h.grid.subgrids, f = 0, _ = o.length; f < _; f++) {
1937
+ var l = o[f], c = (Math.abs(l.del[1]) + Math.abs(l.del[0])) / 1e4, v = l.ll[0] - c, u = l.ll[1] - c, g = l.ll[0] + (l.lim[0] - 1) * l.del[0] + c, d = l.ll[1] + (l.lim[1] - 1) * l.del[1] + c;
1938
+ if (!(u > e.y || v > e.x || d < e.y || g < e.x) && (s = es(e, a, l), !isNaN(s.x)))
1939
+ break t;
1940
+ }
1941
+ }
1942
+ return isNaN(s.x) ? (console.log("Failed to find a grid shift table for location '" + -e.x * z + " " + e.y * z + " tried: '" + r + "'"), -1) : (i.x = -s.x, i.y = s.y, 0);
1943
+ }
1944
+ function es(t, a, i) {
1945
+ var e = {
1946
+ x: NaN,
1947
+ y: NaN
1948
+ };
1949
+ if (isNaN(t.x)) return e;
1950
+ var s = {
1951
+ x: t.x,
1952
+ y: t.y
1953
+ };
1954
+ s.x -= i.ll[0], s.y -= i.ll[1], s.x = m(s.x - Math.PI) + Math.PI;
1955
+ var r = da(s, i);
1956
+ if (a) {
1957
+ if (isNaN(r.x)) return e;
1958
+ r.x = s.x - r.x, r.y = s.y - r.y;
1959
+ var n = 9, h = 1e-12, o, f;
1960
+ do {
1961
+ if (f = da(r, i), isNaN(f.x)) {
1962
+ console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");
1963
+ break;
1964
+ }
1965
+ o = {
1966
+ x: s.x - (f.x + r.x),
1967
+ y: s.y - (f.y + r.y)
1968
+ }, r.x += o.x, r.y += o.y;
1969
+ } while (n-- && Math.abs(o.x) > h && Math.abs(o.y) > h);
1970
+ if (n < 0)
1971
+ return console.log("Inverse grid shift iterator failed to converge."), e;
1972
+ e.x = m(r.x + i.ll[0]), e.y = r.y + i.ll[1];
1973
+ } else isNaN(r.x) || (e.x = t.x + r.x, e.y = t.y + r.y);
1974
+ return e;
1975
+ }
1976
+ function da(t, a) {
1977
+ var i = {
1978
+ x: t.x / a.del[0],
1979
+ y: t.y / a.del[1]
1980
+ }, e = {
1981
+ x: Math.floor(i.x),
1982
+ y: Math.floor(i.y)
1983
+ }, s = {
1984
+ x: i.x - 1 * e.x,
1985
+ y: i.y - 1 * e.y
1986
+ }, r = {
1987
+ x: NaN,
1988
+ y: NaN
1989
+ }, n;
1990
+ if (e.x < 0 || e.x >= a.lim[0] || e.y < 0 || e.y >= a.lim[1]) return r;
1991
+ n = e.y * a.lim[0] + e.x;
1992
+ var h = {
1993
+ x: a.cvs[n][0],
1994
+ y: a.cvs[n][1]
1995
+ };
1996
+ n++;
1997
+ var o = {
1998
+ x: a.cvs[n][0],
1999
+ y: a.cvs[n][1]
2000
+ };
2001
+ n += a.lim[0];
2002
+ var f = {
2003
+ x: a.cvs[n][0],
2004
+ y: a.cvs[n][1]
2005
+ };
2006
+ n--;
2007
+ var _ = {
2008
+ x: a.cvs[n][0],
2009
+ y: a.cvs[n][1]
2010
+ }, l = s.x * s.y, c = s.x * (1 - s.y), v = (1 - s.x) * (1 - s.y), u = (1 - s.x) * s.y;
2011
+ return r.x = v * h.x + c * o.x + u * _.x + l * f.x, r.y = v * h.y + c * o.y + u * _.y + l * f.y, r;
2012
+ }
2013
+ function ma(t, a, i) {
2014
+ var e = i.x, s = i.y, r = i.z || 0, n, h, o, f = {};
2015
+ for (o = 0; o < 3; o++)
2016
+ if (!(a && o === 2 && i.z === void 0))
2017
+ switch (o === 0 ? (n = e, "ew".indexOf(t.axis[o]) !== -1 ? h = "x" : h = "y") : o === 1 ? (n = s, "ns".indexOf(t.axis[o]) !== -1 ? h = "y" : h = "x") : (n = r, h = "z"), t.axis[o]) {
2018
+ case "e":
2019
+ f[h] = n;
2020
+ break;
2021
+ case "w":
2022
+ f[h] = -n;
2023
+ break;
2024
+ case "n":
2025
+ f[h] = n;
2026
+ break;
2027
+ case "s":
2028
+ f[h] = -n;
2029
+ break;
2030
+ case "u":
2031
+ i[h] !== void 0 && (f.z = n);
2032
+ break;
2033
+ case "d":
2034
+ i[h] !== void 0 && (f.z = -n);
2035
+ break;
2036
+ default:
2037
+ return null;
2038
+ }
2039
+ return f;
2040
+ }
2041
+ function Ba(t) {
2042
+ var a = {
2043
+ x: t[0],
2044
+ y: t[1]
2045
+ };
2046
+ return t.length > 2 && (a.z = t[2]), t.length > 3 && (a.m = t[3]), a;
2047
+ }
2048
+ function rs(t) {
2049
+ ya(t.x), ya(t.y);
2050
+ }
2051
+ function ya(t) {
2052
+ if (typeof Number.isFinite == "function") {
2053
+ if (Number.isFinite(t)) return;
2054
+ throw new TypeError("coordinates must be finite numbers");
2055
+ }
2056
+ if (typeof t != "number" || t !== t || !isFinite(t)) throw new TypeError("coordinates must be finite numbers");
2057
+ }
2058
+ function hs(t, a) {
2059
+ return (t.datum.datum_type === 1 || t.datum.datum_type === 2 || t.datum.datum_type === 3) && a.datumCode !== "WGS84" || (a.datum.datum_type === 1 || a.datum.datum_type === 2 || a.datum.datum_type === 3) && t.datumCode !== "WGS84";
2060
+ }
2061
+ function Lt(t, a, i, e) {
2062
+ var s;
2063
+ Array.isArray(i) ? i = Ba(i) : i = {
2064
+ x: i.x,
2065
+ y: i.y,
2066
+ z: i.z,
2067
+ m: i.m
2068
+ };
2069
+ var r = i.z !== void 0;
2070
+ if (rs(i), t.datum && a.datum && hs(t, a) && (s = new D("WGS84"), i = Lt(t, s, i, e), t = s), e && t.axis !== "enu" && (i = ma(t, !1, i)), t.projName === "longlat") i = {
2071
+ x: i.x * I,
2072
+ y: i.y * I,
2073
+ z: i.z || 0
2074
+ };
2075
+ else if (t.to_meter && (i = {
2076
+ x: i.x * t.to_meter,
2077
+ y: i.y * t.to_meter,
2078
+ z: i.z || 0
2079
+ }), i = t.inverse(i), !i) return;
2080
+ if (t.from_greenwich && (i.x += t.from_greenwich), i = ss(t.datum, a.datum, i), !!i)
2081
+ return i = i, a.from_greenwich && (i = {
2082
+ x: i.x - a.from_greenwich,
2083
+ y: i.y,
2084
+ z: i.z || 0
2085
+ }), a.projName === "longlat" ? i = {
2086
+ x: i.x * z,
2087
+ y: i.y * z,
2088
+ z: i.z || 0
2089
+ } : (i = a.forward(i), a.to_meter && (i = {
2090
+ x: i.x / a.to_meter,
2091
+ y: i.y / a.to_meter,
2092
+ z: i.z || 0
2093
+ })), e && a.axis !== "enu" ? ma(a, !0, i) : (i && !r && a.projName !== "geocent" && delete i.z, i);
2094
+ }
2095
+ var Ea = D("WGS84");
2096
+ function jt(t, a, i, e) {
2097
+ var s, r, n;
2098
+ return Array.isArray(i) ? (s = Lt(t, a, i, e) || {
2099
+ x: NaN,
2100
+ y: NaN
2101
+ }, i.length > 2 ? typeof t.name < "u" && t.name === "geocent" || typeof a.name < "u" && a.name === "geocent" ? typeof s.z == "number" ? [
2102
+ s.x,
2103
+ s.y,
2104
+ s.z
2105
+ ].concat(i.slice(3)) : [
2106
+ s.x,
2107
+ s.y,
2108
+ i[2]
2109
+ ].concat(i.slice(3)) : [s.x, s.y].concat(i.slice(2)) : [s.x, s.y]) : (r = Lt(t, a, i, e), n = Object.keys(i), n.length === 2 || n.forEach(function(h) {
2110
+ if (typeof t.name < "u" && t.name === "geocent" || typeof a.name < "u" && a.name === "geocent") {
2111
+ if (h === "x" || h === "y" || h === "z") return;
2112
+ } else if (h === "x" || h === "y") return;
2113
+ r[h] = i[h];
2114
+ }), r);
2115
+ }
2116
+ function At(t) {
2117
+ return t instanceof D ? t : typeof t == "object" && "oProj" in t ? t.oProj : D(t);
2118
+ }
2119
+ function ns(t, a, i) {
2120
+ var e, s, r = !1, n;
2121
+ return typeof a > "u" ? (s = At(t), e = Ea, r = !0) : (typeof a.x < "u" || Array.isArray(a)) && (i = a, s = At(t), e = Ea, r = !0), e || (e = At(t)), s || (s = At(a)), i ? jt(e, s, i) : (n = {
2122
+ forward: function(h, o) {
2123
+ return jt(e, s, h, o);
2124
+ },
2125
+ inverse: function(h, o) {
2126
+ return jt(s, e, h, o);
2127
+ }
2128
+ }, r && (n.oProj = s), n);
2129
+ }
2130
+ var Sa = 6, ja = "AJSAJS", za = "AFAFAF", st = 65, q = 73, F = 79, lt = 86, ft = 90, os = {
2131
+ forward: Wa,
2132
+ inverse: ls,
2133
+ toPoint: Qa
2134
+ };
2135
+ function Wa(t, a) {
2136
+ return a = a || 5, cs(fs({
2137
+ lat: t[1],
2138
+ lon: t[0]
2139
+ }), a);
2140
+ }
2141
+ function ls(t) {
2142
+ var a = Vt(Ka(t.toUpperCase()));
2143
+ return a.lat && a.lon ? [
2144
+ a.lon,
2145
+ a.lat,
2146
+ a.lon,
2147
+ a.lat
2148
+ ] : [
2149
+ a.left,
2150
+ a.bottom,
2151
+ a.right,
2152
+ a.top
2153
+ ];
2154
+ }
2155
+ function Qa(t) {
2156
+ var a = Vt(Ka(t.toUpperCase()));
2157
+ return a.lat && a.lon ? [a.lon, a.lat] : [(a.left + a.right) / 2, (a.top + a.bottom) / 2];
2158
+ }
2159
+ function zt(t) {
2160
+ return t * (Math.PI / 180);
2161
+ }
2162
+ function wa(t) {
2163
+ return 180 * (t / Math.PI);
2164
+ }
2165
+ function fs(t) {
2166
+ var a = t.lat, i = t.lon, e = 6378137, s = 669438e-8, r = 0.9996, n, h, o, f, _, l, c, v = zt(a), u = zt(i), g, d = Math.floor((i + 180) / 6) + 1;
2167
+ i === 180 && (d = 60), a >= 56 && a < 64 && i >= 3 && i < 12 && (d = 32), a >= 72 && a < 84 && (i >= 0 && i < 9 ? d = 31 : i >= 9 && i < 21 ? d = 33 : i >= 21 && i < 33 ? d = 35 : i >= 33 && i < 42 && (d = 37)), n = (d - 1) * 6 - 180 + 3, g = zt(n), h = s / (1 - s), o = e / Math.sqrt(1 - s * Math.sin(v) * Math.sin(v)), f = Math.tan(v) * Math.tan(v), _ = h * Math.cos(v) * Math.cos(v), l = Math.cos(v) * (u - g), c = e * ((1 - s / 4 - 3 * s * s / 64 - 5 * s * s * s / 256) * v - (3 * s / 8 + 3 * s * s / 32 + 45 * s * s * s / 1024) * Math.sin(2 * v) + (15 * s * s / 256 + 45 * s * s * s / 1024) * Math.sin(4 * v) - 35 * s * s * s / 3072 * Math.sin(6 * v));
2168
+ var y = r * o * (l + (1 - f + _) * l * l * l / 6 + (5 - 18 * f + f * f + 72 * _ - 58 * h) * l * l * l * l * l / 120) + 5e5, E = r * (c + o * Math.tan(v) * (l * l / 2 + (5 - f + 9 * _ + 4 * _ * _) * l * l * l * l / 24 + (61 - 58 * f + f * f + 600 * _ - 330 * h) * l * l * l * l * l * l / 720));
2169
+ return a < 0 && (E += 1e7), {
2170
+ northing: Math.round(E),
2171
+ easting: Math.round(y),
2172
+ zoneNumber: d,
2173
+ zoneLetter: _s(a)
2174
+ };
2175
+ }
2176
+ function Vt(t) {
2177
+ var a = t.northing, i = t.easting, e = t.zoneLetter, s = t.zoneNumber;
2178
+ if (s < 0 || s > 60) return null;
2179
+ var r = 0.9996, n = 6378137, h = 669438e-8, o, f = (1 - Math.sqrt(1 - h)) / (1 + Math.sqrt(1 - h)), _, l, c, v, u, g, d, y, E, S = i - 5e5, w = a;
2180
+ e < "N" && (w -= 1e7), d = (s - 1) * 6 - 180 + 3, o = h / (1 - h), g = w / r, y = g / (n * (1 - h / 4 - 3 * h * h / 64 - 5 * h * h * h / 256)), E = y + (3 * f / 2 - 27 * f * f * f / 32) * Math.sin(2 * y) + (21 * f * f / 16 - 55 * f * f * f * f / 32) * Math.sin(4 * y) + 151 * f * f * f / 96 * Math.sin(6 * y), _ = n / Math.sqrt(1 - h * Math.sin(E) * Math.sin(E)), l = Math.tan(E) * Math.tan(E), c = o * Math.cos(E) * Math.cos(E), v = n * (1 - h) / Math.pow(1 - h * Math.sin(E) * Math.sin(E), 1.5), u = S / (_ * r);
2181
+ var P = E - _ * Math.tan(E) / v * (u * u / 2 - (5 + 3 * l + 10 * c - 4 * c * c - 9 * o) * u * u * u * u / 24 + (61 + 90 * l + 298 * c + 45 * l * l - 252 * o - 3 * c * c) * u * u * u * u * u * u / 720);
2182
+ P = wa(P);
2183
+ var b = (u - (1 + 2 * l + c) * u * u * u / 6 + (5 - 2 * c + 28 * l - 3 * c * c + 8 * o + 24 * l * l) * u * u * u * u * u / 120) / Math.cos(E);
2184
+ b = d + wa(b);
2185
+ var A;
2186
+ if (t.accuracy) {
2187
+ var T = Vt({
2188
+ northing: t.northing + t.accuracy,
2189
+ easting: t.easting + t.accuracy,
2190
+ zoneLetter: t.zoneLetter,
2191
+ zoneNumber: t.zoneNumber
2192
+ });
2193
+ A = {
2194
+ top: T.lat,
2195
+ right: T.lon,
2196
+ bottom: P,
2197
+ left: b
2198
+ };
2199
+ } else A = {
2200
+ lat: P,
2201
+ lon: b
2202
+ };
2203
+ return A;
2204
+ }
2205
+ function _s(t) {
2206
+ var a = "Z";
2207
+ return 84 >= t && t >= 72 ? a = "X" : 72 > t && t >= 64 ? a = "W" : 64 > t && t >= 56 ? a = "V" : 56 > t && t >= 48 ? a = "U" : 48 > t && t >= 40 ? a = "T" : 40 > t && t >= 32 ? a = "S" : 32 > t && t >= 24 ? a = "R" : 24 > t && t >= 16 ? a = "Q" : 16 > t && t >= 8 ? a = "P" : 8 > t && t >= 0 ? a = "N" : 0 > t && t >= -8 ? a = "M" : -8 > t && t >= -16 ? a = "L" : -16 > t && t >= -24 ? a = "K" : -24 > t && t >= -32 ? a = "J" : -32 > t && t >= -40 ? a = "H" : -40 > t && t >= -48 ? a = "G" : -48 > t && t >= -56 ? a = "F" : -56 > t && t >= -64 ? a = "E" : -64 > t && t >= -72 ? a = "D" : -72 > t && t >= -80 && (a = "C"), a;
2208
+ }
2209
+ function cs(t, a) {
2210
+ var i = "00000" + t.easting, e = "00000" + t.northing;
2211
+ return t.zoneNumber + t.zoneLetter + us(t.easting, t.northing, t.zoneNumber) + i.substr(i.length - 5, a) + e.substr(e.length - 5, a);
2212
+ }
2213
+ function us(t, a, i) {
2214
+ var e = Ha(i);
2215
+ return vs(Math.floor(t / 1e5), Math.floor(a / 1e5) % 20, e);
2216
+ }
2217
+ function Ha(t) {
2218
+ var a = t % Sa;
2219
+ return a === 0 && (a = Sa), a;
2220
+ }
2221
+ function vs(t, a, i) {
2222
+ var e = i - 1, s = ja.charCodeAt(e), r = za.charCodeAt(e), n = s + t - 1, h = r + a, o = !1;
2223
+ return n > ft && (n = n - ft + st - 1, o = !0), (n === q || s < q && n > q || (n > q || s < q) && o) && n++, (n === F || s < F && n > F || (n > F || s < F) && o) && (n++, n === q && n++), n > ft && (n = n - ft + st - 1), h > lt ? (h = h - lt + st - 1, o = !0) : o = !1, (h === q || r < q && h > q || (h > q || r < q) && o) && h++, (h === F || r < F && h > F || (h > F || r < F) && o) && (h++, h === q && h++), h > lt && (h = h - lt + st - 1), String.fromCharCode(n) + String.fromCharCode(h);
2224
+ }
2225
+ function Ka(t) {
2226
+ if (t && t.length === 0) throw "MGRSPoint coverting from nothing";
2227
+ for (var a = t.length, i = null, e = "", s, r = 0; !/[A-Z]/.test(s = t.charAt(r)); ) {
2228
+ if (r >= 2) throw "MGRSPoint bad conversion from: " + t;
2229
+ e += s, r++;
2230
+ }
2231
+ var n = parseInt(e, 10);
2232
+ if (r === 0 || r + 3 > a) throw "MGRSPoint bad conversion from: " + t;
2233
+ var h = t.charAt(r++);
2234
+ if (h <= "A" || h === "B" || h === "Y" || h >= "Z" || h === "I" || h === "O") throw "MGRSPoint zone letter " + h + " not handled: " + t;
2235
+ i = t.substring(r, r += 2);
2236
+ for (var o = Ha(n), f = Ms(i.charAt(0), o), _ = gs(i.charAt(1), o); _ < ds(h); ) _ += 2e6;
2237
+ var l = a - r;
2238
+ if (l % 2 !== 0) throw `MGRSPoint has to have an even number
2239
+ of digits after the zone letter and two 100km letters - front
2240
+ half for easting meters, second half for
2241
+ northing meters` + t;
2242
+ var c = l / 2, v = 0, u = 0, g, d, y, E, S;
2243
+ return c > 0 && (g = 1e5 / Math.pow(10, c), d = t.substring(r, r + c), v = parseFloat(d) * g, y = t.substring(r + c), u = parseFloat(y) * g), E = v + f, S = u + _, {
2244
+ easting: E,
2245
+ northing: S,
2246
+ zoneLetter: h,
2247
+ zoneNumber: n,
2248
+ accuracy: g
2249
+ };
2250
+ }
2251
+ function Ms(t, a) {
2252
+ for (var i = ja.charCodeAt(a - 1), e = 1e5, s = !1; i !== t.charCodeAt(0); ) {
2253
+ if (i++, i === q && i++, i === F && i++, i > ft) {
2254
+ if (s) throw "Bad character: " + t;
2255
+ i = st, s = !0;
2256
+ }
2257
+ e += 1e5;
2258
+ }
2259
+ return e;
2260
+ }
2261
+ function gs(t, a) {
2262
+ if (t > "V") throw "MGRSPoint given invalid Northing " + t;
2263
+ for (var i = za.charCodeAt(a - 1), e = 0, s = !1; i !== t.charCodeAt(0); ) {
2264
+ if (i++, i === q && i++, i === F && i++, i > lt) {
2265
+ if (s) throw "Bad character: " + t;
2266
+ i = st, s = !0;
2267
+ }
2268
+ e += 1e5;
2269
+ }
2270
+ return e;
2271
+ }
2272
+ function ds(t) {
2273
+ var a;
2274
+ switch (t) {
2275
+ case "C":
2276
+ a = 11e5;
2277
+ break;
2278
+ case "D":
2279
+ a = 2e6;
2280
+ break;
2281
+ case "E":
2282
+ a = 28e5;
2283
+ break;
2284
+ case "F":
2285
+ a = 37e5;
2286
+ break;
2287
+ case "G":
2288
+ a = 46e5;
2289
+ break;
2290
+ case "H":
2291
+ a = 55e5;
2292
+ break;
2293
+ case "J":
2294
+ a = 64e5;
2295
+ break;
2296
+ case "K":
2297
+ a = 73e5;
2298
+ break;
2299
+ case "L":
2300
+ a = 82e5;
2301
+ break;
2302
+ case "M":
2303
+ a = 91e5;
2304
+ break;
2305
+ case "N":
2306
+ a = 0;
2307
+ break;
2308
+ case "P":
2309
+ a = 8e5;
2310
+ break;
2311
+ case "Q":
2312
+ a = 17e5;
2313
+ break;
2314
+ case "R":
2315
+ a = 26e5;
2316
+ break;
2317
+ case "S":
2318
+ a = 35e5;
2319
+ break;
2320
+ case "T":
2321
+ a = 44e5;
2322
+ break;
2323
+ case "U":
2324
+ a = 53e5;
2325
+ break;
2326
+ case "V":
2327
+ a = 62e5;
2328
+ break;
2329
+ case "W":
2330
+ a = 7e6;
2331
+ break;
2332
+ case "X":
2333
+ a = 79e5;
2334
+ break;
2335
+ default:
2336
+ a = -1;
2337
+ }
2338
+ if (a >= 0) return a;
2339
+ throw "Invalid zone letter: " + t;
2340
+ }
2341
+ function ht(t, a, i) {
2342
+ if (!(this instanceof ht)) return new ht(t, a, i);
2343
+ if (Array.isArray(t))
2344
+ this.x = t[0], this.y = t[1], this.z = t[2] || 0;
2345
+ else if (typeof t == "object")
2346
+ this.x = t.x, this.y = t.y, this.z = t.z || 0;
2347
+ else if (typeof t == "string" && typeof a > "u") {
2348
+ var e = t.split(",");
2349
+ this.x = parseFloat(e[0]), this.y = parseFloat(e[1]), this.z = parseFloat(e[2]) || 0;
2350
+ } else
2351
+ this.x = t, this.y = a, this.z = i || 0;
2352
+ console.warn("proj4.Point will be removed in version 3, use proj4.toPoint");
2353
+ }
2354
+ ht.fromMGRS = function(t) {
2355
+ return new ht(Qa(t));
2356
+ };
2357
+ ht.prototype.toMGRS = function(t) {
2358
+ return Wa([this.x, this.y], t);
2359
+ };
2360
+ var ms = 1, ys = 0.25, Pa = 0.046875, Ga = 0.01953125, xa = 0.01068115234375, Es = 0.75, Ss = 0.46875, ws = 0.013020833333333334, Ps = 0.007120768229166667, Gs = 0.3645833333333333, xs = 0.005696614583333333, bs = 0.3076171875;
2361
+ function Jt(t) {
2362
+ var a = [];
2363
+ a[0] = ms - t * (ys + t * (Pa + t * (Ga + t * xa))), a[1] = t * (Es - t * (Pa + t * (Ga + t * xa)));
2364
+ var i = t * t;
2365
+ return a[2] = i * (Ss - t * (ws + t * Ps)), i *= t, a[3] = i * (Gs - t * xs), a[4] = i * t * bs, a;
2366
+ }
2367
+ function nt(t, a, i, e) {
2368
+ return i *= a, a *= a, e[0] * t - i * (e[1] + a * (e[2] + a * (e[3] + a * e[4])));
2369
+ }
2370
+ var As = 20;
2371
+ function Zt(t, a, i) {
2372
+ for (var e = 1 / (1 - a), s = t, r = As; r; --r) {
2373
+ var n = Math.sin(s), h = 1 - a * n * n;
2374
+ if (h = (nt(s, n, Math.cos(s), i) - t) * (h * Math.sqrt(h)) * e, s -= h, Math.abs(h) < 1e-10) return s;
2375
+ }
2376
+ return s;
2377
+ }
2378
+ function Ns() {
2379
+ this.x0 = this.x0 !== void 0 ? this.x0 : 0, this.y0 = this.y0 !== void 0 ? this.y0 : 0, this.long0 = this.long0 !== void 0 ? this.long0 : 0, this.lat0 = this.lat0 !== void 0 ? this.lat0 : 0, this.es && (this.en = Jt(this.es), this.ml0 = nt(this.lat0, Math.sin(this.lat0), Math.cos(this.lat0), this.en));
2380
+ }
2381
+ function Is(t) {
2382
+ var a = t.x, i = t.y, e = m(a - this.long0, this.over), s, r, n, h = Math.sin(i), o = Math.cos(i);
2383
+ if (this.es) {
2384
+ var _ = o * e, l = Math.pow(_, 2), c = this.ep2 * Math.pow(o, 2), v = Math.pow(c, 2), u = Math.pow(Math.abs(o) > 1e-10 ? Math.tan(i) : 0, 2), g = Math.pow(u, 2);
2385
+ s = 1 - this.es * Math.pow(h, 2), _ = _ / Math.sqrt(s);
2386
+ var d = nt(i, h, o, this.en);
2387
+ r = this.a * (this.k0 * _ * (1 + l / 6 * (1 - u + c + l / 20 * (5 - 18 * u + g + 14 * c - 58 * u * c + l / 42 * (61 + 179 * g - g * u - 479 * u))))) + this.x0, n = this.a * (this.k0 * (d - this.ml0 + h * e * _ / 2 * (1 + l / 12 * (5 - u + 9 * c + 4 * v + l / 30 * (61 + g - 58 * u + 270 * c - 330 * u * c + l / 56 * (1385 + 543 * g - g * u - 3111 * u)))))) + this.y0;
2388
+ } else {
2389
+ var f = o * Math.sin(e);
2390
+ if (Math.abs(Math.abs(f) - 1) < 1e-10) return 93;
2391
+ if (r = 0.5 * this.a * this.k0 * Math.log((1 + f) / (1 - f)) + this.x0, n = o * Math.cos(e) / Math.sqrt(1 - Math.pow(f, 2)), f = Math.abs(n), f >= 1) {
2392
+ if (f - 1 > 1e-10) return 93;
2393
+ n = 0;
2394
+ } else n = Math.acos(n);
2395
+ i < 0 && (n = -n), n = this.a * this.k0 * (n - this.lat0) + this.y0;
2396
+ }
2397
+ return t.x = r, t.y = n, t;
2398
+ }
2399
+ function Cs(t) {
2400
+ var a, i, e, s, r = (t.x - this.x0) * (1 / this.a), n = (t.y - this.y0) * (1 / this.a);
2401
+ if (this.es)
2402
+ if (a = this.ml0 + n / this.k0, i = Zt(a, this.es, this.en), Math.abs(i) < M) {
2403
+ var l = Math.sin(i), c = Math.cos(i), v = Math.abs(c) > 1e-10 ? Math.tan(i) : 0, u = this.ep2 * Math.pow(c, 2), g = Math.pow(u, 2), d = Math.pow(v, 2), y = Math.pow(d, 2);
2404
+ a = 1 - this.es * Math.pow(l, 2);
2405
+ var E = r * Math.sqrt(a) / this.k0, S = Math.pow(E, 2);
2406
+ a = a * v, e = i - a * S / (1 - this.es) * 0.5 * (1 - S / 12 * (5 + 3 * d - 9 * u * d + u - 4 * g - S / 30 * (61 + 90 * d - 252 * u * d + 45 * y + 46 * u - S / 56 * (1385 + 3633 * d + 4095 * y + 1574 * y * d)))), s = m(this.long0 + E * (1 - S / 6 * (1 + 2 * d + u - S / 20 * (5 + 28 * d + 24 * y + 8 * u * d + 6 * u - S / 42 * (61 + 662 * d + 1320 * y + 720 * y * d)))) / c, this.over);
2407
+ } else
2408
+ e = M * St(n), s = 0;
2409
+ else {
2410
+ var h = Math.exp(r / this.k0), o = 0.5 * (h - 1 / h), f = this.lat0 + n / this.k0, _ = Math.cos(f);
2411
+ a = Math.sqrt((1 - Math.pow(_, 2)) / (1 + Math.pow(o, 2))), e = Math.asin(a), n < 0 && (e = -e), o === 0 && _ === 0 ? s = 0 : s = m(Math.atan2(o, _) + this.long0, this.over);
2412
+ }
2413
+ return t.x = s, t.y = e, t;
2414
+ }
2415
+ var Rs = ["Fast_Transverse_Mercator", "Fast Transverse Mercator"], Ct = {
2416
+ init: Ns,
2417
+ forward: Is,
2418
+ inverse: Cs,
2419
+ names: Rs
2420
+ };
2421
+ function Xa(t) {
2422
+ var a = Math.exp(t);
2423
+ return a = (a - 1 / a) / 2, a;
2424
+ }
2425
+ function U(t, a) {
2426
+ t = Math.abs(t), a = Math.abs(a);
2427
+ var i = Math.max(t, a), e = Math.min(t, a) / (i || 1);
2428
+ return i * Math.sqrt(1 + Math.pow(e, 2));
2429
+ }
2430
+ function Os(t) {
2431
+ var a = 1 + t, i = a - 1;
2432
+ return i === 0 ? t : t * Math.log(a) / i;
2433
+ }
2434
+ function Ts(t) {
2435
+ var a = Math.abs(t);
2436
+ return a = Os(a * (1 + a / (U(1, a) + 1))), t < 0 ? -a : a;
2437
+ }
2438
+ function Yt(t, a) {
2439
+ for (var i = 2 * Math.cos(2 * a), e = t.length - 1, s = t[e], r = 0, n; --e >= 0; )
2440
+ n = -r + i * s + t[e], r = s, s = n;
2441
+ return a + n * Math.sin(2 * a);
2442
+ }
2443
+ function ps(t, a) {
2444
+ for (var i = 2 * Math.cos(a), e = t.length - 1, s = t[e], r = 0, n; --e >= 0; )
2445
+ n = -r + i * s + t[e], r = s, s = n;
2446
+ return Math.sin(a) * n;
2447
+ }
2448
+ function Ls(t) {
2449
+ var a = Math.exp(t);
2450
+ return a = (a + 1 / a) / 2, a;
2451
+ }
2452
+ function Va(t, a, i) {
2453
+ for (var e = Math.sin(a), s = Math.cos(a), r = Xa(i), n = Ls(i), h = 2 * s * n, o = -2 * e * r, f = t.length - 1, _ = t[f], l = 0, c = 0, v = 0, u, g; --f >= 0; )
2454
+ u = c, g = l, c = _, l = v, _ = -u + h * c - o * l + t[f], v = -g + o * c + h * l;
2455
+ return h = e * n, o = s * r, [h * _ - o * v, h * v + o * _];
2456
+ }
2457
+ function qs() {
2458
+ if (!this.approx && (isNaN(this.es) || this.es <= 0)) throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');
2459
+ this.approx && (Ct.init.apply(this), this.forward = Ct.forward, this.inverse = Ct.inverse), this.x0 = this.x0 !== void 0 ? this.x0 : 0, this.y0 = this.y0 !== void 0 ? this.y0 : 0, this.long0 = this.long0 !== void 0 ? this.long0 : 0, this.lat0 = this.lat0 !== void 0 ? this.lat0 : 0, this.cgb = [], this.cbg = [], this.utg = [], this.gtu = [];
2460
+ var t = this.es / (1 + Math.sqrt(1 - this.es)), a = t / (2 - t), i = a;
2461
+ this.cgb[0] = a * (2 + a * (-2 / 3 + a * (-2 + a * (116 / 45 + a * (26 / 45 + a * (-2854 / 675)))))), this.cbg[0] = a * (-2 + a * (2 / 3 + a * (4 / 3 + a * (-82 / 45 + a * (32 / 45 + a * (4642 / 4725)))))), i = i * a, this.cgb[1] = i * (7 / 3 + a * (-8 / 5 + a * (-227 / 45 + a * (2704 / 315 + a * (2323 / 945))))), this.cbg[1] = i * (5 / 3 + a * (-16 / 15 + a * (-13 / 9 + a * (904 / 315 + a * (-1522 / 945))))), i = i * a, this.cgb[2] = i * (56 / 15 + a * (-136 / 35 + a * (-1262 / 105 + a * (73814 / 2835)))), this.cbg[2] = i * (-26 / 15 + a * (34 / 21 + a * (8 / 5 + a * (-12686 / 2835)))), i = i * a, this.cgb[3] = i * (4279 / 630 + a * (-332 / 35 + a * (-399572 / 14175))), this.cbg[3] = i * (1237 / 630 + a * (-12 / 5 + a * (-24832 / 14175))), i = i * a, this.cgb[4] = i * (4174 / 315 + a * (-144838 / 6237)), this.cbg[4] = i * (-734 / 315 + a * (109598 / 31185)), i = i * a, this.cgb[5] = i * (601676 / 22275), this.cbg[5] = i * (444337 / 155925), i = Math.pow(a, 2), this.Qn = this.k0 / (1 + a) * (1 + i * (1 / 4 + i * (1 / 64 + i / 256))), this.utg[0] = a * (-0.5 + a * (2 / 3 + a * (-37 / 96 + a * (1 / 360 + a * (81 / 512 + a * (-96199 / 604800)))))), this.gtu[0] = a * (0.5 + a * (-2 / 3 + a * (5 / 16 + a * (41 / 180 + a * (-127 / 288 + a * (7891 / 37800)))))), this.utg[1] = i * (-1 / 48 + a * (-1 / 15 + a * (437 / 1440 + a * (-46 / 105 + a * (1118711 / 3870720))))), this.gtu[1] = i * (13 / 48 + a * (-3 / 5 + a * (557 / 1440 + a * (281 / 630 + a * (-1983433 / 1935360))))), i = i * a, this.utg[2] = i * (-17 / 480 + a * (37 / 840 + a * (209 / 4480 + a * (-5569 / 90720)))), this.gtu[2] = i * (61 / 240 + a * (-103 / 140 + a * (15061 / 26880 + a * (167603 / 181440)))), i = i * a, this.utg[3] = i * (-4397 / 161280 + a * (11 / 504 + a * (830251 / 7257600))), this.gtu[3] = i * (49561 / 161280 + a * (-179 / 168 + a * (6601661 / 7257600))), i = i * a, this.utg[4] = i * (-4583 / 161280 + a * (108847 / 3991680)), this.gtu[4] = i * (34729 / 80640 + a * (-3418889 / 1995840)), i = i * a, this.utg[5] = i * (-20648693 / 638668800), this.gtu[5] = i * (212378941 / 319334400);
2462
+ var e = Yt(this.cbg, this.lat0);
2463
+ this.Zb = -this.Qn * (e + ps(this.gtu, 2 * e));
2464
+ }
2465
+ function Us(t) {
2466
+ var a = m(t.x - this.long0, this.over), i = t.y;
2467
+ i = Yt(this.cbg, i);
2468
+ var e = Math.sin(i), s = Math.cos(i), r = Math.sin(a), n = Math.cos(a);
2469
+ i = Math.atan2(e, n * s), a = Math.atan2(r * s, U(e, s * n)), a = Ts(Math.tan(a));
2470
+ var h = Va(this.gtu, 2 * i, 2 * a);
2471
+ i = i + h[0], a = a + h[1];
2472
+ var o, f;
2473
+ return Math.abs(a) <= 2.623395162778 ? (o = this.a * (this.Qn * a) + this.x0, f = this.a * (this.Qn * i + this.Zb) + this.y0) : (o = 1 / 0, f = 1 / 0), t.x = o, t.y = f, t;
2474
+ }
2475
+ function ks(t) {
2476
+ var a = (t.x - this.x0) * (1 / this.a), i = (t.y - this.y0) * (1 / this.a);
2477
+ i = (i - this.Zb) / this.Qn, a = a / this.Qn;
2478
+ var e, s;
2479
+ if (Math.abs(a) <= 2.623395162778) {
2480
+ var r = Va(this.utg, 2 * i, 2 * a);
2481
+ i = i + r[0], a = a + r[1], a = Math.atan(Xa(a));
2482
+ var n = Math.sin(i), h = Math.cos(i), o = Math.sin(a), f = Math.cos(a);
2483
+ i = Math.atan2(n * f, U(o, f * h)), a = Math.atan2(o, f * h), e = m(a + this.long0, this.over), s = Yt(this.cgb, i);
2484
+ } else
2485
+ e = 1 / 0, s = 1 / 0;
2486
+ return t.x = e, t.y = s, t;
2487
+ }
2488
+ var $s = [
2489
+ "Extended_Transverse_Mercator",
2490
+ "Extended Transverse Mercator",
2491
+ "etmerc",
2492
+ "Transverse_Mercator",
2493
+ "Transverse Mercator",
2494
+ "Gauss Kruger",
2495
+ "Gauss_Kruger",
2496
+ "tmerc"
2497
+ ], Rt = {
2498
+ init: qs,
2499
+ forward: Us,
2500
+ inverse: ks,
2501
+ names: $s
2502
+ };
2503
+ function Fs(t, a) {
2504
+ if (t === void 0) {
2505
+ if (t = Math.floor((m(a) + Math.PI) * 30 / Math.PI) + 1, t < 0) return 0;
2506
+ if (t > 60) return 60;
2507
+ }
2508
+ return t;
2509
+ }
2510
+ var Ds = "etmerc";
2511
+ function Bs() {
2512
+ var t = Fs(this.zone, this.long0);
2513
+ if (t === void 0) throw new Error("unknown utm zone");
2514
+ this.lat0 = 0, this.long0 = (6 * Math.abs(t) - 183) * I, this.x0 = 5e5, this.y0 = this.utmSouth ? 1e7 : 0, this.k0 = 0.9996, Rt.init.apply(this), this.forward = Rt.forward, this.inverse = Rt.inverse;
2515
+ }
2516
+ var js = ["Universal Transverse Mercator System", "utm"], zs = {
2517
+ init: Bs,
2518
+ names: js,
2519
+ dependsOn: Ds
2520
+ };
2521
+ function ta(t, a) {
2522
+ return Math.pow((1 - t) / (1 + t), a);
2523
+ }
2524
+ var Ws = 20;
2525
+ function Qs() {
2526
+ var t = Math.sin(this.lat0), a = Math.cos(this.lat0);
2527
+ a *= a, this.rc = Math.sqrt(1 - this.es) / (1 - this.es * t * t), this.C = Math.sqrt(1 + this.es * a * a / (1 - this.es)), this.phic0 = Math.asin(t / this.C), this.ratexp = 0.5 * this.C * this.e, this.K = Math.tan(0.5 * this.phic0 + G) / (Math.pow(Math.tan(0.5 * this.lat0 + G), this.C) * ta(this.e * t, this.ratexp));
2528
+ }
2529
+ function Hs(t) {
2530
+ var a = t.x, i = t.y;
2531
+ return t.y = 2 * Math.atan(this.K * Math.pow(Math.tan(0.5 * i + G), this.C) * ta(this.e * Math.sin(i), this.ratexp)) - M, t.x = this.C * a, t;
2532
+ }
2533
+ function Ks(t) {
2534
+ for (var a = 1e-14, i = t.x / this.C, e = t.y, s = Math.pow(Math.tan(0.5 * e + G) / this.K, 1 / this.C), r = Ws; r > 0 && (e = 2 * Math.atan(s * ta(this.e * Math.sin(t.y), -0.5 * this.e)) - M, !(Math.abs(e - t.y) < a)); --r)
2535
+ t.y = e;
2536
+ return r ? (t.x = i, t.y = e, t) : null;
2537
+ }
2538
+ var Xs = ["gauss"], aa = {
2539
+ init: Qs,
2540
+ forward: Hs,
2541
+ inverse: Ks,
2542
+ names: Xs
2543
+ };
2544
+ function Vs() {
2545
+ aa.init.apply(this), this.rc && (this.sinc0 = Math.sin(this.phic0), this.cosc0 = Math.cos(this.phic0), this.R2 = 2 * this.rc, this.title || (this.title = "Oblique Stereographic Alternative"));
2546
+ }
2547
+ function Js(t) {
2548
+ var a, i, e, s;
2549
+ return t.x = m(t.x - this.long0, this.over), aa.forward.apply(this, [t]), a = Math.sin(t.y), i = Math.cos(t.y), e = Math.cos(t.x), s = this.k0 * this.R2 / (1 + this.sinc0 * a + this.cosc0 * i * e), t.x = s * i * Math.sin(t.x), t.y = s * (this.cosc0 * a - this.sinc0 * i * e), t.x = this.a * t.x + this.x0, t.y = this.a * t.y + this.y0, t;
2550
+ }
2551
+ function Zs(t) {
2552
+ var a, i, e, s, r;
2553
+ if (t.x = (t.x - this.x0) / this.a, t.y = (t.y - this.y0) / this.a, t.x /= this.k0, t.y /= this.k0, r = U(t.x, t.y)) {
2554
+ var n = 2 * Math.atan2(r, this.R2);
2555
+ a = Math.sin(n), i = Math.cos(n), s = Math.asin(i * this.sinc0 + t.y * a * this.cosc0 / r), e = Math.atan2(t.x * a, r * this.cosc0 * i - t.y * this.sinc0 * a);
2556
+ } else
2557
+ s = this.phic0, e = 0;
2558
+ return t.x = e, t.y = s, aa.inverse.apply(this, [t]), t.x = m(t.x + this.long0, this.over), t;
2559
+ }
2560
+ var Ys = [
2561
+ "Stereographic_North_Pole",
2562
+ "Oblique_Stereographic",
2563
+ "sterea",
2564
+ "Oblique Stereographic Alternative",
2565
+ "Double_Stereographic"
2566
+ ], te = {
2567
+ init: Vs,
2568
+ forward: Js,
2569
+ inverse: Zs,
2570
+ names: Ys
2571
+ };
2572
+ function ia(t, a, i) {
2573
+ return a *= i, Math.tan(0.5 * (M + t)) * Math.pow((1 - a) / (1 + a), 0.5 * i);
2574
+ }
2575
+ function ae() {
2576
+ this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.lat0 = this.lat0 || 0, this.long0 = this.long0 || 0, this.coslat0 = Math.cos(this.lat0), this.sinlat0 = Math.sin(this.lat0), this.sphere ? this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= 1e-10 && (this.k0 = 0.5 * (1 + St(this.lat0) * Math.sin(this.lat_ts))) : (Math.abs(this.coslat0) <= 1e-10 && (this.lat0 > 0 ? this.con = 1 : this.con = -1), this.cons = Math.sqrt(Math.pow(1 + this.e, 1 + this.e) * Math.pow(1 - this.e, 1 - this.e)), this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= 1e-10 && Math.abs(Math.cos(this.lat_ts)) > 1e-10 && (this.k0 = 0.5 * this.cons * W(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)) / B(this.e, this.con * this.lat_ts, this.con * Math.sin(this.lat_ts))), this.ms1 = W(this.e, this.sinlat0, this.coslat0), this.X0 = 2 * Math.atan(ia(this.lat0, this.sinlat0, this.e)) - M, this.cosX0 = Math.cos(this.X0), this.sinX0 = Math.sin(this.X0));
2577
+ }
2578
+ function ie(t) {
2579
+ var a = t.x, i = t.y, e = Math.sin(i), s = Math.cos(i), r, n, h, o, f, _, l = m(a - this.long0, this.over);
2580
+ return Math.abs(Math.abs(a - this.long0) - Math.PI) <= 1e-10 && Math.abs(i + this.lat0) <= 1e-10 ? (t.x = NaN, t.y = NaN, t) : this.sphere ? (r = 2 * this.k0 / (1 + this.sinlat0 * e + this.coslat0 * s * Math.cos(l)), t.x = this.a * r * s * Math.sin(l) + this.x0, t.y = this.a * r * (this.coslat0 * e - this.sinlat0 * s * Math.cos(l)) + this.y0, t) : (n = 2 * Math.atan(ia(i, e, this.e)) - M, o = Math.cos(n), h = Math.sin(n), Math.abs(this.coslat0) <= 1e-10 ? (f = B(this.e, i * this.con, this.con * e), _ = 2 * this.a * this.k0 * f / this.cons, t.x = this.x0 + _ * Math.sin(a - this.long0), t.y = this.y0 - this.con * _ * Math.cos(a - this.long0), t) : (Math.abs(this.sinlat0) < 1e-10 ? (r = 2 * this.a * this.k0 / (1 + o * Math.cos(l)), t.y = r * h) : (r = 2 * this.a * this.k0 * this.ms1 / (this.cosX0 * (1 + this.sinX0 * h + this.cosX0 * o * Math.cos(l))), t.y = r * (this.cosX0 * h - this.sinX0 * o * Math.cos(l)) + this.y0), t.x = r * o * Math.sin(l) + this.x0, t));
2581
+ }
2582
+ function se(t) {
2583
+ t.x -= this.x0, t.y -= this.y0;
2584
+ var a, i, e, s, r, n = Math.sqrt(t.x * t.x + t.y * t.y);
2585
+ if (this.sphere) {
2586
+ var h = 2 * Math.atan(n / (2 * this.a * this.k0));
2587
+ return a = this.long0, i = this.lat0, n <= 1e-10 ? (t.x = a, t.y = i, t) : (i = Math.asin(Math.cos(h) * this.sinlat0 + t.y * Math.sin(h) * this.coslat0 / n), Math.abs(this.coslat0) < 1e-10 ? this.lat0 > 0 ? a = m(this.long0 + Math.atan2(t.x, -1 * t.y), this.over) : a = m(this.long0 + Math.atan2(t.x, t.y), this.over) : a = m(this.long0 + Math.atan2(t.x * Math.sin(h), n * this.coslat0 * Math.cos(h) - t.y * this.sinlat0 * Math.sin(h)), this.over), t.x = a, t.y = i, t);
2588
+ } else if (Math.abs(this.coslat0) <= 1e-10) {
2589
+ if (n <= 1e-10)
2590
+ return i = this.lat0, a = this.long0, t.x = a, t.y = i, t;
2591
+ t.x *= this.con, t.y *= this.con, e = n * this.cons / (2 * this.a * this.k0), i = this.con * yt(this.e, e), a = this.con * m(this.con * this.long0 + Math.atan2(t.x, -1 * t.y), this.over);
2592
+ } else
2593
+ s = 2 * Math.atan(n * this.cosX0 / (2 * this.a * this.k0 * this.ms1)), a = this.long0, n <= 1e-10 ? r = this.X0 : (r = Math.asin(Math.cos(s) * this.sinX0 + t.y * Math.sin(s) * this.cosX0 / n), a = m(this.long0 + Math.atan2(t.x * Math.sin(s), n * this.cosX0 * Math.cos(s) - t.y * this.sinX0 * Math.sin(s)), this.over)), i = -1 * yt(this.e, Math.tan(0.5 * (M + r)));
2594
+ return t.x = a, t.y = i, t;
2595
+ }
2596
+ var ee = [
2597
+ "stere",
2598
+ "Stereographic_South_Pole",
2599
+ "Polar_Stereographic_variant_A",
2600
+ "Polar_Stereographic_variant_B",
2601
+ "Polar_Stereographic"
2602
+ ], re = {
2603
+ init: ae,
2604
+ forward: ie,
2605
+ inverse: se,
2606
+ names: ee,
2607
+ ssfn_: ia
2608
+ };
2609
+ function he() {
2610
+ var t = this.lat0;
2611
+ this.lambda0 = this.long0;
2612
+ var a = Math.sin(t), i = this.a, e = 1 / this.rf, s = 2 * e - Math.pow(e, 2), r = this.e = Math.sqrt(s);
2613
+ this.R = this.k0 * i * Math.sqrt(1 - s) / (1 - s * Math.pow(a, 2)), this.alpha = Math.sqrt(1 + s / (1 - s) * Math.pow(Math.cos(t), 4)), this.b0 = Math.asin(a / this.alpha);
2614
+ var n = Math.log(Math.tan(Math.PI / 4 + this.b0 / 2)), h = Math.log(Math.tan(Math.PI / 4 + t / 2)), o = Math.log((1 + r * a) / (1 - r * a));
2615
+ this.K = n - this.alpha * h + this.alpha * r / 2 * o;
2616
+ }
2617
+ function ne(t) {
2618
+ var a = Math.log(Math.tan(Math.PI / 4 - t.y / 2)), i = this.e / 2 * Math.log((1 + this.e * Math.sin(t.y)) / (1 - this.e * Math.sin(t.y))), e = -this.alpha * (a + i) + this.K, s = 2 * (Math.atan(Math.exp(e)) - Math.PI / 4), r = this.alpha * (t.x - this.lambda0), n = Math.atan(Math.sin(r) / (Math.sin(this.b0) * Math.tan(s) + Math.cos(this.b0) * Math.cos(r))), h = Math.asin(Math.cos(this.b0) * Math.sin(s) - Math.sin(this.b0) * Math.cos(s) * Math.cos(r));
2619
+ return t.y = this.R / 2 * Math.log((1 + Math.sin(h)) / (1 - Math.sin(h))) + this.y0, t.x = this.R * n + this.x0, t;
2620
+ }
2621
+ function oe(t) {
2622
+ for (var a = t.x - this.x0, i = t.y - this.y0, e = a / this.R, s = 2 * (Math.atan(Math.exp(i / this.R)) - Math.PI / 4), r = Math.asin(Math.cos(this.b0) * Math.sin(s) + Math.sin(this.b0) * Math.cos(s) * Math.cos(e)), n = Math.atan(Math.sin(e) / (Math.cos(this.b0) * Math.cos(e) - Math.sin(this.b0) * Math.tan(s))), h = this.lambda0 + n / this.alpha, o = 0, f = r, _ = -1e3, l = 0; Math.abs(f - _) > 1e-7; ) {
2623
+ if (++l > 20) return;
2624
+ o = 1 / this.alpha * (Math.log(Math.tan(Math.PI / 4 + r / 2)) - this.K) + this.e * Math.log(Math.tan(Math.PI / 4 + Math.asin(this.e * Math.sin(f)) / 2)), _ = f, f = 2 * Math.atan(Math.exp(o)) - Math.PI / 2;
2625
+ }
2626
+ return t.x = h, t.y = f, t;
2627
+ }
2628
+ var le = ["somerc"], fe = {
2629
+ init: he,
2630
+ forward: ne,
2631
+ inverse: oe,
2632
+ names: le
2633
+ }, tt = 1e-7;
2634
+ function _e(t) {
2635
+ var a = [
2636
+ "Hotine_Oblique_Mercator",
2637
+ "Hotine_Oblique_Mercator_variant_A",
2638
+ "Hotine_Oblique_Mercator_Azimuth_Natural_Origin"
2639
+ ], i = typeof t.projName == "object" ? Object.keys(t.projName)[0] : t.projName;
2640
+ return "no_uoff" in t || "no_off" in t || a.indexOf(i) !== -1 || a.indexOf(ka(i)) !== -1;
2641
+ }
2642
+ function ce() {
2643
+ var t, a, i, e, s, r, n, h, o, f, _ = 0, l, c = 0, v = 0, u = 0, g = 0, d = 0, y = 0;
2644
+ this.no_off = _e(this), this.no_rot = "no_rot" in this;
2645
+ var E = !1;
2646
+ "alpha" in this && (E = !0);
2647
+ var S = !1;
2648
+ if ("rectified_grid_angle" in this && (S = !0), E && (y = this.alpha), S && (_ = this.rectified_grid_angle), E || S) c = this.longc;
2649
+ else if (v = this.long1, g = this.lat1, u = this.long2, d = this.lat2, Math.abs(g - d) <= tt || (t = Math.abs(g)) <= tt || Math.abs(t - M) <= tt || Math.abs(Math.abs(this.lat0) - M) <= tt || Math.abs(Math.abs(d) - M) <= tt) throw new Error();
2650
+ var w = 1 - this.es;
2651
+ a = Math.sqrt(w), Math.abs(this.lat0) > 1e-10 ? (h = Math.sin(this.lat0), i = Math.cos(this.lat0), t = 1 - this.es * h * h, this.B = i * i, this.B = Math.sqrt(1 + this.es * this.B * this.B / w), this.A = this.B * this.k0 * a / t, e = this.B * a / (i * Math.sqrt(t)), s = e * e - 1, s <= 0 ? s = 0 : (s = Math.sqrt(s), this.lat0 < 0 && (s = -s)), this.E = s += e, this.E *= Math.pow(B(this.e, this.lat0, h), this.B)) : (this.B = 1 / a, this.A = this.k0, this.E = e = s = 1), E || S ? (E ? (l = Math.asin(Math.sin(y) / e), S || (_ = y)) : (l = _, y = Math.asin(e * Math.sin(l))), this.lam0 = c - Math.asin(0.5 * (s - 1 / s) * Math.tan(l)) / this.B) : (r = Math.pow(B(this.e, g, Math.sin(g)), this.B), n = Math.pow(B(this.e, d, Math.sin(d)), this.B), s = this.E / r, o = (n - r) / (n + r), f = this.E * this.E, f = (f - n * r) / (f + n * r), t = v - u, t < -Math.PI ? u -= dt : t > Math.PI && (u += dt), this.lam0 = m(0.5 * (v + u) - Math.atan(f * Math.tan(0.5 * this.B * (v - u)) / o) / this.B, this.over), l = Math.atan(2 * Math.sin(this.B * m(v - this.lam0, this.over)) / (s - 1 / s)), _ = y = Math.asin(e * Math.sin(l))), this.singam = Math.sin(l), this.cosgam = Math.cos(l), this.sinrot = Math.sin(_), this.cosrot = Math.cos(_), this.rB = 1 / this.B, this.ArB = this.A * this.rB, this.BrA = 1 / this.ArB, this.no_off ? this.u_0 = 0 : (this.u_0 = Math.abs(this.ArB * Math.atan(Math.sqrt(e * e - 1) / Math.cos(y))), this.lat0 < 0 && (this.u_0 = -this.u_0)), s = 0.5 * l, this.v_pole_n = this.ArB * Math.log(Math.tan(G - s)), this.v_pole_s = this.ArB * Math.log(Math.tan(G + s));
2652
+ }
2653
+ function ue(t) {
2654
+ var a = {}, i, e, s, r, n, h, o, f;
2655
+ if (t.x = t.x - this.lam0, Math.abs(Math.abs(t.y) - M) > 1e-10) {
2656
+ if (n = this.E / Math.pow(B(this.e, t.y, Math.sin(t.y)), this.B), h = 1 / n, i = 0.5 * (n - h), e = 0.5 * (n + h), r = Math.sin(this.B * t.x), s = (i * this.singam - r * this.cosgam) / e, Math.abs(Math.abs(s) - 1) < 1e-10) throw new Error();
2657
+ f = 0.5 * this.ArB * Math.log((1 - s) / (1 + s)), h = Math.cos(this.B * t.x), Math.abs(h) < tt ? o = this.A * t.x : o = this.ArB * Math.atan2(i * this.cosgam + r * this.singam, h);
2658
+ } else
2659
+ f = t.y > 0 ? this.v_pole_n : this.v_pole_s, o = this.ArB * t.y;
2660
+ return this.no_rot ? (a.x = o, a.y = f) : (o -= this.u_0, a.x = f * this.cosrot + o * this.sinrot, a.y = o * this.cosrot - f * this.sinrot), a.x = this.a * a.x + this.x0, a.y = this.a * a.y + this.y0, a;
2661
+ }
2662
+ function ve(t) {
2663
+ var a, i, e, s, r, n, h, o = {};
2664
+ if (t.x = (t.x - this.x0) * (1 / this.a), t.y = (t.y - this.y0) * (1 / this.a), this.no_rot ? (i = t.y, a = t.x) : (i = t.x * this.cosrot - t.y * this.sinrot, a = t.y * this.cosrot + t.x * this.sinrot + this.u_0), e = Math.exp(-this.BrA * i), s = 0.5 * (e - 1 / e), r = 0.5 * (e + 1 / e), n = Math.sin(this.BrA * a), h = (n * this.cosgam + s * this.singam) / r, Math.abs(Math.abs(h) - 1) < 1e-10)
2665
+ o.x = 0, o.y = h < 0 ? -M : M;
2666
+ else {
2667
+ if (o.y = this.E / Math.sqrt((1 + h) / (1 - h)), o.y = yt(this.e, Math.pow(o.y, 1 / this.B)), o.y === 1 / 0) throw new Error();
2668
+ o.x = -this.rB * Math.atan2(s * this.cosgam - n * this.singam, Math.cos(this.BrA * a));
2669
+ }
2670
+ return o.x += this.lam0, o;
2671
+ }
2672
+ var Me = [
2673
+ "Hotine_Oblique_Mercator",
2674
+ "Hotine Oblique Mercator",
2675
+ "Hotine_Oblique_Mercator_variant_A",
2676
+ "Hotine_Oblique_Mercator_Variant_B",
2677
+ "Hotine_Oblique_Mercator_Azimuth_Natural_Origin",
2678
+ "Hotine_Oblique_Mercator_Two_Point_Natural_Origin",
2679
+ "Hotine_Oblique_Mercator_Azimuth_Center",
2680
+ "Oblique_Mercator",
2681
+ "omerc"
2682
+ ], ge = {
2683
+ init: ce,
2684
+ forward: ue,
2685
+ inverse: ve,
2686
+ names: Me
2687
+ };
2688
+ function de() {
2689
+ if (this.lat2 || (this.lat2 = this.lat1), this.k0 || (this.k0 = 1), this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, !(Math.abs(this.lat1 + this.lat2) < 1e-10)) {
2690
+ var t = this.b / this.a;
2691
+ this.e = Math.sqrt(1 - t * t);
2692
+ var a = Math.sin(this.lat1), i = Math.cos(this.lat1), e = W(this.e, a, i), s = B(this.e, this.lat1, a), r = Math.sin(this.lat2), n = Math.cos(this.lat2), h = W(this.e, r, n), o = B(this.e, this.lat2, r), f = Math.abs(Math.abs(this.lat0) - M) < 1e-10 ? 0 : B(this.e, this.lat0, Math.sin(this.lat0));
2693
+ Math.abs(this.lat1 - this.lat2) > 1e-10 ? this.ns = Math.log(e / h) / Math.log(s / o) : this.ns = a, isNaN(this.ns) && (this.ns = a), this.f0 = e / (this.ns * Math.pow(s, this.ns)), this.rh = this.a * this.f0 * Math.pow(f, this.ns), this.title || (this.title = "Lambert Conformal Conic");
2694
+ }
2695
+ }
2696
+ function me(t) {
2697
+ var a = t.x, i = t.y;
2698
+ Math.abs(2 * Math.abs(i) - Math.PI) <= 1e-10 && (i = St(i) * (M - 2 * Na));
2699
+ var e = Math.abs(Math.abs(i) - M), s, r;
2700
+ if (e > 1e-10)
2701
+ s = B(this.e, i, Math.sin(i)), r = this.a * this.f0 * Math.pow(s, this.ns);
2702
+ else {
2703
+ if (e = i * this.ns, e <= 0) return null;
2704
+ r = 0;
2705
+ }
2706
+ var n = this.ns * m(a - this.long0, this.over);
2707
+ return t.x = this.k0 * (r * Math.sin(n)) + this.x0, t.y = this.k0 * (this.rh - r * Math.cos(n)) + this.y0, t;
2708
+ }
2709
+ function ye(t) {
2710
+ var a, i, e, s, r, n = (t.x - this.x0) / this.k0, h = this.rh - (t.y - this.y0) / this.k0;
2711
+ this.ns > 0 ? (a = Math.sqrt(n * n + h * h), i = 1) : (a = -Math.sqrt(n * n + h * h), i = -1);
2712
+ var o = 0;
2713
+ if (a !== 0 && (o = Math.atan2(i * n, i * h)), a !== 0 || this.ns > 0) {
2714
+ if (i = 1 / this.ns, e = Math.pow(a / (this.a * this.f0), i), s = yt(this.e, e), s === -9999) return null;
2715
+ } else s = -M;
2716
+ return r = m(o / this.ns + this.long0, this.over), t.x = r, t.y = s, t;
2717
+ }
2718
+ var Ee = [
2719
+ "Lambert Tangential Conformal Conic Projection",
2720
+ "Lambert_Conformal_Conic",
2721
+ "Lambert_Conformal_Conic_1SP",
2722
+ "Lambert_Conformal_Conic_2SP",
2723
+ "lcc",
2724
+ "Lambert Conic Conformal (1SP)",
2725
+ "Lambert Conic Conformal (2SP)"
2726
+ ], Se = {
2727
+ init: de,
2728
+ forward: me,
2729
+ inverse: ye,
2730
+ names: Ee
2731
+ };
2732
+ function we() {
2733
+ this.a = 6377397155e-3, this.es = 0.006674372230614, this.e = Math.sqrt(this.es), this.lat0 || (this.lat0 = 0.863937979737193), this.long0 || (this.long0 = 0.4334234309119251), this.k0 || (this.k0 = 0.9999), this.s45 = 0.785398163397448, this.s90 = 2 * this.s45, this.fi0 = this.lat0, this.e2 = this.es, this.e = Math.sqrt(this.e2), this.alfa = Math.sqrt(1 + this.e2 * Math.pow(Math.cos(this.fi0), 4) / (1 - this.e2)), this.uq = 1.04216856380474, this.u0 = Math.asin(Math.sin(this.fi0) / this.alfa), this.g = Math.pow((1 + this.e * Math.sin(this.fi0)) / (1 - this.e * Math.sin(this.fi0)), this.alfa * this.e / 2), this.k = Math.tan(this.u0 / 2 + this.s45) / Math.pow(Math.tan(this.fi0 / 2 + this.s45), this.alfa) * this.g, this.k1 = this.k0, this.n0 = this.a * Math.sqrt(1 - this.e2) / (1 - this.e2 * Math.pow(Math.sin(this.fi0), 2)), this.s0 = 1.37008346281555, this.n = Math.sin(this.s0), this.ro0 = this.k1 * this.n0 / Math.tan(this.s0), this.ad = this.s90 - this.uq;
2734
+ }
2735
+ function Pe(t) {
2736
+ var a, i, e, s, r, n, h, o = t.x, f = t.y, _ = m(o - this.long0, this.over);
2737
+ return a = Math.pow((1 + this.e * Math.sin(f)) / (1 - this.e * Math.sin(f)), this.alfa * this.e / 2), i = 2 * (Math.atan(this.k * Math.pow(Math.tan(f / 2 + this.s45), this.alfa) / a) - this.s45), e = -_ * this.alfa, s = Math.asin(Math.cos(this.ad) * Math.sin(i) + Math.sin(this.ad) * Math.cos(i) * Math.cos(e)), r = Math.asin(Math.cos(i) * Math.sin(e) / Math.cos(s)), n = this.n * r, h = this.ro0 * Math.pow(Math.tan(this.s0 / 2 + this.s45), this.n) / Math.pow(Math.tan(s / 2 + this.s45), this.n), t.y = h * Math.cos(n) / 1, t.x = h * Math.sin(n) / 1, this.czech || (t.y *= -1, t.x *= -1), t;
2738
+ }
2739
+ function Ge(t) {
2740
+ var a, i, e, s, r, n, h, o, f = t.x;
2741
+ t.x = t.y, t.y = f, this.czech || (t.y *= -1, t.x *= -1), n = Math.sqrt(t.x * t.x + t.y * t.y), r = Math.atan2(t.y, t.x), s = r / Math.sin(this.s0), e = 2 * (Math.atan(Math.pow(this.ro0 / n, 1 / this.n) * Math.tan(this.s0 / 2 + this.s45)) - this.s45), a = Math.asin(Math.cos(this.ad) * Math.sin(e) - Math.sin(this.ad) * Math.cos(e) * Math.cos(s)), i = Math.asin(Math.cos(e) * Math.sin(s) / Math.cos(a)), t.x = this.long0 - i / this.alfa, h = a, o = 0;
2742
+ var _ = 0;
2743
+ do
2744
+ t.y = 2 * (Math.atan(Math.pow(this.k, -1 / this.alfa) * Math.pow(Math.tan(a / 2 + this.s45), 1 / this.alfa) * Math.pow((1 + this.e * Math.sin(h)) / (1 - this.e * Math.sin(h)), this.e / 2)) - this.s45), Math.abs(h - t.y) < 1e-10 && (o = 1), h = t.y, _ += 1;
2745
+ while (o === 0 && _ < 15);
2746
+ return _ >= 15 ? null : t;
2747
+ }
2748
+ var xe = [
2749
+ "Krovak",
2750
+ "Krovak Modified",
2751
+ "Krovak (North Orientated)",
2752
+ "Krovak Modified (North Orientated)",
2753
+ "krovak"
2754
+ ], be = {
2755
+ init: we,
2756
+ forward: Pe,
2757
+ inverse: Ge,
2758
+ names: xe
2759
+ };
2760
+ function L(t, a, i, e, s) {
2761
+ return t * s - a * Math.sin(2 * s) + i * Math.sin(4 * s) - e * Math.sin(6 * s);
2762
+ }
2763
+ function wt(t) {
2764
+ return 1 - 0.25 * t * (1 + t / 16 * (3 + 1.25 * t));
2765
+ }
2766
+ function Pt(t) {
2767
+ return 0.375 * t * (1 + 0.25 * t * (1 + 0.46875 * t));
2768
+ }
2769
+ function Gt(t) {
2770
+ return 0.05859375 * t * t * (1 + 0.75 * t);
2771
+ }
2772
+ function xt(t) {
2773
+ return t * t * t * (35 / 3072);
2774
+ }
2775
+ function sa(t, a, i) {
2776
+ var e = a * i;
2777
+ return t / Math.sqrt(1 - e * e);
2778
+ }
2779
+ function Z(t) {
2780
+ return Math.abs(t) < M ? t : t - St(t) * Math.PI;
2781
+ }
2782
+ function qt(t, a, i, e, s) {
2783
+ var r, n;
2784
+ r = t / a;
2785
+ for (var h = 0; h < 15; h++)
2786
+ if (n = (t - (a * r - i * Math.sin(2 * r) + e * Math.sin(4 * r) - s * Math.sin(6 * r))) / (a - 2 * i * Math.cos(2 * r) + 4 * e * Math.cos(4 * r) - 6 * s * Math.cos(6 * r)), r += n, Math.abs(n) <= 1e-10) return r;
2787
+ return NaN;
2788
+ }
2789
+ function Ae() {
2790
+ this.sphere || (this.e0 = wt(this.es), this.e1 = Pt(this.es), this.e2 = Gt(this.es), this.e3 = xt(this.es), this.ml0 = this.a * L(this.e0, this.e1, this.e2, this.e3, this.lat0));
2791
+ }
2792
+ function Ne(t) {
2793
+ var a, i, e = t.x, s = t.y;
2794
+ if (e = m(e - this.long0, this.over), this.sphere)
2795
+ a = this.a * Math.asin(Math.cos(s) * Math.sin(e)), i = this.a * (Math.atan2(Math.tan(s), Math.cos(e)) - this.lat0);
2796
+ else {
2797
+ var r = Math.sin(s), n = Math.cos(s), h = sa(this.a, this.e, r), o = Math.tan(s) * Math.tan(s), f = e * Math.cos(s), _ = f * f, l = this.es * n * n / (1 - this.es), c = this.a * L(this.e0, this.e1, this.e2, this.e3, s);
2798
+ a = h * f * (1 - _ * o * (1 / 6 - (8 - o + 8 * l) * _ / 120)), i = c - this.ml0 + h * r / n * _ * (0.5 + (5 - o + 6 * l) * _ / 24);
2799
+ }
2800
+ return t.x = a + this.x0, t.y = i + this.y0, t;
2801
+ }
2802
+ function Ie(t) {
2803
+ t.x -= this.x0, t.y -= this.y0;
2804
+ var a = t.x / this.a, i = t.y / this.a, e, s;
2805
+ if (this.sphere) {
2806
+ var r = i + this.lat0;
2807
+ e = Math.asin(Math.sin(r) * Math.cos(a)), s = Math.atan2(Math.tan(a), Math.cos(r));
2808
+ } else {
2809
+ var n = qt(this.ml0 / this.a + i, this.e0, this.e1, this.e2, this.e3);
2810
+ if (Math.abs(Math.abs(n) - M) <= 1e-10)
2811
+ return t.x = this.long0, t.y = M, i < 0 && (t.y *= -1), t;
2812
+ var h = sa(this.a, this.e, Math.sin(n)), o = h * h * h / this.a / this.a * (1 - this.es), f = Math.pow(Math.tan(n), 2), _ = a * this.a / h, l = _ * _;
2813
+ e = n - h * Math.tan(n) / o * _ * _ * (0.5 - (1 + 3 * f) * _ * _ / 24), s = _ * (1 - l * (f / 3 + (1 + 3 * f) * f * l / 15)) / Math.cos(n);
2814
+ }
2815
+ return t.x = m(s + this.long0, this.over), t.y = Z(e), t;
2816
+ }
2817
+ var Ce = [
2818
+ "Cassini",
2819
+ "Cassini_Soldner",
2820
+ "cass"
2821
+ ], Re = {
2822
+ init: Ae,
2823
+ forward: Ne,
2824
+ inverse: Ie,
2825
+ names: Ce
2826
+ };
2827
+ function X(t, a) {
2828
+ var i;
2829
+ return t > 1e-7 ? (i = t * a, (1 - t * t) * (a / (1 - i * i) - 0.5 / t * Math.log((1 - i) / (1 + i)))) : 2 * a;
2830
+ }
2831
+ function Oe() {
2832
+ var t = Math.abs(this.lat0);
2833
+ if (Math.abs(t - M) < 1e-10 ? this.mode = this.lat0 < 0 ? 1 : 2 : Math.abs(t) < 1e-10 ? this.mode = 3 : this.mode = 4, this.es > 0) {
2834
+ var a;
2835
+ switch (this.qp = X(this.e, 1), this.mmf = 0.5 / (1 - this.es), this.apa = De(this.es), this.mode) {
2836
+ case 2:
2837
+ this.dd = 1;
2838
+ break;
2839
+ case 1:
2840
+ this.dd = 1;
2841
+ break;
2842
+ case 3:
2843
+ this.rq = Math.sqrt(0.5 * this.qp), this.dd = 1 / this.rq, this.xmf = 1, this.ymf = 0.5 * this.qp;
2844
+ break;
2845
+ case 4:
2846
+ this.rq = Math.sqrt(0.5 * this.qp), a = Math.sin(this.lat0), this.sinb1 = X(this.e, a) / this.qp, this.cosb1 = Math.sqrt(1 - this.sinb1 * this.sinb1), this.dd = Math.cos(this.lat0) / (Math.sqrt(1 - this.es * a * a) * this.rq * this.cosb1), this.ymf = (this.xmf = this.rq) / this.dd, this.xmf *= this.dd;
2847
+ break;
2848
+ }
2849
+ } else this.mode === 4 && (this.sinph0 = Math.sin(this.lat0), this.cosph0 = Math.cos(this.lat0));
2850
+ }
2851
+ function Te(t) {
2852
+ var a, i, e, s, r, n, h, o, f, _, l = t.x, c = t.y;
2853
+ if (l = m(l - this.long0, this.over), this.sphere) {
2854
+ if (r = Math.sin(c), _ = Math.cos(c), e = Math.cos(l), this.mode === this.OBLIQ || this.mode === this.EQUIT) {
2855
+ if (i = this.mode === this.EQUIT ? 1 + _ * e : 1 + this.sinph0 * r + this.cosph0 * _ * e, i <= 1e-10) return null;
2856
+ i = Math.sqrt(2 / i), a = i * _ * Math.sin(l), i *= this.mode === this.EQUIT ? r : this.cosph0 * r - this.sinph0 * _ * e;
2857
+ } else if (this.mode === this.N_POLE || this.mode === this.S_POLE) {
2858
+ if (this.mode === this.N_POLE && (e = -e), Math.abs(c + this.lat0) < 1e-10) return null;
2859
+ i = G - c * 0.5, i = 2 * (this.mode === this.S_POLE ? Math.cos(i) : Math.sin(i)), a = i * Math.sin(l), i *= e;
2860
+ }
2861
+ } else {
2862
+ switch (h = 0, o = 0, f = 0, e = Math.cos(l), s = Math.sin(l), r = Math.sin(c), n = X(this.e, r), (this.mode === this.OBLIQ || this.mode === this.EQUIT) && (h = n / this.qp, o = Math.sqrt(1 - h * h)), this.mode) {
2863
+ case this.OBLIQ:
2864
+ f = 1 + this.sinb1 * h + this.cosb1 * o * e;
2865
+ break;
2866
+ case this.EQUIT:
2867
+ f = 1 + o * e;
2868
+ break;
2869
+ case this.N_POLE:
2870
+ f = M + c, n = this.qp - n;
2871
+ break;
2872
+ case this.S_POLE:
2873
+ f = c - M, n = this.qp + n;
2874
+ break;
2875
+ }
2876
+ if (Math.abs(f) < 1e-10) return null;
2877
+ switch (this.mode) {
2878
+ case this.OBLIQ:
2879
+ case this.EQUIT:
2880
+ f = Math.sqrt(2 / f), this.mode === this.OBLIQ ? i = this.ymf * f * (this.cosb1 * h - this.sinb1 * o * e) : i = (f = Math.sqrt(2 / (1 + o * e))) * h * this.ymf, a = this.xmf * f * o * s;
2881
+ break;
2882
+ case this.N_POLE:
2883
+ case this.S_POLE:
2884
+ n >= 0 ? (a = (f = Math.sqrt(n)) * s, i = e * (this.mode === this.S_POLE ? f : -f)) : a = i = 0;
2885
+ break;
2886
+ }
2887
+ }
2888
+ return t.x = this.a * a + this.x0, t.y = this.a * i + this.y0, t;
2889
+ }
2890
+ function pe(t) {
2891
+ t.x -= this.x0, t.y -= this.y0;
2892
+ var a = t.x / this.a, i = t.y / this.a, e, s, r, n, h, o, f;
2893
+ if (this.sphere) {
2894
+ var _ = 0, l, c = 0;
2895
+ if (l = Math.sqrt(a * a + i * i), s = l * 0.5, s > 1) return null;
2896
+ switch (s = 2 * Math.asin(s), (this.mode === this.OBLIQ || this.mode === this.EQUIT) && (c = Math.sin(s), _ = Math.cos(s)), this.mode) {
2897
+ case this.EQUIT:
2898
+ s = Math.abs(l) <= 1e-10 ? 0 : Math.asin(i * c / l), a *= c, i = _ * l;
2899
+ break;
2900
+ case this.OBLIQ:
2901
+ s = Math.abs(l) <= 1e-10 ? this.lat0 : Math.asin(_ * this.sinph0 + i * c * this.cosph0 / l), a *= c * this.cosph0, i = (_ - Math.sin(s) * this.sinph0) * l;
2902
+ break;
2903
+ case this.N_POLE:
2904
+ i = -i, s = M - s;
2905
+ break;
2906
+ case this.S_POLE:
2907
+ s -= M;
2908
+ break;
2909
+ }
2910
+ e = i === 0 && (this.mode === this.EQUIT || this.mode === this.OBLIQ) ? 0 : Math.atan2(a, i);
2911
+ } else {
2912
+ if (f = 0, this.mode === this.OBLIQ || this.mode === this.EQUIT) {
2913
+ if (a /= this.dd, i *= this.dd, o = Math.sqrt(a * a + i * i), o < 1e-10)
2914
+ return t.x = this.long0, t.y = this.lat0, t;
2915
+ n = 2 * Math.asin(0.5 * o / this.rq), r = Math.cos(n), a *= n = Math.sin(n), this.mode === this.OBLIQ ? (f = r * this.sinb1 + i * n * this.cosb1 / o, h = this.qp * f, i = o * this.cosb1 * r - i * this.sinb1 * n) : (f = i * n / o, h = this.qp * f, i = o * r);
2916
+ } else if (this.mode === this.N_POLE || this.mode === this.S_POLE) {
2917
+ if (this.mode === this.N_POLE && (i = -i), h = a * a + i * i, !h)
2918
+ return t.x = this.long0, t.y = this.lat0, t;
2919
+ f = 1 - h / this.qp, this.mode === this.S_POLE && (f = -f);
2920
+ }
2921
+ e = Math.atan2(a, i), s = Be(Math.asin(f), this.apa);
2922
+ }
2923
+ return t.x = m(this.long0 + e, this.over), t.y = s, t;
2924
+ }
2925
+ var Le = 0.3333333333333333, qe = 0.17222222222222222, Ue = 0.10257936507936508, ke = 0.06388888888888888, $e = 0.0664021164021164, Fe = 0.016415012942191543;
2926
+ function De(t) {
2927
+ var a, i = [];
2928
+ return i[0] = t * Le, a = t * t, i[0] += a * qe, i[1] = a * ke, a *= t, i[0] += a * Ue, i[1] += a * $e, i[2] = a * Fe, i;
2929
+ }
2930
+ function Be(t, a) {
2931
+ var i = t + t;
2932
+ return t + a[0] * Math.sin(i) + a[1] * Math.sin(i + i) + a[2] * Math.sin(i + i + i);
2933
+ }
2934
+ var je = [
2935
+ "Lambert Azimuthal Equal Area",
2936
+ "Lambert_Azimuthal_Equal_Area",
2937
+ "laea"
2938
+ ], ze = {
2939
+ init: Oe,
2940
+ forward: Te,
2941
+ inverse: pe,
2942
+ names: je,
2943
+ S_POLE: 1,
2944
+ N_POLE: 2,
2945
+ EQUIT: 3,
2946
+ OBLIQ: 4
2947
+ };
2948
+ function J(t) {
2949
+ return Math.abs(t) > 1 && (t = t > 1 ? 1 : -1), Math.asin(t);
2950
+ }
2951
+ function We() {
2952
+ Math.abs(this.lat1 + this.lat2) < 1e-10 || (this.temp = this.b / this.a, this.es = 1 - Math.pow(this.temp, 2), this.e3 = Math.sqrt(this.es), this.sin_po = Math.sin(this.lat1), this.cos_po = Math.cos(this.lat1), this.t1 = this.sin_po, this.con = this.sin_po, this.ms1 = W(this.e3, this.sin_po, this.cos_po), this.qs1 = X(this.e3, this.sin_po), this.sin_po = Math.sin(this.lat2), this.cos_po = Math.cos(this.lat2), this.t2 = this.sin_po, this.ms2 = W(this.e3, this.sin_po, this.cos_po), this.qs2 = X(this.e3, this.sin_po), this.sin_po = Math.sin(this.lat0), this.cos_po = Math.cos(this.lat0), this.t3 = this.sin_po, this.qs0 = X(this.e3, this.sin_po), Math.abs(this.lat1 - this.lat2) > 1e-10 ? this.ns0 = (this.ms1 * this.ms1 - this.ms2 * this.ms2) / (this.qs2 - this.qs1) : this.ns0 = this.con, this.c = this.ms1 * this.ms1 + this.ns0 * this.qs1, this.rh = this.a * Math.sqrt(this.c - this.ns0 * this.qs0) / this.ns0);
2953
+ }
2954
+ function Qe(t) {
2955
+ var a = t.x, i = t.y;
2956
+ this.sin_phi = Math.sin(i), this.cos_phi = Math.cos(i);
2957
+ var e = X(this.e3, this.sin_phi), s = this.a * Math.sqrt(this.c - this.ns0 * e) / this.ns0, r = this.ns0 * m(a - this.long0, this.over), n = s * Math.sin(r) + this.x0, h = this.rh - s * Math.cos(r) + this.y0;
2958
+ return t.x = n, t.y = h, t;
2959
+ }
2960
+ function He(t) {
2961
+ var a, i, e, s, r, n;
2962
+ return t.x -= this.x0, t.y = this.rh - t.y + this.y0, this.ns0 >= 0 ? (a = Math.sqrt(t.x * t.x + t.y * t.y), e = 1) : (a = -Math.sqrt(t.x * t.x + t.y * t.y), e = -1), s = 0, a !== 0 && (s = Math.atan2(e * t.x, e * t.y)), e = a * this.ns0 / this.a, this.sphere ? n = Math.asin((this.c - e * e) / (2 * this.ns0)) : (i = (this.c - e * e) / this.ns0, n = this.phi1z(this.e3, i)), r = m(s / this.ns0 + this.long0, this.over), t.x = r, t.y = n, t;
2963
+ }
2964
+ function Ke(t, a) {
2965
+ var i, e, s, r, n, h = J(0.5 * a);
2966
+ if (t < 1e-10) return h;
2967
+ for (var o = t * t, f = 1; f <= 25; f++)
2968
+ if (i = Math.sin(h), e = Math.cos(h), s = t * i, r = 1 - s * s, n = 0.5 * r * r / e * (a / (1 - o) - i / r + 0.5 / t * Math.log((1 - s) / (1 + s))), h = h + n, Math.abs(n) <= 1e-7) return h;
2969
+ return null;
2970
+ }
2971
+ var Xe = [
2972
+ "Albers_Conic_Equal_Area",
2973
+ "Albers_Equal_Area",
2974
+ "Albers",
2975
+ "aea"
2976
+ ], Ve = {
2977
+ init: We,
2978
+ forward: Qe,
2979
+ inverse: He,
2980
+ names: Xe,
2981
+ phi1z: Ke
2982
+ };
2983
+ function Je() {
2984
+ this.sin_p14 = Math.sin(this.lat0), this.cos_p14 = Math.cos(this.lat0), this.infinity_dist = 1e3 * this.a, this.rc = 1;
2985
+ }
2986
+ function Ze(t) {
2987
+ var a, i, e, s, r, n, h, o, f = t.x, _ = t.y;
2988
+ return e = m(f - this.long0, this.over), a = Math.sin(_), i = Math.cos(_), s = Math.cos(e), n = this.sin_p14 * a + this.cos_p14 * i * s, r = 1, n > 0 || Math.abs(n) <= 1e-10 ? (h = this.x0 + this.a * r * i * Math.sin(e) / n, o = this.y0 + this.a * r * (this.cos_p14 * a - this.sin_p14 * i * s) / n) : (h = this.x0 + this.infinity_dist * i * Math.sin(e), o = this.y0 + this.infinity_dist * (this.cos_p14 * a - this.sin_p14 * i * s)), t.x = h, t.y = o, t;
2989
+ }
2990
+ function Ye(t) {
2991
+ var a, i, e, s, r, n;
2992
+ return t.x = (t.x - this.x0) / this.a, t.y = (t.y - this.y0) / this.a, t.x /= this.k0, t.y /= this.k0, (a = Math.sqrt(t.x * t.x + t.y * t.y)) ? (s = Math.atan2(a, this.rc), i = Math.sin(s), e = Math.cos(s), n = J(e * this.sin_p14 + t.y * i * this.cos_p14 / a), r = Math.atan2(t.x * i, a * this.cos_p14 * e - t.y * this.sin_p14 * i), r = m(this.long0 + r, this.over)) : (n = this.phic0, r = 0), t.x = r, t.y = n, t;
2993
+ }
2994
+ var tr = ["gnom"], ar = {
2995
+ init: Je,
2996
+ forward: Ze,
2997
+ inverse: Ye,
2998
+ names: tr
2999
+ };
3000
+ function ir(t, a) {
3001
+ var i = 1 - (1 - t * t) / (2 * t) * Math.log((1 - t) / (1 + t));
3002
+ if (Math.abs(Math.abs(a) - i) < 1e-6) return a < 0 ? -1 * M : M;
3003
+ for (var e = Math.asin(0.5 * a), s, r, n, h, o = 0; o < 30; o++)
3004
+ if (r = Math.sin(e), n = Math.cos(e), h = t * r, s = Math.pow(1 - h * h, 2) / (2 * n) * (a / (1 - t * t) - r / (1 - h * h) + 0.5 / t * Math.log((1 - h) / (1 + h))), e += s, Math.abs(s) <= 1e-10) return e;
3005
+ return NaN;
3006
+ }
3007
+ function sr() {
3008
+ this.sphere || (this.k0 = W(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)));
3009
+ }
3010
+ function er(t) {
3011
+ var a = t.x, i = t.y, e, s, r = m(a - this.long0, this.over);
3012
+ if (this.sphere)
3013
+ e = this.x0 + this.a * r * Math.cos(this.lat_ts), s = this.y0 + this.a * Math.sin(i) / Math.cos(this.lat_ts);
3014
+ else {
3015
+ var n = X(this.e, Math.sin(i));
3016
+ e = this.x0 + this.a * this.k0 * r, s = this.y0 + this.a * n * 0.5 / this.k0;
3017
+ }
3018
+ return t.x = e, t.y = s, t;
3019
+ }
3020
+ function rr(t) {
3021
+ t.x -= this.x0, t.y -= this.y0;
3022
+ var a, i;
3023
+ return this.sphere ? (a = m(this.long0 + t.x / this.a / Math.cos(this.lat_ts), this.over), i = Math.asin(t.y / this.a * Math.cos(this.lat_ts))) : (i = ir(this.e, 2 * t.y * this.k0 / this.a), a = m(this.long0 + t.x / (this.a * this.k0), this.over)), t.x = a, t.y = i, t;
3024
+ }
3025
+ var hr = ["cea"], nr = {
3026
+ init: sr,
3027
+ forward: er,
3028
+ inverse: rr,
3029
+ names: hr
3030
+ };
3031
+ function or() {
3032
+ this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.lat0 = this.lat0 || 0, this.long0 = this.long0 || 0, this.lat_ts = this.lat_ts || 0, this.title = this.title || "Equidistant Cylindrical (Plate Carre)", this.rc = Math.cos(this.lat_ts);
3033
+ }
3034
+ function lr(t) {
3035
+ var a = t.x, i = t.y, e = m(a - this.long0, this.over), s = Z(i - this.lat0);
3036
+ return t.x = this.x0 + this.a * e * this.rc, t.y = this.y0 + this.a * s, t;
3037
+ }
3038
+ function fr(t) {
3039
+ var a = t.x, i = t.y;
3040
+ return t.x = m(this.long0 + (a - this.x0) / (this.a * this.rc), this.over), t.y = Z(this.lat0 + (i - this.y0) / this.a), t;
3041
+ }
3042
+ var _r = [
3043
+ "Equirectangular",
3044
+ "Equidistant_Cylindrical",
3045
+ "Equidistant_Cylindrical_Spherical",
3046
+ "eqc"
3047
+ ], cr = {
3048
+ init: or,
3049
+ forward: lr,
3050
+ inverse: fr,
3051
+ names: _r
3052
+ }, ba = 20;
3053
+ function ur() {
3054
+ this.temp = this.b / this.a, this.es = 1 - Math.pow(this.temp, 2), this.e = Math.sqrt(this.es), this.e0 = wt(this.es), this.e1 = Pt(this.es), this.e2 = Gt(this.es), this.e3 = xt(this.es), this.ml0 = this.a * L(this.e0, this.e1, this.e2, this.e3, this.lat0);
3055
+ }
3056
+ function vr(t) {
3057
+ var a = t.x, i = t.y, e, s, r, n = m(a - this.long0, this.over);
3058
+ if (r = n * Math.sin(i), this.sphere) Math.abs(i) <= 1e-10 ? (e = this.a * n, s = -1 * this.a * this.lat0) : (e = this.a * Math.sin(r) / Math.tan(i), s = this.a * (Z(i - this.lat0) + (1 - Math.cos(r)) / Math.tan(i)));
3059
+ else if (Math.abs(i) <= 1e-10)
3060
+ e = this.a * n, s = -1 * this.ml0;
3061
+ else {
3062
+ var h = sa(this.a, this.e, Math.sin(i)) / Math.tan(i);
3063
+ e = h * Math.sin(r), s = this.a * L(this.e0, this.e1, this.e2, this.e3, i) - this.ml0 + h * (1 - Math.cos(r));
3064
+ }
3065
+ return t.x = e + this.x0, t.y = s + this.y0, t;
3066
+ }
3067
+ function Mr(t) {
3068
+ var a, i, e, s, r, n, h, o, f;
3069
+ if (e = t.x - this.x0, s = t.y - this.y0, this.sphere) if (Math.abs(s + this.a * this.lat0) <= 1e-10)
3070
+ a = m(e / this.a + this.long0, this.over), i = 0;
3071
+ else {
3072
+ n = this.lat0 + s / this.a, h = e * e / this.a / this.a + n * n, o = n;
3073
+ var _;
3074
+ for (r = ba; r; --r)
3075
+ if (_ = Math.tan(o), f = -1 * (n * (o * _ + 1) - o - 0.5 * (o * o + h) * _) / ((o - n) / _ - 1), o += f, Math.abs(f) <= 1e-10) {
3076
+ i = o;
3077
+ break;
3078
+ }
3079
+ a = m(this.long0 + Math.asin(e * Math.tan(o) / this.a) / Math.sin(i), this.over);
3080
+ }
3081
+ else if (Math.abs(s + this.ml0) <= 1e-10)
3082
+ i = 0, a = m(this.long0 + e / this.a, this.over);
3083
+ else {
3084
+ n = (this.ml0 + s) / this.a, h = e * e / this.a / this.a + n * n, o = n;
3085
+ var l, c, v, u, g;
3086
+ for (r = ba; r; --r)
3087
+ if (g = this.e * Math.sin(o), l = Math.sqrt(1 - g * g) * Math.tan(o), c = this.a * L(this.e0, this.e1, this.e2, this.e3, o), v = this.e0 - 2 * this.e1 * Math.cos(2 * o) + 4 * this.e2 * Math.cos(4 * o) - 6 * this.e3 * Math.cos(6 * o), u = c / this.a, f = (n * (l * u + 1) - u - 0.5 * l * (u * u + h)) / (this.es * Math.sin(2 * o) * (u * u + h - 2 * n * u) / (4 * l) + (n - u) * (l * v - 2 / Math.sin(2 * o)) - v), o -= f, Math.abs(f) <= 1e-10) {
3088
+ i = o;
3089
+ break;
3090
+ }
3091
+ l = Math.sqrt(1 - this.es * Math.pow(Math.sin(i), 2)) * Math.tan(i), a = m(this.long0 + Math.asin(e * l / this.a) / Math.sin(i), this.over);
3092
+ }
3093
+ return t.x = a, t.y = i, t;
3094
+ }
3095
+ var gr = [
3096
+ "Polyconic",
3097
+ "American_Polyconic",
3098
+ "poly"
3099
+ ], dr = {
3100
+ init: ur,
3101
+ forward: vr,
3102
+ inverse: Mr,
3103
+ names: gr
3104
+ };
3105
+ function mr() {
3106
+ this.A = [], this.A[1] = 0.6399175073, this.A[2] = -0.1358797613, this.A[3] = 0.063294409, this.A[4] = -0.02526853, this.A[5] = 0.0117879, this.A[6] = -55161e-7, this.A[7] = 26906e-7, this.A[8] = -1333e-6, this.A[9] = 67e-5, this.A[10] = -34e-5, this.B_re = [], this.B_im = [], this.B_re[1] = 0.7557853228, this.B_im[1] = 0, this.B_re[2] = 0.249204646, this.B_im[2] = 3371507e-9, this.B_re[3] = -1541739e-9, this.B_im[3] = 0.04105856, this.B_re[4] = -0.10162907, this.B_im[4] = 0.01727609, this.B_re[5] = -0.26623489, this.B_im[5] = -0.36249218, this.B_re[6] = -0.6870983, this.B_im[6] = -1.1651967, this.C_re = [], this.C_im = [], this.C_re[1] = 1.3231270439, this.C_im[1] = 0, this.C_re[2] = -0.577245789, this.C_im[2] = -7809598e-9, this.C_re[3] = 0.508307513, this.C_im[3] = -0.112208952, this.C_re[4] = -0.15094762, this.C_im[4] = 0.18200602, this.C_re[5] = 1.01418179, this.C_im[5] = 1.64497696, this.C_re[6] = 1.9660549, this.C_im[6] = 2.5127645, this.D = [], this.D[1] = 1.5627014243, this.D[2] = 0.5185406398, this.D[3] = -0.03333098, this.D[4] = -0.1052906, this.D[5] = -0.0368594, this.D[6] = 7317e-6, this.D[7] = 0.0122, this.D[8] = 394e-5, this.D[9] = -13e-4;
3107
+ }
3108
+ function yr(t) {
3109
+ var a, i = t.x, e = t.y - this.lat0, s = i - this.long0, r = e / ct * 1e-5, n = s, h = 1, o = 0;
3110
+ for (a = 1; a <= 10; a++)
3111
+ h = h * r, o = o + this.A[a] * h;
3112
+ var f = o, _ = n, l = 1, c = 0, v, u, g = 0, d = 0;
3113
+ for (a = 1; a <= 6; a++)
3114
+ v = l * f - c * _, u = c * f + l * _, l = v, c = u, g = g + this.B_re[a] * l - this.B_im[a] * c, d = d + this.B_im[a] * l + this.B_re[a] * c;
3115
+ return t.x = d * this.a + this.x0, t.y = g * this.a + this.y0, t;
3116
+ }
3117
+ function Er(t) {
3118
+ var a, i = t.x, e = t.y, s = i - this.x0, r = (e - this.y0) / this.a, n = s / this.a, h = 1, o = 0, f, _, l = 0, c = 0;
3119
+ for (a = 1; a <= 6; a++)
3120
+ f = h * r - o * n, _ = o * r + h * n, h = f, o = _, l = l + this.C_re[a] * h - this.C_im[a] * o, c = c + this.C_im[a] * h + this.C_re[a] * o;
3121
+ for (var v = 0; v < this.iterations; v++) {
3122
+ var u = l, g = c, d, y, E = r, S = n;
3123
+ for (a = 2; a <= 6; a++)
3124
+ d = u * l - g * c, y = g * l + u * c, u = d, g = y, E = E + (a - 1) * (this.B_re[a] * u - this.B_im[a] * g), S = S + (a - 1) * (this.B_im[a] * u + this.B_re[a] * g);
3125
+ u = 1, g = 0;
3126
+ var w = this.B_re[1], P = this.B_im[1];
3127
+ for (a = 2; a <= 6; a++)
3128
+ d = u * l - g * c, y = g * l + u * c, u = d, g = y, w = w + a * (this.B_re[a] * u - this.B_im[a] * g), P = P + a * (this.B_im[a] * u + this.B_re[a] * g);
3129
+ var b = w * w + P * P;
3130
+ l = (E * w + S * P) / b, c = (S * w - E * P) / b;
3131
+ }
3132
+ var A = l, T = c, C = 1, H = 0;
3133
+ for (a = 1; a <= 9; a++)
3134
+ C = C * A, H = H + this.D[a] * C;
3135
+ var j = this.lat0 + H * ct * 1e5;
3136
+ return t.x = this.long0 + T, t.y = j, t;
3137
+ }
3138
+ var Sr = ["New_Zealand_Map_Grid", "nzmg"], wr = {
3139
+ init: mr,
3140
+ forward: yr,
3141
+ inverse: Er,
3142
+ names: Sr
3143
+ };
3144
+ function Pr() {
3145
+ }
3146
+ function Gr(t) {
3147
+ var a = t.x, i = t.y, e = m(a - this.long0, this.over), s = this.x0 + this.a * e, r = this.y0 + this.a * Math.log(Math.tan(Math.PI / 4 + i / 2.5)) * 1.25;
3148
+ return t.x = s, t.y = r, t;
3149
+ }
3150
+ function xr(t) {
3151
+ t.x -= this.x0, t.y -= this.y0;
3152
+ var a = m(this.long0 + t.x / this.a, this.over), i = 2.5 * (Math.atan(Math.exp(0.8 * t.y / this.a)) - Math.PI / 4);
3153
+ return t.x = a, t.y = i, t;
3154
+ }
3155
+ var br = ["Miller_Cylindrical", "mill"], Ar = {
3156
+ init: Pr,
3157
+ forward: Gr,
3158
+ inverse: xr,
3159
+ names: br
3160
+ }, Nr = 20;
3161
+ function Ir() {
3162
+ this.long0 = this.long0 || 0, this.sphere ? (this.n = 1, this.m = 0, this.es = 0, this.C_y = Math.sqrt((this.m + 1) / this.n), this.C_x = this.C_y / (this.m + 1)) : this.en = Jt(this.es);
3163
+ }
3164
+ function Cr(t) {
3165
+ var a, i, e = t.x, s = t.y;
3166
+ if (e = m(e - this.long0, this.over), this.sphere) {
3167
+ if (!this.m) s = this.n !== 1 ? Math.asin(this.n * Math.sin(s)) : s;
3168
+ else
3169
+ for (var r = this.n * Math.sin(s), n = Nr; n; --n) {
3170
+ var h = (this.m * s + Math.sin(s) - r) / (this.m + Math.cos(s));
3171
+ if (s -= h, Math.abs(h) < 1e-10) break;
3172
+ }
3173
+ a = this.a * this.C_x * e * (this.m + Math.cos(s)), i = this.a * this.C_y * s;
3174
+ } else {
3175
+ var o = Math.sin(s), f = Math.cos(s);
3176
+ i = this.a * nt(s, o, f, this.en), a = this.a * e * f / Math.sqrt(1 - this.es * o * o);
3177
+ }
3178
+ return t.x = a, t.y = i, t;
3179
+ }
3180
+ function Rr(t) {
3181
+ var a, i, e, s;
3182
+ return t.x -= this.x0, e = t.x / this.a, t.y -= this.y0, a = t.y / this.a, this.sphere ? (a /= this.C_y, e = e / (this.C_x * (this.m + Math.cos(a))), this.m ? a = J((this.m * a + Math.sin(a)) / this.n) : this.n !== 1 && (a = J(Math.sin(a) / this.n)), e = m(e + this.long0, this.over), a = Z(a)) : (a = Zt(t.y / this.a, this.es, this.en), s = Math.abs(a), s < M ? (s = Math.sin(a), i = this.long0 + t.x * Math.sqrt(1 - this.es * s * s) / (this.a * Math.cos(a)), e = m(i, this.over)) : s - 1e-10 < M && (e = this.long0)), t.x = e, t.y = a, t;
3183
+ }
3184
+ var Or = ["Sinusoidal", "sinu"], Tr = {
3185
+ init: Ir,
3186
+ forward: Cr,
3187
+ inverse: Rr,
3188
+ names: Or
3189
+ };
3190
+ function pr() {
3191
+ this.x0 = this.x0 !== void 0 ? this.x0 : 0, this.y0 = this.y0 !== void 0 ? this.y0 : 0, this.long0 = this.long0 !== void 0 ? this.long0 : 0;
3192
+ }
3193
+ function Lr(t) {
3194
+ for (var a = t.x, i = t.y, e = m(a - this.long0, this.over), s = i, r = Math.PI * Math.sin(i); ; ) {
3195
+ var n = -(s + Math.sin(s) - r) / (1 + Math.cos(s));
3196
+ if (s += n, Math.abs(n) < 1e-10) break;
3197
+ }
3198
+ s /= 2, Math.PI / 2 - Math.abs(i) < 1e-10 && (e = 0);
3199
+ var h = 0.900316316158 * this.a * e * Math.cos(s) + this.x0, o = 1.4142135623731 * this.a * Math.sin(s) + this.y0;
3200
+ return t.x = h, t.y = o, t;
3201
+ }
3202
+ function qr(t) {
3203
+ var a, i;
3204
+ t.x -= this.x0, t.y -= this.y0, i = t.y / (1.4142135623731 * this.a), Math.abs(i) > 0.999999999999 && (i = 0.999999999999), a = Math.asin(i);
3205
+ var e = m(this.long0 + t.x / (0.900316316158 * this.a * Math.cos(a)), this.over);
3206
+ e < -Math.PI && (e = -Math.PI), e > Math.PI && (e = Math.PI), i = (2 * a + Math.sin(2 * a)) / Math.PI, Math.abs(i) > 1 && (i = 1);
3207
+ var s = Math.asin(i);
3208
+ return t.x = e, t.y = s, t;
3209
+ }
3210
+ var Ur = ["Mollweide", "moll"], kr = {
3211
+ init: pr,
3212
+ forward: Lr,
3213
+ inverse: qr,
3214
+ names: Ur
3215
+ };
3216
+ function $r() {
3217
+ Math.abs(this.lat1 + this.lat2) < 1e-10 || (this.lat2 = this.lat2 || this.lat1, this.temp = this.b / this.a, this.es = 1 - Math.pow(this.temp, 2), this.e = Math.sqrt(this.es), this.e0 = wt(this.es), this.e1 = Pt(this.es), this.e2 = Gt(this.es), this.e3 = xt(this.es), this.sin_phi = Math.sin(this.lat1), this.cos_phi = Math.cos(this.lat1), this.ms1 = W(this.e, this.sin_phi, this.cos_phi), this.ml1 = L(this.e0, this.e1, this.e2, this.e3, this.lat1), Math.abs(this.lat1 - this.lat2) < 1e-10 ? this.ns = this.sin_phi : (this.sin_phi = Math.sin(this.lat2), this.cos_phi = Math.cos(this.lat2), this.ms2 = W(this.e, this.sin_phi, this.cos_phi), this.ml2 = L(this.e0, this.e1, this.e2, this.e3, this.lat2), this.ns = (this.ms1 - this.ms2) / (this.ml2 - this.ml1)), this.g = this.ml1 + this.ms1 / this.ns, this.ml0 = L(this.e0, this.e1, this.e2, this.e3, this.lat0), this.rh = this.a * (this.g - this.ml0));
3218
+ }
3219
+ function Fr(t) {
3220
+ var a = t.x, i = t.y, e;
3221
+ if (this.sphere) e = this.a * (this.g - i);
3222
+ else {
3223
+ var s = L(this.e0, this.e1, this.e2, this.e3, i);
3224
+ e = this.a * (this.g - s);
3225
+ }
3226
+ var r = this.ns * m(a - this.long0, this.over), n = this.x0 + e * Math.sin(r), h = this.y0 + this.rh - e * Math.cos(r);
3227
+ return t.x = n, t.y = h, t;
3228
+ }
3229
+ function Dr(t) {
3230
+ t.x -= this.x0, t.y = this.rh - t.y + this.y0;
3231
+ var a, i, e, s;
3232
+ this.ns >= 0 ? (i = Math.sqrt(t.x * t.x + t.y * t.y), a = 1) : (i = -Math.sqrt(t.x * t.x + t.y * t.y), a = -1);
3233
+ var r = 0;
3234
+ return i !== 0 && (r = Math.atan2(a * t.x, a * t.y)), this.sphere ? (s = m(this.long0 + r / this.ns, this.over), e = Z(this.g - i / this.a), t.x = s, t.y = e, t) : (e = qt(this.g - i / this.a, this.e0, this.e1, this.e2, this.e3), s = m(this.long0 + r / this.ns, this.over), t.x = s, t.y = e, t);
3235
+ }
3236
+ var Br = ["Equidistant_Conic", "eqdc"], jr = {
3237
+ init: $r,
3238
+ forward: Fr,
3239
+ inverse: Dr,
3240
+ names: Br
3241
+ };
3242
+ function zr() {
3243
+ this.R = this.a;
3244
+ }
3245
+ function Wr(t) {
3246
+ var a = t.x, i = t.y, e = m(a - this.long0, this.over), s, r;
3247
+ Math.abs(i) <= 1e-10 && (s = this.x0 + this.R * e, r = this.y0);
3248
+ var n = J(2 * Math.abs(i / Math.PI));
3249
+ (Math.abs(e) <= 1e-10 || Math.abs(Math.abs(i) - M) <= 1e-10) && (s = this.x0, i >= 0 ? r = this.y0 + Math.PI * this.R * Math.tan(0.5 * n) : r = this.y0 + Math.PI * this.R * -Math.tan(0.5 * n));
3250
+ var h = 0.5 * Math.abs(Math.PI / e - e / Math.PI), o = h * h, f = Math.sin(n), _ = Math.cos(n), l = _ / (f + _ - 1), c = l * l, v = l * (2 / f - 1), u = v * v, g = Math.PI * this.R * (h * (l - u) + Math.sqrt(o * (l - u) * (l - u) - (u + o) * (c - u))) / (u + o);
3251
+ e < 0 && (g = -g), s = this.x0 + g;
3252
+ var d = o + l;
3253
+ return g = Math.PI * this.R * (v * d - h * Math.sqrt((u + o) * (o + 1) - d * d)) / (u + o), i >= 0 ? r = this.y0 + g : r = this.y0 - g, t.x = s, t.y = r, t;
3254
+ }
3255
+ function Qr(t) {
3256
+ var a, i, e, s, r, n, h, o, f, _, l, c, v;
3257
+ return t.x -= this.x0, t.y -= this.y0, l = Math.PI * this.R, e = t.x / l, s = t.y / l, r = e * e + s * s, n = -Math.abs(s) * (1 + r), h = n - 2 * s * s + e * e, o = -2 * n + 1 + 2 * s * s + r * r, v = s * s / o + (2 * h * h * h / o / o / o - 9 * n * h / o / o) / 27, f = (n - h * h / 3 / o) / o, _ = 2 * Math.sqrt(-f / 3), l = 3 * v / f / _, Math.abs(l) > 1 && (l >= 0 ? l = 1 : l = -1), c = Math.acos(l) / 3, t.y >= 0 ? i = (-_ * Math.cos(c + Math.PI / 3) - h / 3 / o) * Math.PI : i = -(-_ * Math.cos(c + Math.PI / 3) - h / 3 / o) * Math.PI, Math.abs(e) < 1e-10 ? a = this.long0 : a = m(this.long0 + Math.PI * (r - 1 + Math.sqrt(1 + 2 * (e * e - s * s) + r * r)) / 2 / e, this.over), t.x = a, t.y = i, t;
3258
+ }
3259
+ var Hr = [
3260
+ "Van_der_Grinten_I",
3261
+ "VanDerGrinten",
3262
+ "Van_der_Grinten",
3263
+ "vandg"
3264
+ ], Kr = {
3265
+ init: zr,
3266
+ forward: Wr,
3267
+ inverse: Qr,
3268
+ names: Hr
3269
+ };
3270
+ function Xr(t, a, i, e, s, r) {
3271
+ const n = e - a, h = Math.atan((1 - r) * Math.tan(t)), o = Math.atan((1 - r) * Math.tan(i)), f = Math.sin(h), _ = Math.cos(h), l = Math.sin(o), c = Math.cos(o);
3272
+ let v = n, u, g = 100, d, y, E, S, w, P, b, A, T, C, H, j, ea, ra;
3273
+ do {
3274
+ if (d = Math.sin(v), y = Math.cos(v), E = Math.sqrt(c * d * (c * d) + (_ * l - f * c * y) * (_ * l - f * c * y)), E === 0) return {
3275
+ azi1: 0,
3276
+ s12: 0
3277
+ };
3278
+ S = f * l + _ * c * y, w = Math.atan2(E, S), P = _ * c * d / E, b = 1 - P * P, A = b !== 0 ? S - 2 * f * l / b : 0, T = r / 16 * b * (4 + r * (4 - 3 * b)), u = v, v = n + (1 - T) * r * P * (w + T * E * (A + T * S * (-1 + 2 * A * A)));
3279
+ } while (Math.abs(v - u) > 1e-12 && --g > 0);
3280
+ return g === 0 ? {
3281
+ azi1: NaN,
3282
+ s12: NaN
3283
+ } : (C = b * (s * s - s * (1 - r) * (s * (1 - r))) / (s * (1 - r) * (s * (1 - r))), H = 1 + C / 16384 * (4096 + C * (-768 + C * (320 - 175 * C))), j = C / 1024 * (256 + C * (-128 + C * (74 - 47 * C))), ea = j * E * (A + j / 4 * (S * (-1 + 2 * A * A) - j / 6 * A * (-3 + 4 * E * E) * (-3 + 4 * A * A))), ra = s * (1 - r) * H * (w - ea), {
3284
+ azi1: Math.atan2(c * d, _ * l - f * c * y),
3285
+ s12: ra
3286
+ });
3287
+ }
3288
+ function Vr(t, a, i, e, s, r) {
3289
+ const n = Math.atan((1 - r) * Math.tan(t)), h = Math.sin(n), o = Math.cos(n), f = Math.sin(i), _ = Math.cos(i), l = Math.atan2(h, o * _), c = o * f, v = 1 - c * c, u = v * (s * s - s * (1 - r) * (s * (1 - r))) / (s * (1 - r) * (s * (1 - r))), g = 1 + u / 16384 * (4096 + u * (-768 + u * (320 - 175 * u))), d = u / 1024 * (256 + u * (-128 + u * (74 - 47 * u)));
3290
+ let y = e / (s * (1 - r) * g), E, S = 100, w, P, b, A;
3291
+ do
3292
+ w = Math.cos(2 * l + y), P = Math.sin(y), b = Math.cos(y), A = d * P * (w + d / 4 * (b * (-1 + 2 * w * w) - d / 6 * w * (-3 + 4 * P * P) * (-3 + 4 * w * w))), E = y, y = e / (s * (1 - r) * g) + A;
3293
+ while (Math.abs(y - E) > 1e-12 && --S > 0);
3294
+ if (S === 0) return {
3295
+ lat2: NaN,
3296
+ lon2: NaN
3297
+ };
3298
+ const T = h * P - o * b * _, C = Math.atan2(h * b + o * P * _, (1 - r) * Math.sqrt(c * c + T * T)), H = Math.atan2(P * f, o * b - h * P * _), j = r / 16 * v * (4 + r * (4 - 3 * v));
3299
+ return {
3300
+ lat2: C,
3301
+ lon2: a + (H - (1 - j) * r * c * (y + j * P * (w + j * b * (-1 + 2 * w * w))))
3302
+ };
3303
+ }
3304
+ function Jr() {
3305
+ this.sin_p12 = Math.sin(this.lat0), this.cos_p12 = Math.cos(this.lat0), this.f = this.es / (1 + Math.sqrt(1 - this.es));
3306
+ }
3307
+ function Zr(t) {
3308
+ var a = t.x, i = t.y, e = Math.sin(t.y), s = Math.cos(t.y), r = m(a - this.long0, this.over), n, h, o, f, _, l, c, v, u, g, d;
3309
+ return this.sphere ? Math.abs(this.sin_p12 - 1) <= 1e-10 ? (t.x = this.x0 + this.a * (M - i) * Math.sin(r), t.y = this.y0 - this.a * (M - i) * Math.cos(r), t) : Math.abs(this.sin_p12 + 1) <= 1e-10 ? (t.x = this.x0 + this.a * (M + i) * Math.sin(r), t.y = this.y0 + this.a * (M + i) * Math.cos(r), t) : (u = this.sin_p12 * e + this.cos_p12 * s * Math.cos(r), c = Math.acos(u), v = c ? c / Math.sin(c) : 1, t.x = this.x0 + this.a * v * s * Math.sin(r), t.y = this.y0 + this.a * v * (this.cos_p12 * e - this.sin_p12 * s * Math.cos(r)), t) : (n = wt(this.es), h = Pt(this.es), o = Gt(this.es), f = xt(this.es), Math.abs(this.sin_p12 - 1) <= 1e-10 ? (_ = this.a * L(n, h, o, f, M), l = this.a * L(n, h, o, f, i), t.x = this.x0 + (_ - l) * Math.sin(r), t.y = this.y0 - (_ - l) * Math.cos(r), t) : Math.abs(this.sin_p12 + 1) <= 1e-10 ? (_ = this.a * L(n, h, o, f, M), l = this.a * L(n, h, o, f, i), t.x = this.x0 + (_ + l) * Math.sin(r), t.y = this.y0 + (_ + l) * Math.cos(r), t) : Math.abs(a) < 1e-10 && Math.abs(i - this.lat0) < 1e-10 ? (t.x = t.y = 0, t) : (g = Xr(this.lat0, this.long0, i, a, this.a, this.f), d = g.azi1, t.x = g.s12 * Math.sin(d), t.y = g.s12 * Math.cos(d), t));
3310
+ }
3311
+ function Yr(t) {
3312
+ t.x -= this.x0, t.y -= this.y0;
3313
+ var a, i, e, s, r, n, h, o, f, _, l, c, v, u, g, d;
3314
+ return this.sphere ? (a = Math.sqrt(t.x * t.x + t.y * t.y), a > 2 * M * this.a ? void 0 : (i = a / this.a, e = Math.sin(i), s = Math.cos(i), r = this.long0, Math.abs(a) <= 1e-10 ? n = this.lat0 : (n = J(s * this.sin_p12 + t.y * e * this.cos_p12 / a), h = Math.abs(this.lat0) - M, Math.abs(h) <= 1e-10 ? this.lat0 >= 0 ? r = m(this.long0 + Math.atan2(t.x, -t.y), this.over) : r = m(this.long0 - Math.atan2(-t.x, t.y), this.over) : r = m(this.long0 + Math.atan2(t.x * e, a * this.cos_p12 * s - t.y * this.sin_p12 * e), this.over)), t.x = r, t.y = n, t)) : (o = wt(this.es), f = Pt(this.es), _ = Gt(this.es), l = xt(this.es), Math.abs(this.sin_p12 - 1) <= 1e-10 ? (c = this.a * L(o, f, _, l, M), a = Math.sqrt(t.x * t.x + t.y * t.y), v = c - a, n = qt(v / this.a, o, f, _, l), r = m(this.long0 + Math.atan2(t.x, -1 * t.y), this.over), t.x = r, t.y = n, t) : Math.abs(this.sin_p12 + 1) <= 1e-10 ? (c = this.a * L(o, f, _, l, M), a = Math.sqrt(t.x * t.x + t.y * t.y), v = a - c, n = qt(v / this.a, o, f, _, l), r = m(this.long0 + Math.atan2(t.x, t.y), this.over), t.x = r, t.y = n, t) : (u = Math.atan2(t.x, t.y), g = Math.sqrt(t.x * t.x + t.y * t.y), d = Vr(this.lat0, this.long0, u, g, this.a, this.f), t.x = d.lon2, t.y = d.lat2, t));
3315
+ }
3316
+ var th = ["Azimuthal_Equidistant", "aeqd"], ah = {
3317
+ init: Jr,
3318
+ forward: Zr,
3319
+ inverse: Yr,
3320
+ names: th
3321
+ };
3322
+ function ih() {
3323
+ this.sin_p14 = Math.sin(this.lat0 || 0), this.cos_p14 = Math.cos(this.lat0 || 0);
3324
+ }
3325
+ function sh(t) {
3326
+ var a, i, e, s, r, n, h, o, f = t.x, _ = t.y;
3327
+ return e = m(f - (this.long0 || 0), this.over), a = Math.sin(_), i = Math.cos(_), s = Math.cos(e), n = this.sin_p14 * a + this.cos_p14 * i * s, r = 1, (n > 0 || Math.abs(n) <= 1e-10) && (h = this.a * r * i * Math.sin(e), o = (this.y0 || 0) + this.a * r * (this.cos_p14 * a - this.sin_p14 * i * s)), t.x = h, t.y = o, t;
3328
+ }
3329
+ function eh(t) {
3330
+ var a, i, e, s, r, n, h, o, f;
3331
+ return t.x -= this.x0 || 0, t.y -= this.y0 || 0, a = Math.sqrt(t.x * t.x + t.y * t.y), i = J(a / this.a), e = Math.sin(i), s = Math.cos(i), o = this.long0 || 0, f = this.lat0 || 0, n = o, Math.abs(a) <= 1e-10 ? (h = f, t.x = n, t.y = h, t) : (h = J(s * this.sin_p14 + t.y * e * this.cos_p14 / a), r = Math.abs(f) - M, Math.abs(r) <= 1e-10 ? (f >= 0 ? n = m(o + Math.atan2(t.x, -t.y), this.over) : n = m(o - Math.atan2(-t.x, t.y), this.over), t.x = n, t.y = h, t) : (n = m(o + Math.atan2(t.x * e, a * this.cos_p14 * s - t.y * this.sin_p14 * e), this.over), t.x = n, t.y = h, t));
3332
+ }
3333
+ var rh = ["ortho"], hh = {
3334
+ init: ih,
3335
+ forward: sh,
3336
+ inverse: eh,
3337
+ names: rh
3338
+ }, N = {
3339
+ FRONT: 1,
3340
+ RIGHT: 2,
3341
+ BACK: 3,
3342
+ LEFT: 4,
3343
+ TOP: 5,
3344
+ BOTTOM: 6
3345
+ }, x = {
3346
+ AREA_0: 1,
3347
+ AREA_1: 2,
3348
+ AREA_2: 3,
3349
+ AREA_3: 4
3350
+ };
3351
+ function nh() {
3352
+ this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.lat0 = this.lat0 || 0, this.long0 = this.long0 || 0, this.lat_ts = this.lat_ts || 0, this.title = this.title || "Quadrilateralized Spherical Cube", this.lat0 >= M - G / 2 ? this.face = N.TOP : this.lat0 <= -(M - G / 2) ? this.face = N.BOTTOM : Math.abs(this.long0) <= G ? this.face = N.FRONT : Math.abs(this.long0) <= M + G ? this.face = this.long0 > 0 ? N.RIGHT : N.LEFT : this.face = N.BACK, this.es !== 0 && (this.one_minus_f = 1 - (this.a - this.b) / this.a, this.one_minus_f_squared = this.one_minus_f * this.one_minus_f);
3353
+ }
3354
+ function oh(t) {
3355
+ var a = {
3356
+ x: 0,
3357
+ y: 0
3358
+ }, i, e, s, r, n, h, o = { value: 0 };
3359
+ if (t.x -= this.long0, this.es !== 0 ? i = Math.atan(this.one_minus_f_squared * Math.tan(t.y)) : i = t.y, e = t.x, this.face === N.TOP)
3360
+ r = M - i, e >= G && e <= M + G ? (o.value = x.AREA_0, s = e - M) : e > M + G || e <= -(M + G) ? (o.value = x.AREA_1, s = e > 0 ? e - R : e + R) : e > -(M + G) && e <= -G ? (o.value = x.AREA_2, s = e + M) : (o.value = x.AREA_3, s = e);
3361
+ else if (this.face === N.BOTTOM)
3362
+ r = M + i, e >= G && e <= M + G ? (o.value = x.AREA_0, s = -e + M) : e < G && e >= -G ? (o.value = x.AREA_1, s = -e) : e < -G && e >= -(M + G) ? (o.value = x.AREA_2, s = -e - M) : (o.value = x.AREA_3, s = e > 0 ? -e + R : -e - R);
3363
+ else {
3364
+ var f, _, l, c, v, u, g;
3365
+ this.face === N.RIGHT ? e = rt(e, +M) : this.face === N.BACK ? e = rt(e, +R) : this.face === N.LEFT && (e = rt(e, -M)), c = Math.sin(i), v = Math.cos(i), u = Math.sin(e), g = Math.cos(e), f = v * g, _ = v * u, l = c, this.face === N.FRONT ? (r = Math.acos(f), s = Nt(r, l, _, o)) : this.face === N.RIGHT ? (r = Math.acos(_), s = Nt(r, l, -f, o)) : this.face === N.BACK ? (r = Math.acos(-f), s = Nt(r, l, -_, o)) : this.face === N.LEFT ? (r = Math.acos(-_), s = Nt(r, l, f, o)) : (r = s = 0, o.value = x.AREA_0);
3366
+ }
3367
+ return h = Math.atan(12 / R * (s + Math.acos(Math.sin(s) * Math.cos(G)) - M)), n = Math.sqrt((1 - Math.cos(r)) / (Math.cos(h) * Math.cos(h)) / (1 - Math.cos(Math.atan(1 / Math.cos(s))))), o.value === x.AREA_1 ? h += M : o.value === x.AREA_2 ? h += R : o.value === x.AREA_3 && (h += 1.5 * R), a.x = n * Math.cos(h), a.y = n * Math.sin(h), a.x = a.x * this.a + this.x0, a.y = a.y * this.a + this.y0, t.x = a.x, t.y = a.y, t;
3368
+ }
3369
+ function lh(t) {
3370
+ var a = {
3371
+ lam: 0,
3372
+ phi: 0
3373
+ }, i, e, s, r, n, h, o, f, _, l = { value: 0 };
3374
+ if (t.x = (t.x - this.x0) / this.a, t.y = (t.y - this.y0) / this.a, e = Math.atan(Math.sqrt(t.x * t.x + t.y * t.y)), i = Math.atan2(t.y, t.x), t.x >= 0 && t.x >= Math.abs(t.y) ? l.value = x.AREA_0 : t.y >= 0 && t.y >= Math.abs(t.x) ? (l.value = x.AREA_1, i -= M) : t.x < 0 && -t.x >= Math.abs(t.y) ? (l.value = x.AREA_2, i = i < 0 ? i + R : i - R) : (l.value = x.AREA_3, i += M), _ = R / 12 * Math.tan(i), n = Math.sin(_) / (Math.cos(_) - 1 / Math.sqrt(2)), h = Math.atan(n), s = Math.cos(i), r = Math.tan(e), o = 1 - s * s * r * r * (1 - Math.cos(Math.atan(1 / Math.cos(h)))), o < -1 ? o = -1 : o > 1 && (o = 1), this.face === N.TOP)
3375
+ f = Math.acos(o), a.phi = M - f, l.value === x.AREA_0 ? a.lam = h + M : l.value === x.AREA_1 ? a.lam = h < 0 ? h + R : h - R : l.value === x.AREA_2 ? a.lam = h - M : a.lam = h;
3376
+ else if (this.face === N.BOTTOM)
3377
+ f = Math.acos(o), a.phi = f - M, l.value === x.AREA_0 ? a.lam = -h + M : l.value === x.AREA_1 ? a.lam = -h : l.value === x.AREA_2 ? a.lam = -h - M : a.lam = h < 0 ? -h - R : -h + R;
3378
+ else {
3379
+ var c = o, v, u;
3380
+ _ = c * c, _ >= 1 ? u = 0 : u = Math.sqrt(1 - _) * Math.sin(h), _ += u * u, _ >= 1 ? v = 0 : v = Math.sqrt(1 - _), l.value === x.AREA_1 ? (_ = v, v = -u, u = _) : l.value === x.AREA_2 ? (v = -v, u = -u) : l.value === x.AREA_3 && (_ = v, v = u, u = -_), this.face === N.RIGHT ? (_ = c, c = -v, v = _) : this.face === N.BACK ? (c = -c, v = -v) : this.face === N.LEFT && (_ = c, c = v, v = -_), a.phi = Math.acos(-u) - M, a.lam = Math.atan2(v, c), this.face === N.RIGHT ? a.lam = rt(a.lam, -M) : this.face === N.BACK ? a.lam = rt(a.lam, -R) : this.face === N.LEFT && (a.lam = rt(a.lam, +M));
3381
+ }
3382
+ if (this.es !== 0) {
3383
+ var g, d, y;
3384
+ g = a.phi < 0 ? 1 : 0, d = Math.tan(a.phi), y = this.b / Math.sqrt(d * d + this.one_minus_f_squared), a.phi = Math.atan(Math.sqrt(this.a * this.a - y * y) / (this.one_minus_f * y)), g && (a.phi = -a.phi);
3385
+ }
3386
+ return a.lam += this.long0, t.x = a.lam, t.y = a.phi, t;
3387
+ }
3388
+ function Nt(t, a, i, e) {
3389
+ var s;
3390
+ return t < 1e-10 ? (e.value = x.AREA_0, s = 0) : (s = Math.atan2(a, i), Math.abs(s) <= G ? e.value = x.AREA_0 : s > G && s <= M + G ? (e.value = x.AREA_1, s -= M) : s > M + G || s <= -(M + G) ? (e.value = x.AREA_2, s = s >= 0 ? s - R : s + R) : (e.value = x.AREA_3, s += M)), s;
3391
+ }
3392
+ function rt(t, a) {
3393
+ var i = t + a;
3394
+ return i < -3.14159265359 ? i += dt : i > 3.14159265359 && (i -= dt), i;
3395
+ }
3396
+ var fh = [
3397
+ "Quadrilateralized Spherical Cube",
3398
+ "Quadrilateralized_Spherical_Cube",
3399
+ "qsc"
3400
+ ], _h = {
3401
+ init: nh,
3402
+ forward: oh,
3403
+ inverse: lh,
3404
+ names: fh
3405
+ }, Ht = [
3406
+ [
3407
+ 1,
3408
+ 22199e-21,
3409
+ -715515e-10,
3410
+ 31103e-10
3411
+ ],
3412
+ [
3413
+ 0.9986,
3414
+ -482243e-9,
3415
+ -24897e-9,
3416
+ -13309e-10
3417
+ ],
3418
+ [
3419
+ 0.9954,
3420
+ -83103e-8,
3421
+ -448605e-10,
3422
+ -986701e-12
3423
+ ],
3424
+ [
3425
+ 0.99,
3426
+ -135364e-8,
3427
+ -59661e-9,
3428
+ 36777e-10
3429
+ ],
3430
+ [
3431
+ 0.9822,
3432
+ -167442e-8,
3433
+ -449547e-11,
3434
+ -572411e-11
3435
+ ],
3436
+ [
3437
+ 0.973,
3438
+ -214868e-8,
3439
+ -903571e-10,
3440
+ 18736e-12
3441
+ ],
3442
+ [
3443
+ 0.96,
3444
+ -305085e-8,
3445
+ -900761e-10,
3446
+ 164917e-11
3447
+ ],
3448
+ [
3449
+ 0.9427,
3450
+ -382792e-8,
3451
+ -653386e-10,
3452
+ -26154e-10
3453
+ ],
3454
+ [
3455
+ 0.9216,
3456
+ -467746e-8,
3457
+ -10457e-8,
3458
+ 481243e-11
3459
+ ],
3460
+ [
3461
+ 0.8962,
3462
+ -536223e-8,
3463
+ -323831e-10,
3464
+ -543432e-11
3465
+ ],
3466
+ [
3467
+ 0.8679,
3468
+ -609363e-8,
3469
+ -113898e-9,
3470
+ 332484e-11
3471
+ ],
3472
+ [
3473
+ 0.835,
3474
+ -698325e-8,
3475
+ -640253e-10,
3476
+ 934959e-12
3477
+ ],
3478
+ [
3479
+ 0.7986,
3480
+ -755338e-8,
3481
+ -500009e-10,
3482
+ 935324e-12
3483
+ ],
3484
+ [
3485
+ 0.7597,
3486
+ -798324e-8,
3487
+ -35971e-9,
3488
+ -227626e-11
3489
+ ],
3490
+ [
3491
+ 0.7186,
3492
+ -851367e-8,
3493
+ -701149e-10,
3494
+ -86303e-10
3495
+ ],
3496
+ [
3497
+ 0.6732,
3498
+ -986209e-8,
3499
+ -199569e-9,
3500
+ 191974e-10
3501
+ ],
3502
+ [
3503
+ 0.6213,
3504
+ -0.010418,
3505
+ 883923e-10,
3506
+ 624051e-11
3507
+ ],
3508
+ [
3509
+ 0.5722,
3510
+ -906601e-8,
3511
+ 182e-6,
3512
+ 624051e-11
3513
+ ],
3514
+ [
3515
+ 0.5322,
3516
+ -677797e-8,
3517
+ 275608e-9,
3518
+ 624051e-11
3519
+ ]
3520
+ ], _t = [
3521
+ [
3522
+ -520417e-23,
3523
+ 0.0124,
3524
+ 121431e-23,
3525
+ -845284e-16
3526
+ ],
3527
+ [
3528
+ 0.062,
3529
+ 0.0124,
3530
+ -126793e-14,
3531
+ 422642e-15
3532
+ ],
3533
+ [
3534
+ 0.124,
3535
+ 0.0124,
3536
+ 507171e-14,
3537
+ -160604e-14
3538
+ ],
3539
+ [
3540
+ 0.186,
3541
+ 0.0123999,
3542
+ -190189e-13,
3543
+ 600152e-14
3544
+ ],
3545
+ [
3546
+ 0.248,
3547
+ 0.0124002,
3548
+ 710039e-13,
3549
+ -224e-10
3550
+ ],
3551
+ [
3552
+ 0.31,
3553
+ 0.0123992,
3554
+ -264997e-12,
3555
+ 835986e-13
3556
+ ],
3557
+ [
3558
+ 0.372,
3559
+ 0.0124029,
3560
+ 988983e-12,
3561
+ -311994e-12
3562
+ ],
3563
+ [
3564
+ 0.434,
3565
+ 0.0123893,
3566
+ -369093e-11,
3567
+ -435621e-12
3568
+ ],
3569
+ [
3570
+ 0.4958,
3571
+ 0.0123198,
3572
+ -102252e-10,
3573
+ -345523e-12
3574
+ ],
3575
+ [
3576
+ 0.5571,
3577
+ 0.0121916,
3578
+ -154081e-10,
3579
+ -582288e-12
3580
+ ],
3581
+ [
3582
+ 0.6176,
3583
+ 0.0119938,
3584
+ -241424e-10,
3585
+ -525327e-12
3586
+ ],
3587
+ [
3588
+ 0.6769,
3589
+ 0.011713,
3590
+ -320223e-10,
3591
+ -516405e-12
3592
+ ],
3593
+ [
3594
+ 0.7346,
3595
+ 0.0113541,
3596
+ -397684e-10,
3597
+ -609052e-12
3598
+ ],
3599
+ [
3600
+ 0.7903,
3601
+ 0.0109107,
3602
+ -489042e-10,
3603
+ -104739e-11
3604
+ ],
3605
+ [
3606
+ 0.8435,
3607
+ 0.0103431,
3608
+ -64615e-9,
3609
+ -140374e-14
3610
+ ],
3611
+ [
3612
+ 0.8936,
3613
+ 969686e-8,
3614
+ -64636e-9,
3615
+ -8547e-9
3616
+ ],
3617
+ [
3618
+ 0.9394,
3619
+ 840947e-8,
3620
+ -192841e-9,
3621
+ -42106e-10
3622
+ ],
3623
+ [
3624
+ 0.9761,
3625
+ 616527e-8,
3626
+ -256e-6,
3627
+ -42106e-10
3628
+ ],
3629
+ [
3630
+ 1,
3631
+ 328947e-8,
3632
+ -319159e-9,
3633
+ -42106e-10
3634
+ ]
3635
+ ], Ja = 0.8487, Za = 1.3523, Ya = z / 5, ch = 1 / Ya, et = 18, Ut = function(t, a) {
3636
+ return t[0] + a * (t[1] + a * (t[2] + a * t[3]));
3637
+ }, uh = function(t, a) {
3638
+ return t[1] + a * (2 * t[2] + a * 3 * t[3]);
3639
+ };
3640
+ function vh(t, a, i, e) {
3641
+ for (var s = a; e; --e) {
3642
+ var r = t(s);
3643
+ if (s -= r, Math.abs(r) < i) break;
3644
+ }
3645
+ return s;
3646
+ }
3647
+ function Mh() {
3648
+ this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.long0 = this.long0 || 0, this.es = 0, this.title = this.title || "Robinson";
3649
+ }
3650
+ function gh(t) {
3651
+ var a = m(t.x - this.long0, this.over), i = Math.abs(t.y), e = Math.floor(i * Ya);
3652
+ e < 0 ? e = 0 : e >= et && (e = et - 1), i = z * (i - ch * e);
3653
+ var s = {
3654
+ x: Ut(Ht[e], i) * a,
3655
+ y: Ut(_t[e], i)
3656
+ };
3657
+ return t.y < 0 && (s.y = -s.y), s.x = s.x * this.a * Ja + this.x0, s.y = s.y * this.a * Za + this.y0, s;
3658
+ }
3659
+ function dh(t) {
3660
+ var a = {
3661
+ x: (t.x - this.x0) / (this.a * Ja),
3662
+ y: Math.abs(t.y - this.y0) / (this.a * Za)
3663
+ };
3664
+ if (a.y >= 1)
3665
+ a.x /= Ht[et][0], a.y = t.y < 0 ? -M : M;
3666
+ else {
3667
+ var i = Math.floor(a.y * et);
3668
+ for (i < 0 ? i = 0 : i >= et && (i = et - 1); ; ) if (_t[i][0] > a.y) --i;
3669
+ else if (_t[i + 1][0] <= a.y) ++i;
3670
+ else break;
3671
+ var e = _t[i], s = 5 * (a.y - e[0]) / (_t[i + 1][0] - e[0]);
3672
+ s = vh(function(r) {
3673
+ return (Ut(e, r) - a.y) / uh(e, r);
3674
+ }, s, Na, 100), a.x /= Ut(Ht[i], s), a.y = (5 * i + s) * I, t.y < 0 && (a.y = -a.y);
3675
+ }
3676
+ return a.x = m(a.x + this.long0, this.over), a;
3677
+ }
3678
+ var mh = ["Robinson", "robin"], yh = {
3679
+ init: Mh,
3680
+ forward: gh,
3681
+ inverse: dh,
3682
+ names: mh
3683
+ };
3684
+ function Eh() {
3685
+ this.name = "geocent";
3686
+ }
3687
+ function Sh(t) {
3688
+ return Fa(t, this.es, this.a);
3689
+ }
3690
+ function wh(t) {
3691
+ return Da(t, this.es, this.a, this.b);
3692
+ }
3693
+ var Ph = [
3694
+ "Geocentric",
3695
+ "geocentric",
3696
+ "geocent",
3697
+ "Geocent"
3698
+ ], Gh = {
3699
+ init: Eh,
3700
+ forward: Sh,
3701
+ inverse: wh,
3702
+ names: Ph
3703
+ }, p = {
3704
+ N_POLE: 0,
3705
+ S_POLE: 1,
3706
+ EQUIT: 2,
3707
+ OBLIQ: 3
3708
+ }, ot = {
3709
+ h: {
3710
+ def: 1e5,
3711
+ num: !0
3712
+ },
3713
+ azi: {
3714
+ def: 0,
3715
+ num: !0,
3716
+ degrees: !0
3717
+ },
3718
+ tilt: {
3719
+ def: 0,
3720
+ num: !0,
3721
+ degrees: !0
3722
+ },
3723
+ long0: {
3724
+ def: 0,
3725
+ num: !0
3726
+ },
3727
+ lat0: {
3728
+ def: 0,
3729
+ num: !0
3730
+ }
3731
+ };
3732
+ function xh() {
3733
+ if (Object.keys(ot).forEach(function(i) {
3734
+ if (typeof this[i] > "u") this[i] = ot[i].def;
3735
+ else {
3736
+ if (ot[i].num && isNaN(this[i])) throw new Error("Invalid parameter value, must be numeric " + i + " = " + this[i]);
3737
+ ot[i].num && (this[i] = parseFloat(this[i]));
3738
+ }
3739
+ ot[i].degrees && (this[i] = this[i] * I);
3740
+ }.bind(this)), Math.abs(Math.abs(this.lat0) - M) < 1e-10 ? this.mode = this.lat0 < 0 ? p.S_POLE : p.N_POLE : Math.abs(this.lat0) < 1e-10 ? this.mode = p.EQUIT : (this.mode = p.OBLIQ, this.sinph0 = Math.sin(this.lat0), this.cosph0 = Math.cos(this.lat0)), this.pn1 = this.h / this.a, this.pn1 <= 0 || this.pn1 > 1e10) throw new Error("Invalid height");
3741
+ this.p = 1 + this.pn1, this.rp = 1 / this.p, this.h1 = 1 / this.pn1, this.pfact = (this.p + 1) * this.h1, this.es = 0;
3742
+ var t = this.tilt, a = this.azi;
3743
+ this.cg = Math.cos(a), this.sg = Math.sin(a), this.cw = Math.cos(t), this.sw = Math.sin(t);
3744
+ }
3745
+ function bh(t) {
3746
+ t.x -= this.long0;
3747
+ var a = Math.sin(t.y), i = Math.cos(t.y), e = Math.cos(t.x), s, r;
3748
+ switch (this.mode) {
3749
+ case p.OBLIQ:
3750
+ r = this.sinph0 * a + this.cosph0 * i * e;
3751
+ break;
3752
+ case p.EQUIT:
3753
+ r = i * e;
3754
+ break;
3755
+ case p.S_POLE:
3756
+ r = -a;
3757
+ break;
3758
+ case p.N_POLE:
3759
+ r = a;
3760
+ break;
3761
+ }
3762
+ switch (r = this.pn1 / (this.p - r), s = r * i * Math.sin(t.x), this.mode) {
3763
+ case p.OBLIQ:
3764
+ r *= this.cosph0 * a - this.sinph0 * i * e;
3765
+ break;
3766
+ case p.EQUIT:
3767
+ r *= a;
3768
+ break;
3769
+ case p.N_POLE:
3770
+ r *= -(i * e);
3771
+ break;
3772
+ case p.S_POLE:
3773
+ r *= i * e;
3774
+ break;
3775
+ }
3776
+ var n = r * this.cg + s * this.sg, h = 1 / (n * this.sw * this.h1 + this.cw);
3777
+ return s = (s * this.cg - r * this.sg) * this.cw * h, r = n * h, t.x = s * this.a, t.y = r * this.a, t;
3778
+ }
3779
+ function Ah(t) {
3780
+ t.x /= this.a, t.y /= this.a;
3781
+ var a = {
3782
+ x: t.x,
3783
+ y: t.y
3784
+ }, i, e, s = 1 / (this.pn1 - t.y * this.sw);
3785
+ i = this.pn1 * t.x * s, e = this.pn1 * t.y * this.cw * s, t.x = i * this.cg + e * this.sg, t.y = e * this.cg - i * this.sg;
3786
+ var r = U(t.x, t.y);
3787
+ if (Math.abs(r) < 1e-10)
3788
+ a.x = 0, a.y = t.y;
3789
+ else {
3790
+ var n, h = 1 - r * r * this.pfact;
3791
+ switch (h = (this.p - Math.sqrt(h)) / (this.pn1 / r + r / this.pn1), n = Math.sqrt(1 - h * h), this.mode) {
3792
+ case p.OBLIQ:
3793
+ a.y = Math.asin(n * this.sinph0 + t.y * h * this.cosph0 / r), t.y = (n - this.sinph0 * Math.sin(a.y)) * r, t.x *= h * this.cosph0;
3794
+ break;
3795
+ case p.EQUIT:
3796
+ a.y = Math.asin(t.y * h / r), t.y = n * r, t.x *= h;
3797
+ break;
3798
+ case p.N_POLE:
3799
+ a.y = Math.asin(n), t.y = -t.y;
3800
+ break;
3801
+ case p.S_POLE:
3802
+ a.y = -Math.asin(n);
3803
+ break;
3804
+ }
3805
+ a.x = Math.atan2(t.x, t.y);
3806
+ }
3807
+ return t.x = a.x + this.long0, t.y = a.y, t;
3808
+ }
3809
+ var Nh = ["Tilted_Perspective", "tpers"], Ih = {
3810
+ init: xh,
3811
+ forward: bh,
3812
+ inverse: Ah,
3813
+ names: Nh
3814
+ };
3815
+ function Ch() {
3816
+ if (this.flip_axis = this.sweep === "x" ? 1 : 0, this.h = Number(this.h), this.radius_g_1 = this.h / this.a, this.radius_g_1 <= 0 || this.radius_g_1 > 1e10) throw new Error();
3817
+ if (this.radius_g = 1 + this.radius_g_1, this.C = this.radius_g * this.radius_g - 1, this.es !== 0) {
3818
+ var t = 1 - this.es, a = 1 / t;
3819
+ this.radius_p = Math.sqrt(t), this.radius_p2 = t, this.radius_p_inv2 = a, this.shape = "ellipse";
3820
+ } else
3821
+ this.radius_p = 1, this.radius_p2 = 1, this.radius_p_inv2 = 1, this.shape = "sphere";
3822
+ this.title || (this.title = "Geostationary Satellite View");
3823
+ }
3824
+ function Rh(t) {
3825
+ var a = t.x, i = t.y, e, s, r, n;
3826
+ if (a = a - this.long0, this.shape === "ellipse") {
3827
+ i = Math.atan(this.radius_p2 * Math.tan(i));
3828
+ var h = this.radius_p / U(this.radius_p * Math.cos(i), Math.sin(i));
3829
+ if (s = h * Math.cos(a) * Math.cos(i), r = h * Math.sin(a) * Math.cos(i), n = h * Math.sin(i), (this.radius_g - s) * s - r * r - n * n * this.radius_p_inv2 < 0)
3830
+ return t.x = NaN, t.y = NaN, t;
3831
+ e = this.radius_g - s, this.flip_axis ? (t.x = this.radius_g_1 * Math.atan(r / U(n, e)), t.y = this.radius_g_1 * Math.atan(n / e)) : (t.x = this.radius_g_1 * Math.atan(r / e), t.y = this.radius_g_1 * Math.atan(n / U(r, e)));
3832
+ } else this.shape === "sphere" && (e = Math.cos(i), s = Math.cos(a) * e, r = Math.sin(a) * e, n = Math.sin(i), e = this.radius_g - s, this.flip_axis ? (t.x = this.radius_g_1 * Math.atan(r / U(n, e)), t.y = this.radius_g_1 * Math.atan(n / e)) : (t.x = this.radius_g_1 * Math.atan(r / e), t.y = this.radius_g_1 * Math.atan(n / U(r, e))));
3833
+ return t.x = t.x * this.a, t.y = t.y * this.a, t;
3834
+ }
3835
+ function Oh(t) {
3836
+ var a = -1, i = 0, e = 0, s, r, n, h;
3837
+ if (t.x = t.x / this.a, t.y = t.y / this.a, this.shape === "ellipse") {
3838
+ this.flip_axis ? (e = Math.tan(t.y / this.radius_g_1), i = Math.tan(t.x / this.radius_g_1) * U(1, e)) : (i = Math.tan(t.x / this.radius_g_1), e = Math.tan(t.y / this.radius_g_1) * U(1, i));
3839
+ var o = e / this.radius_p;
3840
+ if (s = i * i + o * o + a * a, r = 2 * this.radius_g * a, n = r * r - 4 * s * this.C, n < 0)
3841
+ return t.x = NaN, t.y = NaN, t;
3842
+ h = (-r - Math.sqrt(n)) / (2 * s), a = this.radius_g + h * a, i *= h, e *= h, t.x = Math.atan2(i, a), t.y = Math.atan(e * Math.cos(t.x) / a), t.y = Math.atan(this.radius_p_inv2 * Math.tan(t.y));
3843
+ } else if (this.shape === "sphere") {
3844
+ if (this.flip_axis ? (e = Math.tan(t.y / this.radius_g_1), i = Math.tan(t.x / this.radius_g_1) * Math.sqrt(1 + e * e)) : (i = Math.tan(t.x / this.radius_g_1), e = Math.tan(t.y / this.radius_g_1) * Math.sqrt(1 + i * i)), s = i * i + e * e + a * a, r = 2 * this.radius_g * a, n = r * r - 4 * s * this.C, n < 0)
3845
+ return t.x = NaN, t.y = NaN, t;
3846
+ h = (-r - Math.sqrt(n)) / (2 * s), a = this.radius_g + h * a, i *= h, e *= h, t.x = Math.atan2(i, a), t.y = Math.atan(e * Math.cos(t.x) / a);
3847
+ }
3848
+ return t.x = t.x + this.long0, t;
3849
+ }
3850
+ var Th = [
3851
+ "Geostationary Satellite View",
3852
+ "Geostationary_Satellite",
3853
+ "geos"
3854
+ ], ph = {
3855
+ init: Ch,
3856
+ forward: Rh,
3857
+ inverse: Oh,
3858
+ names: Th
3859
+ }, ut = 1.340264, vt = -0.081106, Mt = 893e-6, gt = 3796e-6, kt = Math.sqrt(3) / 2;
3860
+ function Lh() {
3861
+ this.es = 0, this.long0 = this.long0 !== void 0 ? this.long0 : 0, this.x0 = this.x0 !== void 0 ? this.x0 : 0, this.y0 = this.y0 !== void 0 ? this.y0 : 0;
3862
+ }
3863
+ function qh(t) {
3864
+ var a = m(t.x - this.long0, this.over), i = t.y, e = Math.asin(kt * Math.sin(i)), s = e * e, r = s * s * s;
3865
+ return t.x = a * Math.cos(e) / (kt * (ut + 3 * vt * s + r * (7 * Mt + 9 * gt * s))), t.y = e * (ut + vt * s + r * (Mt + gt * s)), t.x = this.a * t.x + this.x0, t.y = this.a * t.y + this.y0, t;
3866
+ }
3867
+ function Uh(t) {
3868
+ t.x = (t.x - this.x0) / this.a, t.y = (t.y - this.y0) / this.a;
3869
+ var a = 1e-9, i = 12, e = t.y, s, r, n, h, o, f;
3870
+ for (f = 0; f < i && (s = e * e, r = s * s * s, n = e * (ut + vt * s + r * (Mt + gt * s)) - t.y, h = ut + 3 * vt * s + r * (7 * Mt + 9 * gt * s), e -= o = n / h, !(Math.abs(o) < a)); ++f)
3871
+ ;
3872
+ return s = e * e, r = s * s * s, t.x = kt * t.x * (ut + 3 * vt * s + r * (7 * Mt + 9 * gt * s)) / Math.cos(e), t.y = Math.asin(Math.sin(e) / kt), t.x = m(t.x + this.long0, this.over), t;
3873
+ }
3874
+ var kh = [
3875
+ "eqearth",
3876
+ "Equal Earth",
3877
+ "Equal_Earth"
3878
+ ], $h = {
3879
+ init: Lh,
3880
+ forward: qh,
3881
+ inverse: Uh,
3882
+ names: kh
3883
+ }, Et = 1e-10;
3884
+ function Fh() {
3885
+ var t;
3886
+ if (this.phi1 = this.lat1, Math.abs(this.phi1) < Et) throw new Error();
3887
+ this.es ? (this.en = Jt(this.es), this.m1 = nt(this.phi1, this.am1 = Math.sin(this.phi1), t = Math.cos(this.phi1), this.en), this.am1 = t / (Math.sqrt(1 - this.es * this.am1 * this.am1) * this.am1), this.inverse = Bh, this.forward = Dh) : (Math.abs(this.phi1) + Et >= M ? this.cphi1 = 0 : this.cphi1 = 1 / Math.tan(this.phi1), this.inverse = zh, this.forward = jh);
3888
+ }
3889
+ function Dh(t) {
3890
+ var a = m(t.x - (this.long0 || 0), this.over), i = t.y, e = this.am1 + this.m1 - nt(i, s = Math.sin(i), r = Math.cos(i), this.en), s = r * a / (e * Math.sqrt(1 - this.es * s * s)), r;
3891
+ return t.x = e * Math.sin(s), t.y = this.am1 - e * Math.cos(s), t.x = this.a * t.x + (this.x0 || 0), t.y = this.a * t.y + (this.y0 || 0), t;
3892
+ }
3893
+ function Bh(t) {
3894
+ t.x = (t.x - (this.x0 || 0)) / this.a, t.y = (t.y - (this.y0 || 0)) / this.a;
3895
+ var a, i = U(t.x, t.y = this.am1 - t.y), e, s = Zt(this.am1 + this.m1 - i, this.es, this.en);
3896
+ if ((a = Math.abs(s)) < M)
3897
+ a = Math.sin(s), e = i * Math.atan2(t.x, t.y) * Math.sqrt(1 - this.es * a * a) / Math.cos(s);
3898
+ else if (Math.abs(a - M) <= Et) e = 0;
3899
+ else throw new Error();
3900
+ return t.x = m(e + (this.long0 || 0), this.over), t.y = Z(s), t;
3901
+ }
3902
+ function jh(t) {
3903
+ var a = m(t.x - (this.long0 || 0), this.over), i = t.y, e, s = this.cphi1 + this.phi1 - i;
3904
+ return Math.abs(s) > Et ? (t.x = s * Math.sin(e = a * Math.cos(i) / s), t.y = this.cphi1 - s * Math.cos(e)) : t.x = t.y = 0, t.x = this.a * t.x + (this.x0 || 0), t.y = this.a * t.y + (this.y0 || 0), t;
3905
+ }
3906
+ function zh(t) {
3907
+ t.x = (t.x - (this.x0 || 0)) / this.a, t.y = (t.y - (this.y0 || 0)) / this.a;
3908
+ var a, i, e = U(t.x, t.y = this.cphi1 - t.y);
3909
+ if (i = this.cphi1 + this.phi1 - e, Math.abs(i) > M) throw new Error();
3910
+ return Math.abs(Math.abs(i) - M) <= Et ? a = 0 : a = e * Math.atan2(t.x, t.y) / Math.cos(i), t.x = m(a + (this.long0 || 0), this.over), t.y = Z(i), t;
3911
+ }
3912
+ var Wh = ["bonne", "Bonne (Werner lat_1=90)"], Qh = {
3913
+ init: Fh,
3914
+ names: Wh
3915
+ }, Aa = {
3916
+ OBLIQUE: {
3917
+ forward: Jh,
3918
+ inverse: Yh
3919
+ },
3920
+ TRANSVERSE: {
3921
+ forward: Zh,
3922
+ inverse: tn
3923
+ }
3924
+ }, $t = {
3925
+ ROTATE: {
3926
+ o_alpha: "oAlpha",
3927
+ o_lon_c: "oLongC",
3928
+ o_lat_c: "oLatC"
3929
+ },
3930
+ NEW_POLE: {
3931
+ o_lat_p: "oLatP",
3932
+ o_lon_p: "oLongP"
3933
+ },
3934
+ NEW_EQUATOR: {
3935
+ o_lon_1: "oLong1",
3936
+ o_lat_1: "oLat1",
3937
+ o_lon_2: "oLong2",
3938
+ o_lat_2: "oLat2"
3939
+ }
3940
+ };
3941
+ function Hh() {
3942
+ if (this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.long0 = this.long0 || 0, this.title = this.title || "General Oblique Transformation", this.isIdentity = qa.includes(this.o_proj), !this.o_proj) throw new Error("Missing parameter: o_proj");
3943
+ if (this.o_proj === "ob_tran") throw new Error("Invalid value for o_proj: " + this.o_proj);
3944
+ const t = D(this.projStr.replace("+proj=ob_tran", "").replace("+o_proj=", "+proj=").trim());
3945
+ if (!t) throw new Error("Invalid parameter: o_proj. Unknown projection " + this.o_proj);
3946
+ t.long0 = 0, this.obliqueProjection = t;
3947
+ let a;
3948
+ const i = Object.keys($t), e = (n) => {
3949
+ if (typeof this[n] > "u") return;
3950
+ const h = parseFloat(this[n]) * I;
3951
+ if (isNaN(h)) throw new Error("Invalid value for " + n + ": " + this[n]);
3952
+ return h;
3953
+ };
3954
+ for (let n = 0; n < i.length; n++) {
3955
+ const h = $t[i[n]], o = Object.entries(h);
3956
+ if (o.some(([f]) => typeof this[f] < "u")) {
3957
+ a = h;
3958
+ for (let f = 0; f < o.length; f++) {
3959
+ const [_, l] = o[f], c = e(_);
3960
+ if (typeof c > "u") throw new Error("Missing parameter: " + _ + ".");
3961
+ this[l] = c;
3962
+ }
3963
+ break;
3964
+ }
3965
+ }
3966
+ if (!a) throw new Error("No valid parameters provided for ob_tran projection.");
3967
+ const { lamp: s, phip: r } = Vh(this, a);
3968
+ this.lamp = s, Math.abs(r) > 1e-10 ? (this.cphip = Math.cos(r), this.sphip = Math.sin(r), this.projectionType = Aa.OBLIQUE) : this.projectionType = Aa.TRANSVERSE;
3969
+ }
3970
+ function Kh(t) {
3971
+ return this.projectionType.forward(this, t);
3972
+ }
3973
+ function Xh(t) {
3974
+ return this.projectionType.inverse(this, t);
3975
+ }
3976
+ function Vh(t, a) {
3977
+ let i, e;
3978
+ if (a === $t.ROTATE) {
3979
+ let s = t.oLongC, r = t.oLatC, n = t.oAlpha;
3980
+ if (Math.abs(Math.abs(r) - M) <= 1e-10) throw new Error("Invalid value for o_lat_c: " + t.o_lat_c + " should be < 90°");
3981
+ e = s + Math.atan2(-1 * Math.cos(n), -1 * Math.sin(n) * Math.sin(r)), i = Math.asin(Math.cos(r) * Math.sin(n));
3982
+ } else if (a === $t.NEW_POLE)
3983
+ e = t.oLongP, i = t.oLatP;
3984
+ else {
3985
+ let s = t.oLong1, r = t.oLat1, n = t.oLong2, h = t.oLat2, o = Math.abs(r);
3986
+ if (Math.abs(r) > M - 1e-10) throw new Error("Invalid value for o_lat_1: " + t.o_lat_1 + " should be < 90°");
3987
+ if (Math.abs(h) > M - 1e-10) throw new Error("Invalid value for o_lat_2: " + t.o_lat_2 + " should be < 90°");
3988
+ if (Math.abs(r - h) < 1e-10) throw new Error("Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2");
3989
+ if (o < 1e-10) throw new Error("Invalid value for o_lat_1: o_lat_1 should be different from zero");
3990
+ e = Math.atan2(Math.cos(r) * Math.sin(h) * Math.cos(s) - Math.sin(r) * Math.cos(h) * Math.cos(n), Math.sin(r) * Math.cos(h) * Math.sin(n) - Math.cos(r) * Math.sin(h) * Math.sin(s)), i = Math.atan(-1 * Math.cos(e - s) / Math.tan(r));
3991
+ }
3992
+ return {
3993
+ lamp: e,
3994
+ phip: i
3995
+ };
3996
+ }
3997
+ function Jh(t, a) {
3998
+ let { x: i, y: e } = a;
3999
+ i += t.long0;
4000
+ const s = Math.cos(i), r = Math.sin(e), n = Math.cos(e);
4001
+ a.x = m(Math.atan2(n * Math.sin(i), t.sphip * n * s + t.cphip * r) + t.lamp), a.y = Math.asin(t.sphip * r - t.cphip * n * s);
4002
+ const h = t.obliqueProjection.forward(a);
4003
+ return t.isIdentity && (h.x *= z, h.y *= z), h;
4004
+ }
4005
+ function Zh(t, a) {
4006
+ let { x: i, y: e } = a;
4007
+ i += t.long0;
4008
+ const s = Math.cos(e), r = Math.cos(i);
4009
+ a.x = m(Math.atan2(s * Math.sin(i), Math.sin(e)) + t.lamp), a.y = Math.asin(-1 * s * r);
4010
+ const n = t.obliqueProjection.forward(a);
4011
+ return t.isIdentity && (n.x *= z, n.y *= z), n;
4012
+ }
4013
+ function Yh(t, a) {
4014
+ t.isIdentity && (a.x *= I, a.y *= I);
4015
+ let { x: i, y: e } = t.obliqueProjection.inverse(a);
4016
+ if (i < Number.MAX_VALUE) {
4017
+ i -= t.lamp;
4018
+ const s = Math.cos(i), r = Math.sin(e), n = Math.cos(e);
4019
+ a.x = Math.atan2(n * Math.sin(i), t.sphip * n * s - t.cphip * r), a.y = Math.asin(t.sphip * r + t.cphip * n * s);
4020
+ }
4021
+ return a.x = m(a.x + t.long0), a;
4022
+ }
4023
+ function tn(t, a) {
4024
+ t.isIdentity && (a.x *= I, a.y *= I);
4025
+ let { x: i, y: e } = t.obliqueProjection.inverse(a);
4026
+ if (i < Number.MAX_VALUE) {
4027
+ const s = Math.cos(e);
4028
+ i -= t.lamp, a.x = Math.atan2(s * Math.sin(i), -1 * Math.sin(e)), a.y = Math.asin(s * Math.cos(i));
4029
+ }
4030
+ return a.x = m(a.x + t.long0), a;
4031
+ }
4032
+ var an = [
4033
+ "General Oblique Transformation",
4034
+ "General_Oblique_Transformation",
4035
+ "ob_tran"
4036
+ ], sn = {
4037
+ init: Hh,
4038
+ forward: Kh,
4039
+ inverse: Xh,
4040
+ names: an
4041
+ };
4042
+ function en(t) {
4043
+ t.Proj.projections.add(Ct), t.Proj.projections.add(Rt), t.Proj.projections.add(zs), t.Proj.projections.add(te), t.Proj.projections.add(re), t.Proj.projections.add(fe), t.Proj.projections.add(ge), t.Proj.projections.add(Se), t.Proj.projections.add(be), t.Proj.projections.add(Re), t.Proj.projections.add(ze), t.Proj.projections.add(Ve), t.Proj.projections.add(ar), t.Proj.projections.add(nr), t.Proj.projections.add(cr), t.Proj.projections.add(dr), t.Proj.projections.add(wr), t.Proj.projections.add(Ar), t.Proj.projections.add(Tr), t.Proj.projections.add(kr), t.Proj.projections.add(jr), t.Proj.projections.add(Kr), t.Proj.projections.add(ah), t.Proj.projections.add(hh), t.Proj.projections.add(_h), t.Proj.projections.add(yh), t.Proj.projections.add(Gh), t.Proj.projections.add(Ih), t.Proj.projections.add(ph), t.Proj.projections.add($h), t.Proj.projections.add(Qh), t.Proj.projections.add(sn);
4044
+ }
4045
+ var rn = Object.assign(ns, {
4046
+ defaultDatum: "WGS84",
4047
+ Proj: D,
4048
+ WGS84: new D("WGS84"),
4049
+ Point: ht,
4050
+ toPoint: Ba,
4051
+ defs: O,
4052
+ nadgrid: ji,
4053
+ transform: Lt,
4054
+ mgrs: os,
4055
+ version: "__VERSION__"
4056
+ });
4057
+ en(rn);
4058
+ export {
4059
+ rn as default
4060
+ };