@pggis/pg-sdk 3.3.9 → 3.5.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 (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/resources/ThirdParty/Workers/pako_deflate.min.js +1 -2
  5. package/dist/resources/ThirdParty/Workers/pako_inflate.min.js +1 -2
  6. package/dist/resources/ThirdParty/Workers/z-worker-pako.js +1 -1
  7. package/dist/resources/ThirdParty/google-earth-dbroot-parser.js +1 -8337
  8. package/dist/resources/ThirdParty/wasm_splats_bg.wasm +0 -0
  9. package/dist/resources/Workers/chunk-35SHYARM.js +26 -0
  10. package/dist/resources/Workers/chunk-37F5JSTI.js +26 -0
  11. package/dist/resources/Workers/chunk-3SSKC3VN.js +26 -0
  12. package/dist/resources/Workers/chunk-3W4GT7KQ.js +26 -0
  13. package/dist/resources/Workers/chunk-4IW2T6GF.js +26 -0
  14. package/dist/resources/Workers/chunk-5YEWO3HT.js +26 -0
  15. package/dist/resources/Workers/chunk-64RSHJUE.js +28 -0
  16. package/dist/resources/Workers/chunk-77IHZJJ3.js +26 -0
  17. package/dist/resources/Workers/chunk-7HTKERZY.js +26 -0
  18. package/dist/resources/Workers/{chunk-F3YA3Y2Z.js → chunk-A56XVLQR.js} +2 -13
  19. package/dist/resources/Workers/chunk-AJYK4IVJ.js +26 -0
  20. package/dist/resources/Workers/{chunk-EHWHNOEX.js → chunk-ARG42DC4.js} +2 -31
  21. package/dist/resources/Workers/chunk-AU7IKHOH.js +26 -0
  22. package/dist/resources/Workers/chunk-B4AA3ARO.js +26 -0
  23. package/dist/resources/Workers/chunk-CNCV5UL7.js +26 -0
  24. package/dist/resources/Workers/chunk-CYCB63OH.js +26 -0
  25. package/dist/resources/Workers/{chunk-4H7PY4U5.js → chunk-D6AA5QVT.js} +2 -20
  26. package/dist/resources/Workers/chunk-D6C66QON.js +26 -0
  27. package/dist/resources/Workers/chunk-DEPHB2WM.js +26 -0
  28. package/dist/resources/Workers/chunk-DMEY62ID.js +26 -0
  29. package/dist/resources/Workers/chunk-DQQ63PYM.js +26 -0
  30. package/dist/resources/Workers/chunk-ED5JPB3S.js +27 -0
  31. package/dist/resources/Workers/chunk-EZUYS2JF.js +26 -0
  32. package/dist/resources/Workers/chunk-FEVXJ54I.js +26 -0
  33. package/dist/resources/Workers/chunk-G5AGHVVC.js +26 -0
  34. package/dist/resources/Workers/{chunk-BBWDMCVU.js → chunk-GBYLG25F.js} +2 -15
  35. package/dist/resources/Workers/chunk-GILIDQNQ.js +26 -0
  36. package/dist/resources/Workers/chunk-HMIYSTF6.js +26 -0
  37. package/dist/resources/Workers/chunk-HTFSEEMT.js +26 -0
  38. package/dist/resources/Workers/chunk-HWXX4CWK.js +26 -0
  39. package/dist/resources/Workers/chunk-IYTZ52EY.js +26 -0
  40. package/dist/resources/Workers/chunk-J6UP6FLE.js +26 -0
  41. package/dist/resources/Workers/chunk-LEYMRMBK.js +27 -0
  42. package/dist/resources/Workers/chunk-M3MGYQSL.js +26 -0
  43. package/dist/resources/Workers/chunk-N4VJKXZS.js +26 -0
  44. package/dist/resources/Workers/chunk-NB3ML6JO.js +26 -0
  45. package/dist/resources/Workers/chunk-OFUUQVMR.js +26 -0
  46. package/dist/resources/Workers/chunk-OSW76XDF.js +26 -0
  47. package/dist/resources/Workers/chunk-PSPPBZWI.js +66 -0
  48. package/dist/resources/Workers/chunk-QN3VOORQ.js +26 -0
  49. package/dist/resources/Workers/chunk-QOUAJ6TL.js +26 -0
  50. package/dist/resources/Workers/chunk-RCV6KWXS.js +26 -0
  51. package/dist/resources/Workers/chunk-TCGIRNHN.js +26 -0
  52. package/dist/resources/Workers/chunk-U4IEOH5K.js +26 -0
  53. package/dist/resources/Workers/chunk-UP6I5URU.js +26 -0
  54. package/dist/resources/Workers/chunk-VTAIKJXX.js +26 -0
  55. package/dist/resources/Workers/chunk-VTBDSFTG.js +26 -0
  56. package/dist/resources/Workers/chunk-VW6VD53G.js +26 -0
  57. package/dist/resources/Workers/chunk-WGGIH7QW.js +26 -0
  58. package/dist/resources/Workers/chunk-WWA5PL4H.js +26 -0
  59. package/dist/resources/Workers/chunk-WZDE3RYP.js +28 -0
  60. package/dist/resources/Workers/chunk-XRL4AVS5.js +26 -0
  61. package/dist/resources/Workers/combineGeometry.js +2 -44
  62. package/dist/resources/Workers/createBoxGeometry.js +2 -34
  63. package/dist/resources/Workers/createBoxOutlineGeometry.js +2 -211
  64. package/dist/resources/Workers/createCircleGeometry.js +2 -173
  65. package/dist/resources/Workers/createCircleOutlineGeometry.js +2 -123
  66. package/dist/resources/Workers/createCoplanarPolygonGeometry.js +2 -482
  67. package/dist/resources/Workers/createCoplanarPolygonOutlineGeometry.js +2 -201
  68. package/dist/resources/Workers/createCorridorGeometry.js +2 -1239
  69. package/dist/resources/Workers/createCorridorOutlineGeometry.js +2 -544
  70. package/dist/resources/Workers/createCylinderGeometry.js +2 -36
  71. package/dist/resources/Workers/createCylinderOutlineGeometry.js +2 -207
  72. package/dist/resources/Workers/createEllipseGeometry.js +2 -47
  73. package/dist/resources/Workers/createEllipseOutlineGeometry.js +2 -40
  74. package/dist/resources/Workers/createEllipsoidGeometry.js +2 -35
  75. package/dist/resources/Workers/createEllipsoidOutlineGeometry.js +2 -37
  76. package/dist/resources/Workers/createFrustumGeometry.js +2 -34
  77. package/dist/resources/Workers/createFrustumOutlineGeometry.js +2 -211
  78. package/dist/resources/Workers/createGeometry.js +2 -147
  79. package/dist/resources/Workers/createGroundPolylineGeometry.js +2 -1584
  80. package/dist/resources/Workers/createPlaneGeometry.js +2 -200
  81. package/dist/resources/Workers/createPlaneOutlineGeometry.js +2 -100
  82. package/dist/resources/Workers/createPolygonGeometry.js +2 -1387
  83. package/dist/resources/Workers/createPolygonOutlineGeometry.js +2 -519
  84. package/dist/resources/Workers/createPolylineGeometry.js +2 -472
  85. package/dist/resources/Workers/createPolylineVolumeGeometry.js +2 -355
  86. package/dist/resources/Workers/createPolylineVolumeOutlineGeometry.js +2 -253
  87. package/dist/resources/Workers/createRectangleGeometry.js +2 -1250
  88. package/dist/resources/Workers/createRectangleOutlineGeometry.js +2 -455
  89. package/dist/resources/Workers/createSimplePolylineGeometry.js +2 -376
  90. package/dist/resources/Workers/createSphereGeometry.js +2 -94
  91. package/dist/resources/Workers/createSphereOutlineGeometry.js +2 -94
  92. package/dist/resources/Workers/createTaskProcessorWorker.js +2 -8
  93. package/dist/resources/Workers/createVectorTileClampedPolylines.js +2 -468
  94. package/dist/resources/Workers/createVectorTileGeometries.js +2 -363
  95. package/dist/resources/Workers/createVectorTilePoints.js +2 -88
  96. package/dist/resources/Workers/createVectorTilePolygons.js +2 -361
  97. package/dist/resources/Workers/createVectorTilePolylines.js +2 -238
  98. package/dist/resources/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +2 -545
  99. package/dist/resources/Workers/createVerticesFromHeightmap.js +2 -2254
  100. package/dist/resources/Workers/createVerticesFromQuantizedTerrainMesh.js +2 -722
  101. package/dist/resources/Workers/createWallGeometry.js +2 -466
  102. package/dist/resources/Workers/createWallOutlineGeometry.js +2 -314
  103. package/dist/resources/Workers/decodeDraco.js +2 -345
  104. package/dist/resources/Workers/decodeGoogleEarthEnterprisePacket.js +2 -2626
  105. package/dist/resources/Workers/decodeI3S.js +2 -1320
  106. package/dist/resources/Workers/gaussianSplatSorter.js +26 -0
  107. package/dist/resources/Workers/gaussianSplatTextureGenerator.js +26 -0
  108. package/dist/resources/Workers/transcodeKTX2.js +29 -3398
  109. package/dist/resources/Workers/transferTypedArrayTest.js +2 -17
  110. package/dist/resources/Workers/upsampleQuantizedTerrainMesh.js +2 -795
  111. package/package.json +9 -8
  112. package/dist/pggis.min.js +0 -14796
  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,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.115
4
+ * Version 1.132
5
5
  *
6
6
  * Copyright 2011-2022 Cesium Contributors
7
7
  *
@@ -23,363 +23,4 @@
23
23
  * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
24
24
  */
25
25
 
26
- import {
27
- Color_default
28
- } from "./chunk-PGSJK77E.js";
29
- import {
30
- createTaskProcessorWorker_default
31
- } from "./chunk-3VAZEH7M.js";
32
- import {
33
- OrientedBoundingBox_default
34
- } from "./chunk-A5DWLWCY.js";
35
- import {
36
- AttributeCompression_default
37
- } from "./chunk-Z3TIFFGF.js";
38
- import "./chunk-FNIRWHJB.js";
39
- import "./chunk-G43QFN4Q.js";
40
- import "./chunk-2FRVPMCS.js";
41
- import "./chunk-Y5UQJLYE.js";
42
- import {
43
- IndexDatatype_default
44
- } from "./chunk-LPR3YNP2.js";
45
- import "./chunk-FJKNFAKQ.js";
46
- import "./chunk-TTUZP4BO.js";
47
- import "./chunk-BG4UCVXN.js";
48
- import {
49
- Rectangle_default
50
- } from "./chunk-YJEBABKH.js";
51
- import "./chunk-PPH7OFP3.js";
52
- import {
53
- Cartesian3_default,
54
- Cartographic_default,
55
- Ellipsoid_default
56
- } from "./chunk-OGXZVPPM.js";
57
- import {
58
- Math_default
59
- } from "./chunk-5QULIR53.js";
60
- import "./chunk-SOWMRMWA.js";
61
- import "./chunk-STW2DGFI.js";
62
- import "./chunk-BBWDMCVU.js";
63
- import "./chunk-XGI5BXZY.js";
64
- import {
65
- defined_default
66
- } from "./chunk-YWTJ2B4B.js";
67
-
68
- // packages/engine/Source/Workers/createVectorTilePolygons.js
69
- var scratchCenter = new Cartesian3_default();
70
- var scratchEllipsoid = new Ellipsoid_default();
71
- var scratchRectangle = new Rectangle_default();
72
- var scratchScalars = {
73
- min: void 0,
74
- max: void 0,
75
- indexBytesPerElement: void 0
76
- };
77
- function unpackBuffer(buffer) {
78
- const packedBuffer = new Float64Array(buffer);
79
- let offset = 0;
80
- scratchScalars.indexBytesPerElement = packedBuffer[offset++];
81
- scratchScalars.min = packedBuffer[offset++];
82
- scratchScalars.max = packedBuffer[offset++];
83
- Cartesian3_default.unpack(packedBuffer, offset, scratchCenter);
84
- offset += Cartesian3_default.packedLength;
85
- Ellipsoid_default.unpack(packedBuffer, offset, scratchEllipsoid);
86
- offset += Ellipsoid_default.packedLength;
87
- Rectangle_default.unpack(packedBuffer, offset, scratchRectangle);
88
- }
89
- function packedBatchedIndicesLength(batchedIndices) {
90
- const length = batchedIndices.length;
91
- let count = 0;
92
- for (let i = 0; i < length; ++i) {
93
- count += Color_default.packedLength + 3 + batchedIndices[i].batchIds.length;
94
- }
95
- return count;
96
- }
97
- function packBuffer(indexDatatype, boundingVolumes, batchedIndices) {
98
- const numBVs = boundingVolumes.length;
99
- const length = 1 + 1 + numBVs * OrientedBoundingBox_default.packedLength + 1 + packedBatchedIndicesLength(batchedIndices);
100
- const packedBuffer = new Float64Array(length);
101
- let offset = 0;
102
- packedBuffer[offset++] = indexDatatype;
103
- packedBuffer[offset++] = numBVs;
104
- for (let i = 0; i < numBVs; ++i) {
105
- OrientedBoundingBox_default.pack(boundingVolumes[i], packedBuffer, offset);
106
- offset += OrientedBoundingBox_default.packedLength;
107
- }
108
- const indicesLength = batchedIndices.length;
109
- packedBuffer[offset++] = indicesLength;
110
- for (let j = 0; j < indicesLength; ++j) {
111
- const batchedIndex = batchedIndices[j];
112
- Color_default.pack(batchedIndex.color, packedBuffer, offset);
113
- offset += Color_default.packedLength;
114
- packedBuffer[offset++] = batchedIndex.offset;
115
- packedBuffer[offset++] = batchedIndex.count;
116
- const batchIds = batchedIndex.batchIds;
117
- const batchIdsLength = batchIds.length;
118
- packedBuffer[offset++] = batchIdsLength;
119
- for (let k = 0; k < batchIdsLength; ++k) {
120
- packedBuffer[offset++] = batchIds[k];
121
- }
122
- }
123
- return packedBuffer;
124
- }
125
- var maxShort = 32767;
126
- var scratchEncodedPosition = new Cartesian3_default();
127
- var scratchNormal = new Cartesian3_default();
128
- var scratchScaledNormal = new Cartesian3_default();
129
- var scratchMinHeightPosition = new Cartesian3_default();
130
- var scratchMaxHeightPosition = new Cartesian3_default();
131
- var scratchBVCartographic = new Cartographic_default();
132
- var scratchBVRectangle = new Rectangle_default();
133
- function createVectorTilePolygons(parameters, transferableObjects) {
134
- unpackBuffer(parameters.packedBuffer);
135
- let indices;
136
- const indexBytesPerElement = scratchScalars.indexBytesPerElement;
137
- if (indexBytesPerElement === 2) {
138
- indices = new Uint16Array(parameters.indices);
139
- } else {
140
- indices = new Uint32Array(parameters.indices);
141
- }
142
- const positions = new Uint16Array(parameters.positions);
143
- const counts = new Uint32Array(parameters.counts);
144
- const indexCounts = new Uint32Array(parameters.indexCounts);
145
- const batchIds = new Uint32Array(parameters.batchIds);
146
- const batchTableColors = new Uint32Array(parameters.batchTableColors);
147
- const boundingVolumes = new Array(counts.length);
148
- const center = scratchCenter;
149
- const ellipsoid = scratchEllipsoid;
150
- let rectangle = scratchRectangle;
151
- const minHeight = scratchScalars.min;
152
- const maxHeight = scratchScalars.max;
153
- let minimumHeights = parameters.minimumHeights;
154
- let maximumHeights = parameters.maximumHeights;
155
- if (defined_default(minimumHeights) && defined_default(maximumHeights)) {
156
- minimumHeights = new Float32Array(minimumHeights);
157
- maximumHeights = new Float32Array(maximumHeights);
158
- }
159
- let i;
160
- let j;
161
- let rgba;
162
- const positionsLength = positions.length / 2;
163
- const uBuffer = positions.subarray(0, positionsLength);
164
- const vBuffer = positions.subarray(positionsLength, 2 * positionsLength);
165
- AttributeCompression_default.zigZagDeltaDecode(uBuffer, vBuffer);
166
- const decodedPositions = new Float64Array(positionsLength * 3);
167
- for (i = 0; i < positionsLength; ++i) {
168
- const u = uBuffer[i];
169
- const v = vBuffer[i];
170
- const x = Math_default.lerp(rectangle.west, rectangle.east, u / maxShort);
171
- const y = Math_default.lerp(rectangle.south, rectangle.north, v / maxShort);
172
- const cart = Cartographic_default.fromRadians(x, y, 0, scratchBVCartographic);
173
- const decodedPosition = ellipsoid.cartographicToCartesian(
174
- cart,
175
- scratchEncodedPosition
176
- );
177
- Cartesian3_default.pack(decodedPosition, decodedPositions, i * 3);
178
- }
179
- const countsLength = counts.length;
180
- const offsets = new Array(countsLength);
181
- const indexOffsets = new Array(countsLength);
182
- let currentOffset = 0;
183
- let currentIndexOffset = 0;
184
- for (i = 0; i < countsLength; ++i) {
185
- offsets[i] = currentOffset;
186
- indexOffsets[i] = currentIndexOffset;
187
- currentOffset += counts[i];
188
- currentIndexOffset += indexCounts[i];
189
- }
190
- const batchedPositions = new Float32Array(positionsLength * 3 * 2);
191
- const batchedIds = new Uint16Array(positionsLength * 2);
192
- const batchedIndexOffsets = new Uint32Array(indexOffsets.length);
193
- const batchedIndexCounts = new Uint32Array(indexCounts.length);
194
- let batchedIndices = [];
195
- const colorToBuffers = {};
196
- for (i = 0; i < countsLength; ++i) {
197
- rgba = batchTableColors[i];
198
- if (!defined_default(colorToBuffers[rgba])) {
199
- colorToBuffers[rgba] = {
200
- positionLength: counts[i],
201
- indexLength: indexCounts[i],
202
- offset: 0,
203
- indexOffset: 0,
204
- batchIds: [i]
205
- };
206
- } else {
207
- colorToBuffers[rgba].positionLength += counts[i];
208
- colorToBuffers[rgba].indexLength += indexCounts[i];
209
- colorToBuffers[rgba].batchIds.push(i);
210
- }
211
- }
212
- let buffer;
213
- let byColorPositionOffset = 0;
214
- let byColorIndexOffset = 0;
215
- for (rgba in colorToBuffers) {
216
- if (colorToBuffers.hasOwnProperty(rgba)) {
217
- buffer = colorToBuffers[rgba];
218
- buffer.offset = byColorPositionOffset;
219
- buffer.indexOffset = byColorIndexOffset;
220
- const positionLength = buffer.positionLength * 2;
221
- const indexLength = buffer.indexLength * 2 + buffer.positionLength * 6;
222
- byColorPositionOffset += positionLength;
223
- byColorIndexOffset += indexLength;
224
- buffer.indexLength = indexLength;
225
- }
226
- }
227
- const batchedDrawCalls = [];
228
- for (rgba in colorToBuffers) {
229
- if (colorToBuffers.hasOwnProperty(rgba)) {
230
- buffer = colorToBuffers[rgba];
231
- batchedDrawCalls.push({
232
- color: Color_default.fromRgba(parseInt(rgba)),
233
- offset: buffer.indexOffset,
234
- count: buffer.indexLength,
235
- batchIds: buffer.batchIds
236
- });
237
- }
238
- }
239
- for (i = 0; i < countsLength; ++i) {
240
- rgba = batchTableColors[i];
241
- buffer = colorToBuffers[rgba];
242
- const positionOffset = buffer.offset;
243
- let positionIndex = positionOffset * 3;
244
- let batchIdIndex = positionOffset;
245
- const polygonOffset = offsets[i];
246
- const polygonCount = counts[i];
247
- const batchId = batchIds[i];
248
- let polygonMinimumHeight = minHeight;
249
- let polygonMaximumHeight = maxHeight;
250
- if (defined_default(minimumHeights) && defined_default(maximumHeights)) {
251
- polygonMinimumHeight = minimumHeights[i];
252
- polygonMaximumHeight = maximumHeights[i];
253
- }
254
- let minLat = Number.POSITIVE_INFINITY;
255
- let maxLat = Number.NEGATIVE_INFINITY;
256
- let minLon = Number.POSITIVE_INFINITY;
257
- let maxLon = Number.NEGATIVE_INFINITY;
258
- for (j = 0; j < polygonCount; ++j) {
259
- const position = Cartesian3_default.unpack(
260
- decodedPositions,
261
- polygonOffset * 3 + j * 3,
262
- scratchEncodedPosition
263
- );
264
- ellipsoid.scaleToGeodeticSurface(position, position);
265
- const carto = ellipsoid.cartesianToCartographic(
266
- position,
267
- scratchBVCartographic
268
- );
269
- const lat = carto.latitude;
270
- const lon = carto.longitude;
271
- minLat = Math.min(lat, minLat);
272
- maxLat = Math.max(lat, maxLat);
273
- minLon = Math.min(lon, minLon);
274
- maxLon = Math.max(lon, maxLon);
275
- const normal = ellipsoid.geodeticSurfaceNormal(position, scratchNormal);
276
- let scaledNormal = Cartesian3_default.multiplyByScalar(
277
- normal,
278
- polygonMinimumHeight,
279
- scratchScaledNormal
280
- );
281
- const minHeightPosition = Cartesian3_default.add(
282
- position,
283
- scaledNormal,
284
- scratchMinHeightPosition
285
- );
286
- scaledNormal = Cartesian3_default.multiplyByScalar(
287
- normal,
288
- polygonMaximumHeight,
289
- scaledNormal
290
- );
291
- const maxHeightPosition = Cartesian3_default.add(
292
- position,
293
- scaledNormal,
294
- scratchMaxHeightPosition
295
- );
296
- Cartesian3_default.subtract(maxHeightPosition, center, maxHeightPosition);
297
- Cartesian3_default.subtract(minHeightPosition, center, minHeightPosition);
298
- Cartesian3_default.pack(maxHeightPosition, batchedPositions, positionIndex);
299
- Cartesian3_default.pack(minHeightPosition, batchedPositions, positionIndex + 3);
300
- batchedIds[batchIdIndex] = batchId;
301
- batchedIds[batchIdIndex + 1] = batchId;
302
- positionIndex += 6;
303
- batchIdIndex += 2;
304
- }
305
- rectangle = scratchBVRectangle;
306
- rectangle.west = minLon;
307
- rectangle.east = maxLon;
308
- rectangle.south = minLat;
309
- rectangle.north = maxLat;
310
- boundingVolumes[i] = OrientedBoundingBox_default.fromRectangle(
311
- rectangle,
312
- minHeight,
313
- maxHeight,
314
- ellipsoid
315
- );
316
- let indicesIndex = buffer.indexOffset;
317
- const indexOffset = indexOffsets[i];
318
- const indexCount = indexCounts[i];
319
- batchedIndexOffsets[i] = indicesIndex;
320
- for (j = 0; j < indexCount; j += 3) {
321
- const i0 = indices[indexOffset + j] - polygonOffset;
322
- const i1 = indices[indexOffset + j + 1] - polygonOffset;
323
- const i2 = indices[indexOffset + j + 2] - polygonOffset;
324
- batchedIndices[indicesIndex++] = i0 * 2 + positionOffset;
325
- batchedIndices[indicesIndex++] = i1 * 2 + positionOffset;
326
- batchedIndices[indicesIndex++] = i2 * 2 + positionOffset;
327
- batchedIndices[indicesIndex++] = i2 * 2 + 1 + positionOffset;
328
- batchedIndices[indicesIndex++] = i1 * 2 + 1 + positionOffset;
329
- batchedIndices[indicesIndex++] = i0 * 2 + 1 + positionOffset;
330
- }
331
- for (j = 0; j < polygonCount; ++j) {
332
- const v0 = j;
333
- const v1 = (j + 1) % polygonCount;
334
- batchedIndices[indicesIndex++] = v0 * 2 + 1 + positionOffset;
335
- batchedIndices[indicesIndex++] = v1 * 2 + positionOffset;
336
- batchedIndices[indicesIndex++] = v0 * 2 + positionOffset;
337
- batchedIndices[indicesIndex++] = v0 * 2 + 1 + positionOffset;
338
- batchedIndices[indicesIndex++] = v1 * 2 + 1 + positionOffset;
339
- batchedIndices[indicesIndex++] = v1 * 2 + positionOffset;
340
- }
341
- buffer.offset += polygonCount * 2;
342
- buffer.indexOffset = indicesIndex;
343
- batchedIndexCounts[i] = indicesIndex - batchedIndexOffsets[i];
344
- }
345
- batchedIndices = IndexDatatype_default.createTypedArray(
346
- batchedPositions.length / 3,
347
- batchedIndices
348
- );
349
- const batchedIndicesLength = batchedDrawCalls.length;
350
- for (let m = 0; m < batchedIndicesLength; ++m) {
351
- const tempIds = batchedDrawCalls[m].batchIds;
352
- let count = 0;
353
- const tempIdsLength = tempIds.length;
354
- for (let n = 0; n < tempIdsLength; ++n) {
355
- count += batchedIndexCounts[tempIds[n]];
356
- }
357
- batchedDrawCalls[m].count = count;
358
- }
359
- const indexDatatype = batchedIndices.BYTES_PER_ELEMENT === 2 ? IndexDatatype_default.UNSIGNED_SHORT : IndexDatatype_default.UNSIGNED_INT;
360
- const packedBuffer = packBuffer(
361
- indexDatatype,
362
- boundingVolumes,
363
- batchedDrawCalls
364
- );
365
- transferableObjects.push(
366
- batchedPositions.buffer,
367
- batchedIndices.buffer,
368
- batchedIndexOffsets.buffer,
369
- batchedIndexCounts.buffer,
370
- batchedIds.buffer,
371
- packedBuffer.buffer
372
- );
373
- return {
374
- positions: batchedPositions.buffer,
375
- indices: batchedIndices.buffer,
376
- indexOffsets: batchedIndexOffsets.buffer,
377
- indexCounts: batchedIndexCounts.buffer,
378
- batchIds: batchedIds.buffer,
379
- packedBuffer: packedBuffer.buffer
380
- };
381
- }
382
- var createVectorTilePolygons_default = createTaskProcessorWorker_default(createVectorTilePolygons);
383
- export {
384
- createVectorTilePolygons_default as default
385
- };
26
+ import{a as R}from"./chunk-HMIYSTF6.js";import{a as It}from"./chunk-WZDE3RYP.js";import{a as M}from"./chunk-CNCV5UL7.js";import{a as bt}from"./chunk-DEPHB2WM.js";import"./chunk-TCGIRNHN.js";import"./chunk-N4VJKXZS.js";import"./chunk-DMEY62ID.js";import"./chunk-HTFSEEMT.js";import{a as W}from"./chunk-OFUUQVMR.js";import"./chunk-4IW2T6GF.js";import{h as z}from"./chunk-PSPPBZWI.js";import"./chunk-AU7IKHOH.js";import{a as o,b as nt,d as j}from"./chunk-64RSHJUE.js";import{a as et}from"./chunk-3SSKC3VN.js";import"./chunk-OSW76XDF.js";import"./chunk-ED5JPB3S.js";import"./chunk-LEYMRMBK.js";import{e as A}from"./chunk-VTAIKJXX.js";var kt=new o,Bt=new j,Nt=new z,E={min:void 0,max:void 0,indexBytesPerElement:void 0};function Pt(s){let u=new Float64Array(s),n=0;E.indexBytesPerElement=u[n++],E.min=u[n++],E.max=u[n++],o.unpack(u,n,kt),n+=o.packedLength,j.unpack(u,n,Bt),n+=j.packedLength,z.unpack(u,n,Nt)}function Tt(s){let u=s.length,n=0;for(let y=0;y<u;++y)n+=R.packedLength+3+s[y].batchIds.length;return n}function Ct(s,u,n){let y=u.length,O=2+y*M.packedLength+1+Tt(n),c=new Float64Array(O),i=0;c[i++]=s,c[i++]=y;for(let x=0;x<y;++x)M.pack(u[x],c,i),i+=M.packedLength;let V=n.length;c[i++]=V;for(let x=0;x<V;++x){let B=n[x];R.pack(B.color,c,i),i+=R.packedLength,c[i++]=B.offset,c[i++]=B.count;let P=B.batchIds,w=P.length;c[i++]=w;for(let h=0;h<w;++h)c[i++]=P[h]}return c}var yt=32767,wt=new o,Ht=new o,St=new o,Ut=new o,Ft=new o,Lt=new nt,Mt=new z;function Rt(s,u){Pt(s.packedBuffer);let n;E.indexBytesPerElement===2?n=new Uint16Array(s.indices):n=new Uint32Array(s.indices);let O=new Uint16Array(s.positions),c=new Uint32Array(s.counts),i=new Uint32Array(s.indexCounts),V=new Uint32Array(s.batchIds),x=new Uint32Array(s.batchTableColors),B=new Array(c.length),P=kt,w=Bt,h=Nt,ot=E.min,st=E.max,T=s.minimumHeights,C=s.maximumHeights;A(T)&&A(C)&&(T=new Float32Array(T),C=new Float32Array(C));let t,f,l,N=O.length/2,ct=O.subarray(0,N),it=O.subarray(N,2*N);bt.zigZagDeltaDecode(ct,it);let rt=new Float64Array(N*3);for(t=0;t<N;++t){let e=ct[t],p=it[t],L=et.lerp(h.west,h.east,e/yt),k=et.lerp(h.south,h.north,p/yt),b=nt.fromRadians(L,k,0,Lt),Y=w.cartographicToCartesian(b,wt);o.pack(Y,rt,t*3)}let H=c.length,at=new Array(H),Z=new Array(H),ft=0,lt=0;for(t=0;t<H;++t)at[t]=ft,Z[t]=lt,ft+=c[t],lt+=i[t];let S=new Float32Array(N*3*2),_=new Uint16Array(N*2),D=new Uint32Array(Z.length),G=new Uint32Array(i.length),r=[],g={};for(t=0;t<H;++t)l=x[t],A(g[l])?(g[l].positionLength+=c[t],g[l].indexLength+=i[t],g[l].batchIds.push(t)):g[l]={positionLength:c[t],indexLength:i[t],offset:0,indexOffset:0,batchIds:[t]};let a,dt=0,ht=0;for(l in g)if(g.hasOwnProperty(l)){a=g[l],a.offset=dt,a.indexOffset=ht;let e=a.positionLength*2,p=a.indexLength*2+a.positionLength*6;dt+=e,ht+=p,a.indexLength=p}let U=[];for(l in g)g.hasOwnProperty(l)&&(a=g[l],U.push({color:R.fromRgba(parseInt(l)),offset:a.indexOffset,count:a.indexLength,batchIds:a.batchIds}));for(t=0;t<H;++t){l=x[t],a=g[l];let e=a.offset,p=e*3,L=e,k=at[t],b=c[t],Y=V[t],mt=ot,gt=st;A(T)&&A(C)&&(mt=T[t],gt=C[t]);let q=Number.POSITIVE_INFINITY,J=Number.NEGATIVE_INFINITY,K=Number.POSITIVE_INFINITY,Q=Number.NEGATIVE_INFINITY;for(f=0;f<b;++f){let m=o.unpack(rt,k*3+f*3,wt);w.scaleToGeodeticSurface(m,m);let I=w.cartesianToCartographic(m,Lt),F=I.latitude,pt=I.longitude;q=Math.min(F,q),J=Math.max(F,J),K=Math.min(pt,K),Q=Math.max(pt,Q);let xt=w.geodeticSurfaceNormal(m,Ht),v=o.multiplyByScalar(xt,mt,St),$=o.add(m,v,Ut);v=o.multiplyByScalar(xt,gt,v);let tt=o.add(m,v,Ft);o.subtract(tt,P,tt),o.subtract($,P,$),o.pack(tt,S,p),o.pack($,S,p+3),_[L]=Y,_[L+1]=Y,p+=6,L+=2}h=Mt,h.west=K,h.east=Q,h.south=q,h.north=J,B[t]=M.fromRectangle(h,ot,st,w);let d=a.indexOffset,X=Z[t],Ot=i[t];for(D[t]=d,f=0;f<Ot;f+=3){let m=n[X+f]-k,I=n[X+f+1]-k,F=n[X+f+2]-k;r[d++]=m*2+e,r[d++]=I*2+e,r[d++]=F*2+e,r[d++]=F*2+1+e,r[d++]=I*2+1+e,r[d++]=m*2+1+e}for(f=0;f<b;++f){let m=f,I=(f+1)%b;r[d++]=m*2+1+e,r[d++]=I*2+e,r[d++]=m*2+e,r[d++]=m*2+1+e,r[d++]=I*2+1+e,r[d++]=I*2+e}a.offset+=b*2,a.indexOffset=d,G[t]=d-D[t]}r=W.createTypedArray(S.length/3,r);let At=U.length;for(let e=0;e<At;++e){let p=U[e].batchIds,L=0,k=p.length;for(let b=0;b<k;++b)L+=G[p[b]];U[e].count=L}let Et=r.BYTES_PER_ELEMENT===2?W.UNSIGNED_SHORT:W.UNSIGNED_INT,ut=Ct(Et,B,U);return u.push(S.buffer,r.buffer,D.buffer,G.buffer,_.buffer,ut.buffer),{positions:S.buffer,indices:r.buffer,indexOffsets:D.buffer,indexCounts:G.buffer,batchIds:_.buffer,packedBuffer:ut.buffer}}var Jt=It(Rt);export{Jt as default};
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.115
4
+ * Version 1.132
5
5
  *
6
6
  * Copyright 2011-2022 Cesium Contributors
7
7
  *
@@ -23,240 +23,4 @@
23
23
  * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
24
24
  */
25
25
 
26
- import {
27
- createTaskProcessorWorker_default
28
- } from "./chunk-3VAZEH7M.js";
29
- import {
30
- AttributeCompression_default
31
- } from "./chunk-Z3TIFFGF.js";
32
- import {
33
- IndexDatatype_default
34
- } from "./chunk-LPR3YNP2.js";
35
- import {
36
- combine_default
37
- } from "./chunk-BG4UCVXN.js";
38
- import {
39
- Rectangle_default
40
- } from "./chunk-YJEBABKH.js";
41
- import "./chunk-PPH7OFP3.js";
42
- import {
43
- Cartesian3_default,
44
- Cartographic_default,
45
- Ellipsoid_default
46
- } from "./chunk-OGXZVPPM.js";
47
- import {
48
- Math_default
49
- } from "./chunk-5QULIR53.js";
50
- import "./chunk-SOWMRMWA.js";
51
- import "./chunk-STW2DGFI.js";
52
- import "./chunk-BBWDMCVU.js";
53
- import "./chunk-XGI5BXZY.js";
54
- import "./chunk-YWTJ2B4B.js";
55
-
56
- // packages/engine/Source/Core/decodeVectorPolylinePositions.js
57
- var maxShort = 32767;
58
- var scratchBVCartographic = new Cartographic_default();
59
- var scratchEncodedPosition = new Cartesian3_default();
60
- function decodeVectorPolylinePositions(positions, rectangle, minimumHeight, maximumHeight, ellipsoid) {
61
- const positionsLength = positions.length / 3;
62
- const uBuffer = positions.subarray(0, positionsLength);
63
- const vBuffer = positions.subarray(positionsLength, 2 * positionsLength);
64
- const heightBuffer = positions.subarray(
65
- 2 * positionsLength,
66
- 3 * positionsLength
67
- );
68
- AttributeCompression_default.zigZagDeltaDecode(uBuffer, vBuffer, heightBuffer);
69
- const decoded = new Float64Array(positions.length);
70
- for (let i = 0; i < positionsLength; ++i) {
71
- const u = uBuffer[i];
72
- const v = vBuffer[i];
73
- const h = heightBuffer[i];
74
- const lon = Math_default.lerp(rectangle.west, rectangle.east, u / maxShort);
75
- const lat = Math_default.lerp(rectangle.south, rectangle.north, v / maxShort);
76
- const alt = Math_default.lerp(minimumHeight, maximumHeight, h / maxShort);
77
- const cartographic = Cartographic_default.fromRadians(
78
- lon,
79
- lat,
80
- alt,
81
- scratchBVCartographic
82
- );
83
- const decodedPosition = ellipsoid.cartographicToCartesian(
84
- cartographic,
85
- scratchEncodedPosition
86
- );
87
- Cartesian3_default.pack(decodedPosition, decoded, i * 3);
88
- }
89
- return decoded;
90
- }
91
- var decodeVectorPolylinePositions_default = decodeVectorPolylinePositions;
92
-
93
- // packages/engine/Source/Workers/createVectorTilePolylines.js
94
- var scratchRectangle = new Rectangle_default();
95
- var scratchEllipsoid = new Ellipsoid_default();
96
- var scratchCenter = new Cartesian3_default();
97
- var scratchMinMaxHeights = {
98
- min: void 0,
99
- max: void 0
100
- };
101
- function unpackBuffer(packedBuffer) {
102
- packedBuffer = new Float64Array(packedBuffer);
103
- let offset = 0;
104
- scratchMinMaxHeights.min = packedBuffer[offset++];
105
- scratchMinMaxHeights.max = packedBuffer[offset++];
106
- Rectangle_default.unpack(packedBuffer, offset, scratchRectangle);
107
- offset += Rectangle_default.packedLength;
108
- Ellipsoid_default.unpack(packedBuffer, offset, scratchEllipsoid);
109
- offset += Ellipsoid_default.packedLength;
110
- Cartesian3_default.unpack(packedBuffer, offset, scratchCenter);
111
- }
112
- function getPositionOffsets(counts) {
113
- const countsLength = counts.length;
114
- const positionOffsets = new Uint32Array(countsLength + 1);
115
- let offset = 0;
116
- for (let i = 0; i < countsLength; ++i) {
117
- positionOffsets[i] = offset;
118
- offset += counts[i];
119
- }
120
- positionOffsets[countsLength] = offset;
121
- return positionOffsets;
122
- }
123
- var scratchP0 = new Cartesian3_default();
124
- var scratchP1 = new Cartesian3_default();
125
- var scratchPrev = new Cartesian3_default();
126
- var scratchCur = new Cartesian3_default();
127
- var scratchNext = new Cartesian3_default();
128
- function createVectorTilePolylines(parameters, transferableObjects) {
129
- const encodedPositions = new Uint16Array(parameters.positions);
130
- const widths = new Uint16Array(parameters.widths);
131
- const counts = new Uint32Array(parameters.counts);
132
- const batchIds = new Uint16Array(parameters.batchIds);
133
- unpackBuffer(parameters.packedBuffer);
134
- const rectangle = scratchRectangle;
135
- const ellipsoid = scratchEllipsoid;
136
- const center = scratchCenter;
137
- const minimumHeight = scratchMinMaxHeights.min;
138
- const maximumHeight = scratchMinMaxHeights.max;
139
- const positions = decodeVectorPolylinePositions_default(
140
- encodedPositions,
141
- rectangle,
142
- minimumHeight,
143
- maximumHeight,
144
- ellipsoid
145
- );
146
- const positionsLength = positions.length / 3;
147
- const size = positionsLength * 4 - 4;
148
- const curPositions = new Float32Array(size * 3);
149
- const prevPositions = new Float32Array(size * 3);
150
- const nextPositions = new Float32Array(size * 3);
151
- const expandAndWidth = new Float32Array(size * 2);
152
- const vertexBatchIds = new Uint16Array(size);
153
- let positionIndex = 0;
154
- let expandAndWidthIndex = 0;
155
- let batchIdIndex = 0;
156
- let i;
157
- let offset = 0;
158
- let length = counts.length;
159
- for (i = 0; i < length; ++i) {
160
- const count = counts[i];
161
- const width = widths[i];
162
- const batchId = batchIds[i];
163
- for (let j = 0; j < count; ++j) {
164
- let previous;
165
- if (j === 0) {
166
- const p0 = Cartesian3_default.unpack(positions, offset * 3, scratchP0);
167
- const p1 = Cartesian3_default.unpack(positions, (offset + 1) * 3, scratchP1);
168
- previous = Cartesian3_default.subtract(p0, p1, scratchPrev);
169
- Cartesian3_default.add(p0, previous, previous);
170
- } else {
171
- previous = Cartesian3_default.unpack(
172
- positions,
173
- (offset + j - 1) * 3,
174
- scratchPrev
175
- );
176
- }
177
- const current = Cartesian3_default.unpack(
178
- positions,
179
- (offset + j) * 3,
180
- scratchCur
181
- );
182
- let next;
183
- if (j === count - 1) {
184
- const p2 = Cartesian3_default.unpack(
185
- positions,
186
- (offset + count - 1) * 3,
187
- scratchP0
188
- );
189
- const p3 = Cartesian3_default.unpack(
190
- positions,
191
- (offset + count - 2) * 3,
192
- scratchP1
193
- );
194
- next = Cartesian3_default.subtract(p2, p3, scratchNext);
195
- Cartesian3_default.add(p2, next, next);
196
- } else {
197
- next = Cartesian3_default.unpack(positions, (offset + j + 1) * 3, scratchNext);
198
- }
199
- Cartesian3_default.subtract(previous, center, previous);
200
- Cartesian3_default.subtract(current, center, current);
201
- Cartesian3_default.subtract(next, center, next);
202
- const startK = j === 0 ? 2 : 0;
203
- const endK = j === count - 1 ? 2 : 4;
204
- for (let k = startK; k < endK; ++k) {
205
- Cartesian3_default.pack(current, curPositions, positionIndex);
206
- Cartesian3_default.pack(previous, prevPositions, positionIndex);
207
- Cartesian3_default.pack(next, nextPositions, positionIndex);
208
- positionIndex += 3;
209
- const direction = k - 2 < 0 ? -1 : 1;
210
- expandAndWidth[expandAndWidthIndex++] = 2 * (k % 2) - 1;
211
- expandAndWidth[expandAndWidthIndex++] = direction * width;
212
- vertexBatchIds[batchIdIndex++] = batchId;
213
- }
214
- }
215
- offset += count;
216
- }
217
- const indices = IndexDatatype_default.createTypedArray(size, positionsLength * 6 - 6);
218
- let index = 0;
219
- let indicesIndex = 0;
220
- length = positionsLength - 1;
221
- for (i = 0; i < length; ++i) {
222
- indices[indicesIndex++] = index;
223
- indices[indicesIndex++] = index + 2;
224
- indices[indicesIndex++] = index + 1;
225
- indices[indicesIndex++] = index + 1;
226
- indices[indicesIndex++] = index + 2;
227
- indices[indicesIndex++] = index + 3;
228
- index += 4;
229
- }
230
- transferableObjects.push(
231
- curPositions.buffer,
232
- prevPositions.buffer,
233
- nextPositions.buffer
234
- );
235
- transferableObjects.push(
236
- expandAndWidth.buffer,
237
- vertexBatchIds.buffer,
238
- indices.buffer
239
- );
240
- let results = {
241
- indexDatatype: indices.BYTES_PER_ELEMENT === 2 ? IndexDatatype_default.UNSIGNED_SHORT : IndexDatatype_default.UNSIGNED_INT,
242
- currentPositions: curPositions.buffer,
243
- previousPositions: prevPositions.buffer,
244
- nextPositions: nextPositions.buffer,
245
- expandAndWidth: expandAndWidth.buffer,
246
- batchIds: vertexBatchIds.buffer,
247
- indices: indices.buffer
248
- };
249
- if (parameters.keepDecodedPositions) {
250
- const positionOffsets = getPositionOffsets(counts);
251
- transferableObjects.push(positions.buffer, positionOffsets.buffer);
252
- results = combine_default(results, {
253
- decodedPositions: positions.buffer,
254
- decodedPositionOffsets: positionOffsets.buffer
255
- });
256
- }
257
- return results;
258
- }
259
- var createVectorTilePolylines_default = createTaskProcessorWorker_default(createVectorTilePolylines);
260
- export {
261
- createVectorTilePolylines_default as default
262
- };
26
+ import{a as K}from"./chunk-WZDE3RYP.js";import{a as G}from"./chunk-DEPHB2WM.js";import{a as S}from"./chunk-OFUUQVMR.js";import{c as B,h as R}from"./chunk-PSPPBZWI.js";import"./chunk-AU7IKHOH.js";import{a as t,b as _,d as L}from"./chunk-64RSHJUE.js";import{a as F}from"./chunk-3SSKC3VN.js";import"./chunk-OSW76XDF.js";import"./chunk-ED5JPB3S.js";import"./chunk-LEYMRMBK.js";import"./chunk-VTAIKJXX.js";var O=32767,ct=new _,rt=new t;function it(n,o,p,m,s){let d=n.length/3,U=n.subarray(0,d),v=n.subarray(d,2*d),P=n.subarray(2*d,3*d);G.zigZagDeltaDecode(U,v,P);let D=new Float64Array(n.length);for(let u=0;u<d;++u){let e=U[u],A=v[u],l=P[u],k=F.lerp(o.west,o.east,e/O),I=F.lerp(o.south,o.north,A/O),E=F.lerp(p,m,l/O),g=_.fromRadians(k,I,E,ct),C=s.cartographicToCartesian(g,rt);t.pack(C,D,u*3)}return D}var Y=it;var X=new R,$=new L,j=new t,H={min:void 0,max:void 0};function at(n){n=new Float64Array(n);let o=0;H.min=n[o++],H.max=n[o++],R.unpack(n,o,X),o+=R.packedLength,L.unpack(n,o,$),o+=L.packedLength,t.unpack(n,o,j)}function ft(n){let o=n.length,p=new Uint32Array(o+1),m=0;for(let s=0;s<o;++s)p[s]=m,m+=n[s];return p[o]=m,p}var Z=new t,q=new t,J=new t,dt=new t,Q=new t;function ut(n,o){let p=new Uint16Array(n.positions),m=new Uint16Array(n.widths),s=new Uint32Array(n.counts),d=new Uint16Array(n.batchIds);at(n.packedBuffer);let U=X,v=$,P=j,D=H.min,u=H.max,e=Y(p,U,D,u,v),A=e.length/3,l=A*4-4,k=new Float32Array(l*3),I=new Float32Array(l*3),E=new Float32Array(l*3),g=new Float32Array(l*2),C=new Uint16Array(l),N=0,z=0,tt=0,r,h=0,M=s.length;for(r=0;r<M;++r){let a=s[r],nt=m[r],ot=d[r];for(let f=0;f<a;++f){let w;if(f===0){let c=t.unpack(e,h*3,Z),T=t.unpack(e,(h+1)*3,q);w=t.subtract(c,T,J),t.add(c,w,w)}else w=t.unpack(e,(h+f-1)*3,J);let W=t.unpack(e,(h+f)*3,dt),x;if(f===a-1){let c=t.unpack(e,(h+a-1)*3,Z),T=t.unpack(e,(h+a-2)*3,q);x=t.subtract(c,T,Q),t.add(c,x,x)}else x=t.unpack(e,(h+f+1)*3,Q);t.subtract(w,P,w),t.subtract(W,P,W),t.subtract(x,P,x);let et=f===0?2:0,st=f===a-1?2:4;for(let c=et;c<st;++c){t.pack(W,k,N),t.pack(w,I,N),t.pack(x,E,N),N+=3;let T=c-2<0?-1:1;g[z++]=2*(c%2)-1,g[z++]=T*nt,C[tt++]=ot}}h+=a}let i=S.createTypedArray(l,A*6-6),b=0,y=0;for(M=A-1,r=0;r<M;++r)i[y++]=b,i[y++]=b+2,i[y++]=b+1,i[y++]=b+1,i[y++]=b+2,i[y++]=b+3,b+=4;o.push(k.buffer,I.buffer,E.buffer),o.push(g.buffer,C.buffer,i.buffer);let V={indexDatatype:i.BYTES_PER_ELEMENT===2?S.UNSIGNED_SHORT:S.UNSIGNED_INT,currentPositions:k.buffer,previousPositions:I.buffer,nextPositions:E.buffer,expandAndWidth:g.buffer,batchIds:C.buffer,indices:i.buffer};if(n.keepDecodedPositions){let a=ft(s);o.push(e.buffer,a.buffer),V=B(V,{decodedPositions:e.buffer,decodedPositionOffsets:a.buffer})}return V}var It=K(ut);export{It as default};