@pggis/pg-sdk 3.3.10 → 4.3.3

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 (163) hide show
  1. package/README.md +8 -8
  2. package/dist/index.js +1966 -4
  3. package/dist/pggis.min.css +1 -1
  4. package/dist/pggis.min.js +10980 -7539
  5. package/dist/resources/ThirdParty/Workers/pako_deflate.min.js +1 -2
  6. package/dist/resources/ThirdParty/Workers/pako_inflate.min.js +1 -2
  7. package/dist/resources/ThirdParty/Workers/z-worker-pako.js +1 -1
  8. package/dist/resources/ThirdParty/google-earth-dbroot-parser.js +1 -8337
  9. package/dist/resources/ThirdParty/wasm_splats_bg.wasm +0 -0
  10. package/dist/resources/Workers/chunk-35SHYARM.js +26 -0
  11. package/dist/resources/Workers/chunk-37F5JSTI.js +26 -0
  12. package/dist/resources/Workers/chunk-3SSKC3VN.js +26 -0
  13. package/dist/resources/Workers/chunk-3W4GT7KQ.js +26 -0
  14. package/dist/resources/Workers/chunk-4IW2T6GF.js +26 -0
  15. package/dist/resources/Workers/chunk-5YEWO3HT.js +26 -0
  16. package/dist/resources/Workers/chunk-64RSHJUE.js +28 -0
  17. package/dist/resources/Workers/chunk-77IHZJJ3.js +26 -0
  18. package/dist/resources/Workers/chunk-7HTKERZY.js +26 -0
  19. package/dist/resources/Workers/{chunk-F3YA3Y2Z.js → chunk-A56XVLQR.js} +2 -13
  20. package/dist/resources/Workers/chunk-AJYK4IVJ.js +26 -0
  21. package/dist/resources/Workers/{chunk-EHWHNOEX.js → chunk-ARG42DC4.js} +2 -31
  22. package/dist/resources/Workers/chunk-AU7IKHOH.js +26 -0
  23. package/dist/resources/Workers/chunk-B4AA3ARO.js +26 -0
  24. package/dist/resources/Workers/chunk-CNCV5UL7.js +26 -0
  25. package/dist/resources/Workers/chunk-CYCB63OH.js +26 -0
  26. package/dist/resources/Workers/{chunk-4H7PY4U5.js → chunk-D6AA5QVT.js} +2 -20
  27. package/dist/resources/Workers/chunk-D6C66QON.js +26 -0
  28. package/dist/resources/Workers/chunk-DEPHB2WM.js +26 -0
  29. package/dist/resources/Workers/chunk-DMEY62ID.js +26 -0
  30. package/dist/resources/Workers/chunk-DQQ63PYM.js +26 -0
  31. package/dist/resources/Workers/chunk-ED5JPB3S.js +27 -0
  32. package/dist/resources/Workers/chunk-EZUYS2JF.js +26 -0
  33. package/dist/resources/Workers/chunk-FEVXJ54I.js +26 -0
  34. package/dist/resources/Workers/chunk-G5AGHVVC.js +26 -0
  35. package/dist/resources/Workers/{chunk-BBWDMCVU.js → chunk-GBYLG25F.js} +2 -15
  36. package/dist/resources/Workers/chunk-GILIDQNQ.js +26 -0
  37. package/dist/resources/Workers/chunk-HMIYSTF6.js +26 -0
  38. package/dist/resources/Workers/chunk-HTFSEEMT.js +26 -0
  39. package/dist/resources/Workers/chunk-HWXX4CWK.js +26 -0
  40. package/dist/resources/Workers/chunk-IYTZ52EY.js +26 -0
  41. package/dist/resources/Workers/chunk-J6UP6FLE.js +26 -0
  42. package/dist/resources/Workers/chunk-LEYMRMBK.js +27 -0
  43. package/dist/resources/Workers/chunk-M3MGYQSL.js +26 -0
  44. package/dist/resources/Workers/chunk-N4VJKXZS.js +26 -0
  45. package/dist/resources/Workers/chunk-NB3ML6JO.js +26 -0
  46. package/dist/resources/Workers/chunk-OFUUQVMR.js +26 -0
  47. package/dist/resources/Workers/chunk-OSW76XDF.js +26 -0
  48. package/dist/resources/Workers/chunk-PSPPBZWI.js +66 -0
  49. package/dist/resources/Workers/chunk-QN3VOORQ.js +26 -0
  50. package/dist/resources/Workers/chunk-QOUAJ6TL.js +26 -0
  51. package/dist/resources/Workers/chunk-RCV6KWXS.js +26 -0
  52. package/dist/resources/Workers/chunk-TCGIRNHN.js +26 -0
  53. package/dist/resources/Workers/chunk-U4IEOH5K.js +26 -0
  54. package/dist/resources/Workers/chunk-UP6I5URU.js +26 -0
  55. package/dist/resources/Workers/chunk-VTAIKJXX.js +26 -0
  56. package/dist/resources/Workers/chunk-VTBDSFTG.js +26 -0
  57. package/dist/resources/Workers/chunk-VW6VD53G.js +26 -0
  58. package/dist/resources/Workers/chunk-WGGIH7QW.js +26 -0
  59. package/dist/resources/Workers/chunk-WWA5PL4H.js +26 -0
  60. package/dist/resources/Workers/chunk-WZDE3RYP.js +28 -0
  61. package/dist/resources/Workers/chunk-XRL4AVS5.js +26 -0
  62. package/dist/resources/Workers/combineGeometry.js +2 -44
  63. package/dist/resources/Workers/createBoxGeometry.js +2 -34
  64. package/dist/resources/Workers/createBoxOutlineGeometry.js +2 -211
  65. package/dist/resources/Workers/createCircleGeometry.js +2 -173
  66. package/dist/resources/Workers/createCircleOutlineGeometry.js +2 -123
  67. package/dist/resources/Workers/createCoplanarPolygonGeometry.js +2 -482
  68. package/dist/resources/Workers/createCoplanarPolygonOutlineGeometry.js +2 -201
  69. package/dist/resources/Workers/createCorridorGeometry.js +2 -1239
  70. package/dist/resources/Workers/createCorridorOutlineGeometry.js +2 -544
  71. package/dist/resources/Workers/createCylinderGeometry.js +2 -36
  72. package/dist/resources/Workers/createCylinderOutlineGeometry.js +2 -207
  73. package/dist/resources/Workers/createEllipseGeometry.js +2 -47
  74. package/dist/resources/Workers/createEllipseOutlineGeometry.js +2 -40
  75. package/dist/resources/Workers/createEllipsoidGeometry.js +2 -35
  76. package/dist/resources/Workers/createEllipsoidOutlineGeometry.js +2 -37
  77. package/dist/resources/Workers/createFrustumGeometry.js +2 -34
  78. package/dist/resources/Workers/createFrustumOutlineGeometry.js +2 -211
  79. package/dist/resources/Workers/createGeometry.js +2 -147
  80. package/dist/resources/Workers/createGroundPolylineGeometry.js +2 -1584
  81. package/dist/resources/Workers/createPlaneGeometry.js +2 -200
  82. package/dist/resources/Workers/createPlaneOutlineGeometry.js +2 -100
  83. package/dist/resources/Workers/createPolygonGeometry.js +2 -1387
  84. package/dist/resources/Workers/createPolygonOutlineGeometry.js +2 -519
  85. package/dist/resources/Workers/createPolylineGeometry.js +2 -472
  86. package/dist/resources/Workers/createPolylineVolumeGeometry.js +2 -355
  87. package/dist/resources/Workers/createPolylineVolumeOutlineGeometry.js +2 -253
  88. package/dist/resources/Workers/createRectangleGeometry.js +2 -1250
  89. package/dist/resources/Workers/createRectangleOutlineGeometry.js +2 -455
  90. package/dist/resources/Workers/createSimplePolylineGeometry.js +2 -376
  91. package/dist/resources/Workers/createSphereGeometry.js +2 -94
  92. package/dist/resources/Workers/createSphereOutlineGeometry.js +2 -94
  93. package/dist/resources/Workers/createTaskProcessorWorker.js +2 -8
  94. package/dist/resources/Workers/createVectorTileClampedPolylines.js +2 -468
  95. package/dist/resources/Workers/createVectorTileGeometries.js +2 -363
  96. package/dist/resources/Workers/createVectorTilePoints.js +2 -88
  97. package/dist/resources/Workers/createVectorTilePolygons.js +2 -361
  98. package/dist/resources/Workers/createVectorTilePolylines.js +2 -238
  99. package/dist/resources/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +2 -545
  100. package/dist/resources/Workers/createVerticesFromHeightmap.js +2 -2254
  101. package/dist/resources/Workers/createVerticesFromQuantizedTerrainMesh.js +2 -722
  102. package/dist/resources/Workers/createWallGeometry.js +2 -466
  103. package/dist/resources/Workers/createWallOutlineGeometry.js +2 -314
  104. package/dist/resources/Workers/decodeDraco.js +2 -345
  105. package/dist/resources/Workers/decodeGoogleEarthEnterprisePacket.js +2 -2626
  106. package/dist/resources/Workers/decodeI3S.js +2 -1320
  107. package/dist/resources/Workers/gaussianSplatSorter.js +26 -0
  108. package/dist/resources/Workers/gaussianSplatTextureGenerator.js +26 -0
  109. package/dist/resources/Workers/transcodeKTX2.js +29 -3398
  110. package/dist/resources/Workers/transferTypedArrayTest.js +2 -17
  111. package/dist/resources/Workers/upsampleQuantizedTerrainMesh.js +2 -795
  112. package/package.json +9 -8
  113. package/dist/resources/ThirdParty/Workers/basis_transcoder.js +0 -21
  114. package/dist/resources/Workers/chunk-23UFSGND.js +0 -236
  115. package/dist/resources/Workers/chunk-2A75IWRS.js +0 -218
  116. package/dist/resources/Workers/chunk-2FRVPMCS.js +0 -1258
  117. package/dist/resources/Workers/chunk-2FWRMUTY.js +0 -138
  118. package/dist/resources/Workers/chunk-2UPKWTMJ.js +0 -117
  119. package/dist/resources/Workers/chunk-34FXV7D7.js +0 -73
  120. package/dist/resources/Workers/chunk-3VAZEH7M.js +0 -101
  121. package/dist/resources/Workers/chunk-4DO5W5XZ.js +0 -196
  122. package/dist/resources/Workers/chunk-5QULIR53.js +0 -501
  123. package/dist/resources/Workers/chunk-7TC63SJW.js +0 -302
  124. package/dist/resources/Workers/chunk-7ZFGPDJA.js +0 -122
  125. package/dist/resources/Workers/chunk-A5DWLWCY.js +0 -834
  126. package/dist/resources/Workers/chunk-BG4UCVXN.js +0 -73
  127. package/dist/resources/Workers/chunk-BIKA3NRA.js +0 -59
  128. package/dist/resources/Workers/chunk-BROJAZRZ.js +0 -390
  129. package/dist/resources/Workers/chunk-DDUQAJ4P.js +0 -476
  130. package/dist/resources/Workers/chunk-EERJKOAF.js +0 -305
  131. package/dist/resources/Workers/chunk-EG6PTBY2.js +0 -2716
  132. package/dist/resources/Workers/chunk-F4HFJMGM.js +0 -353
  133. package/dist/resources/Workers/chunk-FJKNFAKQ.js +0 -8219
  134. package/dist/resources/Workers/chunk-FNIRWHJB.js +0 -289
  135. package/dist/resources/Workers/chunk-FZRIVR7Y.js +0 -100
  136. package/dist/resources/Workers/chunk-G43QFN4Q.js +0 -157
  137. package/dist/resources/Workers/chunk-GATZHF3K.js +0 -1860
  138. package/dist/resources/Workers/chunk-GRC2ZTAF.js +0 -398
  139. package/dist/resources/Workers/chunk-HU6N6EXB.js +0 -767
  140. package/dist/resources/Workers/chunk-I46ZRR5W.js +0 -1052
  141. package/dist/resources/Workers/chunk-JURN7NPV.js +0 -1075
  142. package/dist/resources/Workers/chunk-KKCR2YOP.js +0 -421
  143. package/dist/resources/Workers/chunk-LPR3YNP2.js +0 -138
  144. package/dist/resources/Workers/chunk-M7ERACJJ.js +0 -511
  145. package/dist/resources/Workers/chunk-MDWEGWPA.js +0 -1007
  146. package/dist/resources/Workers/chunk-OGXZVPPM.js +0 -2365
  147. package/dist/resources/Workers/chunk-PGSJK77E.js +0 -634
  148. package/dist/resources/Workers/chunk-PPH7OFP3.js +0 -258
  149. package/dist/resources/Workers/chunk-SH5USDPI.js +0 -456
  150. package/dist/resources/Workers/chunk-SOWMRMWA.js +0 -629
  151. package/dist/resources/Workers/chunk-STW2DGFI.js +0 -58
  152. package/dist/resources/Workers/chunk-T3XIFPYR.js +0 -1477
  153. package/dist/resources/Workers/chunk-TTUZP4BO.js +0 -501
  154. package/dist/resources/Workers/chunk-UEXTBDBE.js +0 -693
  155. package/dist/resources/Workers/chunk-VOXYEYJT.js +0 -684
  156. package/dist/resources/Workers/chunk-X4356LRH.js +0 -368
  157. package/dist/resources/Workers/chunk-XGI5BXZY.js +0 -163
  158. package/dist/resources/Workers/chunk-Y2ME2IJV.js +0 -781
  159. package/dist/resources/Workers/chunk-Y5UQJLYE.js +0 -171
  160. package/dist/resources/Workers/chunk-YJEBABKH.js +0 -2977
  161. package/dist/resources/Workers/chunk-YWTJ2B4B.js +0 -77
  162. package/dist/resources/Workers/chunk-Z3TIFFGF.js +0 -430
  163. package/dist/resources/Workers/chunk-ZT7KWISZ.js +0 -102
@@ -1,353 +0,0 @@
1
- /**
2
- * @license
3
- * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.115
5
- *
6
- * Copyright 2011-2022 Cesium Contributors
7
- *
8
- * Licensed under the Apache License, Version 2.0 (the "License");
9
- * you may not use this file except in compliance with the License.
10
- * You may obtain a copy of the License at
11
- *
12
- * http://www.apache.org/licenses/LICENSE-2.0
13
- *
14
- * Unless required by applicable law or agreed to in writing, software
15
- * distributed under the License is distributed on an "AS IS" BASIS,
16
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
- * See the License for the specific language governing permissions and
18
- * limitations under the License.
19
- *
20
- * Columbus View (Pat. Pend.)
21
- *
22
- * Portions licensed separately.
23
- * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
24
- */
25
-
26
- import {
27
- Cartesian3_default,
28
- Cartographic_default,
29
- Ellipsoid_default
30
- } from "./chunk-OGXZVPPM.js";
31
- import {
32
- Math_default
33
- } from "./chunk-5QULIR53.js";
34
- import {
35
- defaultValue_default
36
- } from "./chunk-BBWDMCVU.js";
37
- import {
38
- Check_default
39
- } from "./chunk-XGI5BXZY.js";
40
- import {
41
- defined_default
42
- } from "./chunk-YWTJ2B4B.js";
43
-
44
- // packages/engine/Source/Core/EllipsoidGeodesic.js
45
- function setConstants(ellipsoidGeodesic) {
46
- const uSquared = ellipsoidGeodesic._uSquared;
47
- const a = ellipsoidGeodesic._ellipsoid.maximumRadius;
48
- const b = ellipsoidGeodesic._ellipsoid.minimumRadius;
49
- const f = (a - b) / a;
50
- const cosineHeading = Math.cos(ellipsoidGeodesic._startHeading);
51
- const sineHeading = Math.sin(ellipsoidGeodesic._startHeading);
52
- const tanU = (1 - f) * Math.tan(ellipsoidGeodesic._start.latitude);
53
- const cosineU = 1 / Math.sqrt(1 + tanU * tanU);
54
- const sineU = cosineU * tanU;
55
- const sigma = Math.atan2(tanU, cosineHeading);
56
- const sineAlpha = cosineU * sineHeading;
57
- const sineSquaredAlpha = sineAlpha * sineAlpha;
58
- const cosineSquaredAlpha = 1 - sineSquaredAlpha;
59
- const cosineAlpha = Math.sqrt(cosineSquaredAlpha);
60
- const u2Over4 = uSquared / 4;
61
- const u4Over16 = u2Over4 * u2Over4;
62
- const u6Over64 = u4Over16 * u2Over4;
63
- const u8Over256 = u4Over16 * u4Over16;
64
- const a0 = 1 + u2Over4 - 3 * u4Over16 / 4 + 5 * u6Over64 / 4 - 175 * u8Over256 / 64;
65
- const a1 = 1 - u2Over4 + 15 * u4Over16 / 8 - 35 * u6Over64 / 8;
66
- const a2 = 1 - 3 * u2Over4 + 35 * u4Over16 / 4;
67
- const a3 = 1 - 5 * u2Over4;
68
- const distanceRatio = a0 * sigma - a1 * Math.sin(2 * sigma) * u2Over4 / 2 - a2 * Math.sin(4 * sigma) * u4Over16 / 16 - a3 * Math.sin(6 * sigma) * u6Over64 / 48 - Math.sin(8 * sigma) * 5 * u8Over256 / 512;
69
- const constants = ellipsoidGeodesic._constants;
70
- constants.a = a;
71
- constants.b = b;
72
- constants.f = f;
73
- constants.cosineHeading = cosineHeading;
74
- constants.sineHeading = sineHeading;
75
- constants.tanU = tanU;
76
- constants.cosineU = cosineU;
77
- constants.sineU = sineU;
78
- constants.sigma = sigma;
79
- constants.sineAlpha = sineAlpha;
80
- constants.sineSquaredAlpha = sineSquaredAlpha;
81
- constants.cosineSquaredAlpha = cosineSquaredAlpha;
82
- constants.cosineAlpha = cosineAlpha;
83
- constants.u2Over4 = u2Over4;
84
- constants.u4Over16 = u4Over16;
85
- constants.u6Over64 = u6Over64;
86
- constants.u8Over256 = u8Over256;
87
- constants.a0 = a0;
88
- constants.a1 = a1;
89
- constants.a2 = a2;
90
- constants.a3 = a3;
91
- constants.distanceRatio = distanceRatio;
92
- }
93
- function computeC(f, cosineSquaredAlpha) {
94
- return f * cosineSquaredAlpha * (4 + f * (4 - 3 * cosineSquaredAlpha)) / 16;
95
- }
96
- function computeDeltaLambda(f, sineAlpha, cosineSquaredAlpha, sigma, sineSigma, cosineSigma, cosineTwiceSigmaMidpoint) {
97
- const C = computeC(f, cosineSquaredAlpha);
98
- return (1 - C) * f * sineAlpha * (sigma + C * sineSigma * (cosineTwiceSigmaMidpoint + C * cosineSigma * (2 * cosineTwiceSigmaMidpoint * cosineTwiceSigmaMidpoint - 1)));
99
- }
100
- function vincentyInverseFormula(ellipsoidGeodesic, major, minor, firstLongitude, firstLatitude, secondLongitude, secondLatitude) {
101
- const eff = (major - minor) / major;
102
- const l = secondLongitude - firstLongitude;
103
- const u1 = Math.atan((1 - eff) * Math.tan(firstLatitude));
104
- const u2 = Math.atan((1 - eff) * Math.tan(secondLatitude));
105
- const cosineU1 = Math.cos(u1);
106
- const sineU1 = Math.sin(u1);
107
- const cosineU2 = Math.cos(u2);
108
- const sineU2 = Math.sin(u2);
109
- const cc = cosineU1 * cosineU2;
110
- const cs = cosineU1 * sineU2;
111
- const ss = sineU1 * sineU2;
112
- const sc = sineU1 * cosineU2;
113
- let lambda = l;
114
- let lambdaDot = Math_default.TWO_PI;
115
- let cosineLambda = Math.cos(lambda);
116
- let sineLambda = Math.sin(lambda);
117
- let sigma;
118
- let cosineSigma;
119
- let sineSigma;
120
- let cosineSquaredAlpha;
121
- let cosineTwiceSigmaMidpoint;
122
- do {
123
- cosineLambda = Math.cos(lambda);
124
- sineLambda = Math.sin(lambda);
125
- const temp = cs - sc * cosineLambda;
126
- sineSigma = Math.sqrt(
127
- cosineU2 * cosineU2 * sineLambda * sineLambda + temp * temp
128
- );
129
- cosineSigma = ss + cc * cosineLambda;
130
- sigma = Math.atan2(sineSigma, cosineSigma);
131
- let sineAlpha;
132
- if (sineSigma === 0) {
133
- sineAlpha = 0;
134
- cosineSquaredAlpha = 1;
135
- } else {
136
- sineAlpha = cc * sineLambda / sineSigma;
137
- cosineSquaredAlpha = 1 - sineAlpha * sineAlpha;
138
- }
139
- lambdaDot = lambda;
140
- cosineTwiceSigmaMidpoint = cosineSigma - 2 * ss / cosineSquaredAlpha;
141
- if (!isFinite(cosineTwiceSigmaMidpoint)) {
142
- cosineTwiceSigmaMidpoint = 0;
143
- }
144
- lambda = l + computeDeltaLambda(
145
- eff,
146
- sineAlpha,
147
- cosineSquaredAlpha,
148
- sigma,
149
- sineSigma,
150
- cosineSigma,
151
- cosineTwiceSigmaMidpoint
152
- );
153
- } while (Math.abs(lambda - lambdaDot) > Math_default.EPSILON12);
154
- const uSquared = cosineSquaredAlpha * (major * major - minor * minor) / (minor * minor);
155
- const A = 1 + uSquared * (4096 + uSquared * (uSquared * (320 - 175 * uSquared) - 768)) / 16384;
156
- const B = uSquared * (256 + uSquared * (uSquared * (74 - 47 * uSquared) - 128)) / 1024;
157
- const cosineSquaredTwiceSigmaMidpoint = cosineTwiceSigmaMidpoint * cosineTwiceSigmaMidpoint;
158
- const deltaSigma = B * sineSigma * (cosineTwiceSigmaMidpoint + B * (cosineSigma * (2 * cosineSquaredTwiceSigmaMidpoint - 1) - B * cosineTwiceSigmaMidpoint * (4 * sineSigma * sineSigma - 3) * (4 * cosineSquaredTwiceSigmaMidpoint - 3) / 6) / 4);
159
- const distance = minor * A * (sigma - deltaSigma);
160
- const startHeading = Math.atan2(
161
- cosineU2 * sineLambda,
162
- cs - sc * cosineLambda
163
- );
164
- const endHeading = Math.atan2(cosineU1 * sineLambda, cs * cosineLambda - sc);
165
- ellipsoidGeodesic._distance = distance;
166
- ellipsoidGeodesic._startHeading = startHeading;
167
- ellipsoidGeodesic._endHeading = endHeading;
168
- ellipsoidGeodesic._uSquared = uSquared;
169
- }
170
- var scratchCart1 = new Cartesian3_default();
171
- var scratchCart2 = new Cartesian3_default();
172
- function computeProperties(ellipsoidGeodesic, start, end, ellipsoid) {
173
- const firstCartesian = Cartesian3_default.normalize(
174
- ellipsoid.cartographicToCartesian(start, scratchCart2),
175
- scratchCart1
176
- );
177
- const lastCartesian = Cartesian3_default.normalize(
178
- ellipsoid.cartographicToCartesian(end, scratchCart2),
179
- scratchCart2
180
- );
181
- Check_default.typeOf.number.greaterThanOrEquals(
182
- "value",
183
- Math.abs(
184
- Math.abs(Cartesian3_default.angleBetween(firstCartesian, lastCartesian)) - Math.PI
185
- ),
186
- 0.0125
187
- );
188
- vincentyInverseFormula(
189
- ellipsoidGeodesic,
190
- ellipsoid.maximumRadius,
191
- ellipsoid.minimumRadius,
192
- start.longitude,
193
- start.latitude,
194
- end.longitude,
195
- end.latitude
196
- );
197
- ellipsoidGeodesic._start = Cartographic_default.clone(
198
- start,
199
- ellipsoidGeodesic._start
200
- );
201
- ellipsoidGeodesic._end = Cartographic_default.clone(end, ellipsoidGeodesic._end);
202
- ellipsoidGeodesic._start.height = 0;
203
- ellipsoidGeodesic._end.height = 0;
204
- setConstants(ellipsoidGeodesic);
205
- }
206
- function EllipsoidGeodesic(start, end, ellipsoid) {
207
- const e = defaultValue_default(ellipsoid, Ellipsoid_default.WGS84);
208
- this._ellipsoid = e;
209
- this._start = new Cartographic_default();
210
- this._end = new Cartographic_default();
211
- this._constants = {};
212
- this._startHeading = void 0;
213
- this._endHeading = void 0;
214
- this._distance = void 0;
215
- this._uSquared = void 0;
216
- if (defined_default(start) && defined_default(end)) {
217
- computeProperties(this, start, end, e);
218
- }
219
- }
220
- Object.defineProperties(EllipsoidGeodesic.prototype, {
221
- /**
222
- * Gets the ellipsoid.
223
- * @memberof EllipsoidGeodesic.prototype
224
- * @type {Ellipsoid}
225
- * @readonly
226
- */
227
- ellipsoid: {
228
- get: function() {
229
- return this._ellipsoid;
230
- }
231
- },
232
- /**
233
- * Gets the surface distance between the start and end point
234
- * @memberof EllipsoidGeodesic.prototype
235
- * @type {number}
236
- * @readonly
237
- */
238
- surfaceDistance: {
239
- get: function() {
240
- Check_default.defined("distance", this._distance);
241
- return this._distance;
242
- }
243
- },
244
- /**
245
- * Gets the initial planetodetic point on the path.
246
- * @memberof EllipsoidGeodesic.prototype
247
- * @type {Cartographic}
248
- * @readonly
249
- */
250
- start: {
251
- get: function() {
252
- return this._start;
253
- }
254
- },
255
- /**
256
- * Gets the final planetodetic point on the path.
257
- * @memberof EllipsoidGeodesic.prototype
258
- * @type {Cartographic}
259
- * @readonly
260
- */
261
- end: {
262
- get: function() {
263
- return this._end;
264
- }
265
- },
266
- /**
267
- * Gets the heading at the initial point.
268
- * @memberof EllipsoidGeodesic.prototype
269
- * @type {number}
270
- * @readonly
271
- */
272
- startHeading: {
273
- get: function() {
274
- Check_default.defined("distance", this._distance);
275
- return this._startHeading;
276
- }
277
- },
278
- /**
279
- * Gets the heading at the final point.
280
- * @memberof EllipsoidGeodesic.prototype
281
- * @type {number}
282
- * @readonly
283
- */
284
- endHeading: {
285
- get: function() {
286
- Check_default.defined("distance", this._distance);
287
- return this._endHeading;
288
- }
289
- }
290
- });
291
- EllipsoidGeodesic.prototype.setEndPoints = function(start, end) {
292
- Check_default.defined("start", start);
293
- Check_default.defined("end", end);
294
- computeProperties(this, start, end, this._ellipsoid);
295
- };
296
- EllipsoidGeodesic.prototype.interpolateUsingFraction = function(fraction, result) {
297
- return this.interpolateUsingSurfaceDistance(
298
- this._distance * fraction,
299
- result
300
- );
301
- };
302
- EllipsoidGeodesic.prototype.interpolateUsingSurfaceDistance = function(distance, result) {
303
- Check_default.defined("distance", this._distance);
304
- const constants = this._constants;
305
- const s = constants.distanceRatio + distance / constants.b;
306
- const cosine2S = Math.cos(2 * s);
307
- const cosine4S = Math.cos(4 * s);
308
- const cosine6S = Math.cos(6 * s);
309
- const sine2S = Math.sin(2 * s);
310
- const sine4S = Math.sin(4 * s);
311
- const sine6S = Math.sin(6 * s);
312
- const sine8S = Math.sin(8 * s);
313
- const s2 = s * s;
314
- const s3 = s * s2;
315
- const u8Over256 = constants.u8Over256;
316
- const u2Over4 = constants.u2Over4;
317
- const u6Over64 = constants.u6Over64;
318
- const u4Over16 = constants.u4Over16;
319
- let sigma = 2 * s3 * u8Over256 * cosine2S / 3 + s * (1 - u2Over4 + 7 * u4Over16 / 4 - 15 * u6Over64 / 4 + 579 * u8Over256 / 64 - (u4Over16 - 15 * u6Over64 / 4 + 187 * u8Over256 / 16) * cosine2S - (5 * u6Over64 / 4 - 115 * u8Over256 / 16) * cosine4S - 29 * u8Over256 * cosine6S / 16) + (u2Over4 / 2 - u4Over16 + 71 * u6Over64 / 32 - 85 * u8Over256 / 16) * sine2S + (5 * u4Over16 / 16 - 5 * u6Over64 / 4 + 383 * u8Over256 / 96) * sine4S - s2 * ((u6Over64 - 11 * u8Over256 / 2) * sine2S + 5 * u8Over256 * sine4S / 2) + (29 * u6Over64 / 96 - 29 * u8Over256 / 16) * sine6S + 539 * u8Over256 * sine8S / 1536;
320
- const theta = Math.asin(Math.sin(sigma) * constants.cosineAlpha);
321
- const latitude = Math.atan(constants.a / constants.b * Math.tan(theta));
322
- sigma = sigma - constants.sigma;
323
- const cosineTwiceSigmaMidpoint = Math.cos(2 * constants.sigma + sigma);
324
- const sineSigma = Math.sin(sigma);
325
- const cosineSigma = Math.cos(sigma);
326
- const cc = constants.cosineU * cosineSigma;
327
- const ss = constants.sineU * sineSigma;
328
- const lambda = Math.atan2(
329
- sineSigma * constants.sineHeading,
330
- cc - ss * constants.cosineHeading
331
- );
332
- const l = lambda - computeDeltaLambda(
333
- constants.f,
334
- constants.sineAlpha,
335
- constants.cosineSquaredAlpha,
336
- sigma,
337
- sineSigma,
338
- cosineSigma,
339
- cosineTwiceSigmaMidpoint
340
- );
341
- if (defined_default(result)) {
342
- result.longitude = this._start.longitude + l;
343
- result.latitude = latitude;
344
- result.height = 0;
345
- return result;
346
- }
347
- return new Cartographic_default(this._start.longitude + l, latitude, 0);
348
- };
349
- var EllipsoidGeodesic_default = EllipsoidGeodesic;
350
-
351
- export {
352
- EllipsoidGeodesic_default
353
- };