@loaders.gl/geotiff 4.1.0-alpha.1 → 4.1.0-alpha.11

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 (69) hide show
  1. package/dist/dist.dev.js +1257 -1073
  2. package/dist/geotiff-loader.d.ts +21 -0
  3. package/dist/geotiff-loader.d.ts.map +1 -0
  4. package/dist/geotiff-loader.js +59 -0
  5. package/dist/geotiff-loader.js.map +1 -0
  6. package/dist/index.cjs +46 -40
  7. package/dist/index.d.ts +2 -1
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +2 -1
  10. package/dist/index.js.map +1 -1
  11. package/dist/lib/load-geotiff.d.ts +1 -1
  12. package/dist/lib/load-geotiff.d.ts.map +1 -1
  13. package/dist/lib/load-geotiff.js +1 -5
  14. package/dist/lib/load-geotiff.js.map +1 -1
  15. package/dist/lib/ome/load-ome-tiff.d.ts +1 -1
  16. package/dist/lib/ome/load-ome-tiff.d.ts.map +1 -1
  17. package/dist/lib/ome/load-ome-tiff.js +1 -1
  18. package/dist/lib/ome/load-ome-tiff.js.map +1 -1
  19. package/dist/lib/ome/ome-indexers.d.ts +1 -0
  20. package/dist/lib/ome/ome-indexers.d.ts.map +1 -1
  21. package/dist/lib/ome/ome-indexers.js.map +1 -1
  22. package/dist/lib/ome/ome-utils.d.ts.map +1 -1
  23. package/dist/lib/ome/ome-utils.js.map +1 -1
  24. package/dist/lib/ome/omexml.d.ts.map +1 -1
  25. package/dist/lib/ome/omexml.js.map +1 -1
  26. package/dist/lib/ome/utils.d.ts.map +1 -1
  27. package/dist/lib/ome/utils.js.map +1 -1
  28. package/dist/lib/tiff-pixel-source.d.ts +1 -2
  29. package/dist/lib/tiff-pixel-source.d.ts.map +1 -1
  30. package/dist/lib/tiff-pixel-source.js +1 -2
  31. package/dist/lib/tiff-pixel-source.js.map +1 -1
  32. package/{src/lib/utils/Pool.ts → dist/lib/utils/Pool.ts.disabled} +3 -2
  33. package/{src/lib/utils/proxies.ts → dist/lib/utils/proxies.ts.disabled} +2 -1
  34. package/dist/lib/utils/tiff-utils.d.ts.map +1 -1
  35. package/dist/lib/utils/tiff-utils.js.map +1 -1
  36. package/dist/loaders.d.ts +13 -0
  37. package/dist/loaders.d.ts.map +1 -0
  38. package/dist/loaders.js +32 -0
  39. package/dist/loaders.js.map +1 -0
  40. package/dist/types.d.ts.map +1 -1
  41. package/dist/types.js.map +1 -1
  42. package/package.json +5 -5
  43. package/src/geotiff-loader.ts +115 -0
  44. package/src/index.ts +5 -2
  45. package/src/lib/load-geotiff.ts +10 -9
  46. package/src/lib/ome/load-ome-tiff.ts +3 -2
  47. package/src/lib/ome/ome-indexers.ts +7 -3
  48. package/src/lib/ome/ome-utils.ts +2 -1
  49. package/src/lib/ome/omexml.ts +2 -1
  50. package/src/lib/ome/utils.ts +2 -1
  51. package/src/lib/tiff-pixel-source.ts +7 -6
  52. package/src/lib/utils/Pool.ts.disabled +99 -0
  53. package/src/lib/utils/proxies.ts.disabled +96 -0
  54. package/src/lib/utils/tiff-utils.ts +2 -1
  55. package/src/loaders.ts +68 -0
  56. package/src/types.ts +2 -1
  57. package/dist/lib/utils/Pool.d.ts +0 -29
  58. package/dist/lib/utils/Pool.d.ts.map +0 -1
  59. package/dist/lib/utils/Pool.js +0 -60
  60. package/dist/lib/utils/Pool.js.map +0 -1
  61. package/dist/lib/utils/proxies.d.ts +0 -6
  62. package/dist/lib/utils/proxies.d.ts.map +0 -1
  63. package/dist/lib/utils/proxies.js +0 -54
  64. package/dist/lib/utils/proxies.js.map +0 -1
  65. package/dist/typings/geotiff.d.ts +0 -60
  66. package/dist/typings/geotiff.d.ts.map +0 -1
  67. package/dist/typings/geotiff.js +0 -2
  68. package/dist/typings/geotiff.js.map +0 -1
  69. package/src/typings/geotiff.ts +0 -75
package/dist/dist.dev.js CHANGED
@@ -199,11 +199,12 @@ var __exports__ = (() => {
199
199
  }
200
200
  });
201
201
 
202
- // ../../node_modules/geotiff/src/globals.js
202
+ // ../../node_modules/geotiff/dist-module/globals.js
203
203
  var fieldTagNames, fieldTags, arrayFields, fieldTypeNames, fieldTypes, photometricInterpretations, ExtraSamplesValues, LercParameters, LercAddCompression, geoKeyNames, geoKeys;
204
204
  var init_globals = __esm({
205
- "../../node_modules/geotiff/src/globals.js"() {
205
+ "../../node_modules/geotiff/dist-module/globals.js"() {
206
206
  fieldTagNames = {
207
+ // TIFF Baseline
207
208
  315: "Artist",
208
209
  258: "BitsPerSample",
209
210
  265: "CellLength",
@@ -240,6 +241,7 @@ var __exports__ = (() => {
240
241
  263: "Threshholding",
241
242
  282: "XResolution",
242
243
  283: "YResolution",
244
+ // TIFF Extended
243
245
  326: "BadFaxLines",
244
246
  327: "CleanFaxData",
245
247
  343: "ClipPath",
@@ -276,6 +278,7 @@ var __exports__ = (() => {
276
278
  530: "YCbCrSubSampling",
277
279
  345: "YClipPathUnits",
278
280
  287: "YPosition",
281
+ // EXIF
279
282
  37378: "ApertureValue",
280
283
  40961: "ColorSpace",
281
284
  36868: "DateTimeDigitized",
@@ -292,18 +295,25 @@ var __exports__ = (() => {
292
295
  37500: "MakerNote",
293
296
  37377: "ShutterSpeedValue",
294
297
  37510: "UserComment",
298
+ // IPTC
295
299
  33723: "IPTC",
300
+ // ICC
296
301
  34675: "ICC Profile",
302
+ // XMP
297
303
  700: "XMP",
304
+ // GDAL
298
305
  42112: "GDAL_METADATA",
299
306
  42113: "GDAL_NODATA",
307
+ // Photoshop
300
308
  34377: "Photoshop",
309
+ // GeoTiff
301
310
  33550: "ModelPixelScale",
302
311
  33922: "ModelTiepoint",
303
312
  34264: "ModelTransformation",
304
313
  34735: "GeoKeyDirectory",
305
314
  34736: "GeoDoubleParams",
306
315
  34737: "GeoAsciiParams",
316
+ // LERC
307
317
  50674: "LercParameters"
308
318
  };
309
319
  fieldTags = {};
@@ -312,7 +322,17 @@ var __exports__ = (() => {
312
322
  fieldTags[fieldTagNames[key]] = parseInt(key, 10);
313
323
  }
314
324
  }
315
- arrayFields = [fieldTags.BitsPerSample, fieldTags.ExtraSamples, fieldTags.SampleFormat, fieldTags.StripByteCounts, fieldTags.StripOffsets, fieldTags.StripRowCounts, fieldTags.TileByteCounts, fieldTags.TileOffsets, fieldTags.SubIFDs];
325
+ arrayFields = [
326
+ fieldTags.BitsPerSample,
327
+ fieldTags.ExtraSamples,
328
+ fieldTags.SampleFormat,
329
+ fieldTags.StripByteCounts,
330
+ fieldTags.StripOffsets,
331
+ fieldTags.StripRowCounts,
332
+ fieldTags.TileByteCounts,
333
+ fieldTags.TileOffsets,
334
+ fieldTags.SubIFDs
335
+ ];
316
336
  fieldTypeNames = {
317
337
  1: "BYTE",
318
338
  2: "ASCII",
@@ -326,7 +346,9 @@ var __exports__ = (() => {
326
346
  10: "SRATIONAL",
327
347
  11: "FLOAT",
328
348
  12: "DOUBLE",
349
+ // IFD offset, suggested by https://owl.phy.queensu.ca/~phil/exiftool/standards.html
329
350
  13: "IFD",
351
+ // introduced by BigTIFF
330
352
  16: "LONG8",
331
353
  17: "SLONG8",
332
354
  18: "IFD8"
@@ -359,7 +381,8 @@ var __exports__ = (() => {
359
381
  };
360
382
  LercAddCompression = {
361
383
  None: 0,
362
- Deflate: 1
384
+ Deflate: 1,
385
+ Zstandard: 2
363
386
  };
364
387
  geoKeyNames = {
365
388
  1024: "GTModelTypeGeoKey",
@@ -419,7 +442,7 @@ var __exports__ = (() => {
419
442
  }
420
443
  });
421
444
 
422
- // ../../node_modules/geotiff/src/predictor.js
445
+ // ../../node_modules/geotiff/dist-module/predictor.js
423
446
  function decodeRowAcc(row, stride) {
424
447
  let length = row.length - stride;
425
448
  let offset = 0;
@@ -471,34 +494,50 @@ var __exports__ = (() => {
471
494
  if (predictor === 2) {
472
495
  switch (bitsPerSample[0]) {
473
496
  case 8:
474
- row = new Uint8Array(block, i * stride * width * bytesPerSample, stride * width * bytesPerSample);
497
+ row = new Uint8Array(
498
+ block,
499
+ i * stride * width * bytesPerSample,
500
+ stride * width * bytesPerSample
501
+ );
475
502
  break;
476
503
  case 16:
477
- row = new Uint16Array(block, i * stride * width * bytesPerSample, stride * width * bytesPerSample / 2);
504
+ row = new Uint16Array(
505
+ block,
506
+ i * stride * width * bytesPerSample,
507
+ stride * width * bytesPerSample / 2
508
+ );
478
509
  break;
479
510
  case 32:
480
- row = new Uint32Array(block, i * stride * width * bytesPerSample, stride * width * bytesPerSample / 4);
511
+ row = new Uint32Array(
512
+ block,
513
+ i * stride * width * bytesPerSample,
514
+ stride * width * bytesPerSample / 4
515
+ );
481
516
  break;
482
517
  default:
483
518
  throw new Error(`Predictor 2 not allowed with ${bitsPerSample[0]} bits per sample.`);
484
519
  }
485
520
  decodeRowAcc(row, stride, bytesPerSample);
486
521
  } else if (predictor === 3) {
487
- row = new Uint8Array(block, i * stride * width * bytesPerSample, stride * width * bytesPerSample);
522
+ row = new Uint8Array(
523
+ block,
524
+ i * stride * width * bytesPerSample,
525
+ stride * width * bytesPerSample
526
+ );
488
527
  decodeRowFloatingPoint(row, stride, bytesPerSample);
489
528
  }
490
529
  }
491
530
  return block;
492
531
  }
493
532
  var init_predictor = __esm({
494
- "../../node_modules/geotiff/src/predictor.js"() {
533
+ "../../node_modules/geotiff/dist-module/predictor.js"() {
495
534
  }
496
535
  });
497
536
 
498
- // ../../node_modules/geotiff/src/compression/basedecoder.js
537
+ // ../../node_modules/geotiff/dist-module/compression/basedecoder.js
499
538
  var BaseDecoder;
500
539
  var init_basedecoder = __esm({
501
- "../../node_modules/geotiff/src/compression/basedecoder.js"() {
540
+ "../../node_modules/geotiff/dist-module/compression/basedecoder.js"() {
502
541
  init_predictor();
503
542
  BaseDecoder = class {
504
543
  async decode(fileDirectory, buffer2) {
@@ -508,7 +547,14 @@ var __exports__ = (() => {
508
547
  const isTiled = !fileDirectory.StripOffsets;
509
548
  const tileWidth = isTiled ? fileDirectory.TileWidth : fileDirectory.ImageWidth;
510
549
  const tileHeight = isTiled ? fileDirectory.TileLength : fileDirectory.RowsPerStrip || fileDirectory.ImageLength;
511
- return applyPredictor(decoded, predictor, tileWidth, tileHeight, fileDirectory.BitsPerSample, fileDirectory.PlanarConfiguration);
550
+ return applyPredictor(
551
+ decoded,
552
+ predictor,
553
+ tileWidth,
554
+ tileHeight,
555
+ fileDirectory.BitsPerSample,
556
+ fileDirectory.PlanarConfiguration
557
+ );
512
558
  }
513
559
  return decoded;
514
560
  }
@@ -516,14 +562,14 @@ var __exports__ = (() => {
516
562
  }
517
563
  });
518
564
 
519
- // ../../node_modules/geotiff/src/compression/raw.js
565
+ // ../../node_modules/geotiff/dist-module/compression/raw.js
520
566
  var raw_exports = {};
521
567
  __export(raw_exports, {
522
568
  default: () => RawDecoder
523
569
  });
524
570
  var RawDecoder;
525
571
  var init_raw = __esm({
526
- "../../node_modules/geotiff/src/compression/raw.js"() {
572
+ "../../node_modules/geotiff/dist-module/compression/raw.js"() {
527
573
  init_basedecoder();
528
574
  RawDecoder = class extends BaseDecoder {
529
575
  decodeBlock(buffer2) {
@@ -533,7 +579,7 @@ var __exports__ = (() => {
533
579
  }
534
580
  });
535
581
 
536
- // ../../node_modules/geotiff/src/compression/lzw.js
582
+ // ../../node_modules/geotiff/dist-module/compression/lzw.js
537
583
  var lzw_exports = {};
538
584
  __export(lzw_exports, {
539
585
  default: () => LZWDecoder
@@ -652,7 +698,7 @@ var __exports__ = (() => {
652
698
  }
653
699
  var MIN_BITS, CLEAR_CODE, EOI_CODE, MAX_BYTELENGTH, LZWDecoder;
654
700
  var init_lzw = __esm({
655
- "../../node_modules/geotiff/src/compression/lzw.js"() {
701
+ "../../node_modules/geotiff/dist-module/compression/lzw.js"() {
656
702
  init_basedecoder();
657
703
  MIN_BITS = 9;
658
704
  CLEAR_CODE = 256;
@@ -666,7 +712,7 @@ var __exports__ = (() => {
666
712
  }
667
713
  });
668
714
 
669
- // ../../node_modules/geotiff/src/compression/jpeg.js
715
+ // ../../node_modules/geotiff/dist-module/compression/jpeg.js
670
716
  var jpeg_exports = {};
671
717
  __export(jpeg_exports, {
672
718
  default: () => JpegDecoder
@@ -678,10 +724,7 @@ var __exports__ = (() => {
678
724
  while (length > 0 && !codeLengths[length - 1]) {
679
725
  --length;
680
726
  }
681
- code.push({
682
- children: [],
683
- index: 0
684
- });
727
+ code.push({ children: [], index: 0 });
685
728
  let p = code[0];
686
729
  let q;
687
730
  for (let i = 0; i < length; i++) {
@@ -694,20 +737,14 @@ var __exports__ = (() => {
694
737
  p.index++;
695
738
  code.push(p);
696
739
  while (code.length <= i) {
697
- code.push(q = {
698
- children: [],
699
- index: 0
700
- });
740
+ code.push(q = { children: [], index: 0 });
701
741
  p.children[p.index] = q.children;
702
742
  p = q;
703
743
  }
704
744
  k++;
705
745
  }
706
746
  if (i + 1 < length) {
707
- code.push(q = {
708
- children: [],
709
- index: 0
710
- });
747
+ code.push(q = { children: [], index: 0 });
711
748
  p.children[p.index] = q.children;
712
749
  p = q;
713
750
  }
@@ -715,10 +752,7 @@ var __exports__ = (() => {
715
752
  return code[0].children;
716
753
  }
717
754
  function decodeScan(data, initialOffset, frame, components, resetInterval, spectralStart, spectralEnd, successivePrev, successive) {
718
- const {
719
- mcusPerLine,
720
- progressive
721
- } = frame;
755
+ const { mcusPerLine, progressive } = frame;
722
756
  const startOffset = initialOffset;
723
757
  let offset = initialOffset;
724
758
  let bitsData = 0;
@@ -949,10 +983,7 @@ var __exports__ = (() => {
949
983
  for (n = 0; n < usedResetInterval; n++) {
950
984
  for (i = 0; i < componentsLength; i++) {
951
985
  component = components[i];
952
- const {
953
- h,
954
- v
955
- } = component;
986
+ const { h, v } = component;
956
987
  for (j = 0; j < v; j++) {
957
988
  for (k = 0; k < h; k++) {
958
989
  decodeMcu(component, decodeFn, mcu, j, k);
@@ -980,10 +1011,7 @@ var __exports__ = (() => {
980
1011
  }
981
1012
  function buildComponentData(frame, component) {
982
1013
  const lines = [];
983
- const {
984
- blocksPerLine,
985
- blocksPerColumn
986
- } = component;
1014
+ const { blocksPerLine, blocksPerColumn } = component;
987
1015
  const samplesPerLine = blocksPerLine << 3;
988
1016
  const R = new Int32Array(64);
989
1017
  const r = new Uint8Array(64);
@@ -1145,9 +1173,74 @@ var __exports__ = (() => {
1145
1173
  }
1146
1174
  var dctZigZag, dctCos1, dctSin1, dctCos3, dctSin3, dctCos6, dctSin6, dctSqrt2, dctSqrt1d2, JpegStreamReader, JpegDecoder;
1147
1175
  var init_jpeg = __esm({
1148
- "../../node_modules/geotiff/src/compression/jpeg.js"() {
1176
+ "../../node_modules/geotiff/dist-module/compression/jpeg.js"() {
1149
1177
  init_basedecoder();
1150
- dctZigZag = new Int32Array([0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63]);
1178
+ dctZigZag = new Int32Array([
1179
+ 0,
1180
+ 1,
1181
+ 8,
1182
+ 16,
1183
+ 9,
1184
+ 2,
1185
+ 3,
1186
+ 10,
1187
+ 17,
1188
+ 24,
1189
+ 32,
1190
+ 25,
1191
+ 18,
1192
+ 11,
1193
+ 4,
1194
+ 5,
1195
+ 12,
1196
+ 19,
1197
+ 26,
1198
+ 33,
1199
+ 40,
1200
+ 48,
1201
+ 41,
1202
+ 34,
1203
+ 27,
1204
+ 20,
1205
+ 13,
1206
+ 6,
1207
+ 7,
1208
+ 14,
1209
+ 21,
1210
+ 28,
1211
+ 35,
1212
+ 42,
1213
+ 49,
1214
+ 56,
1215
+ 57,
1216
+ 50,
1217
+ 43,
1218
+ 36,
1219
+ 29,
1220
+ 22,
1221
+ 15,
1222
+ 23,
1223
+ 30,
1224
+ 37,
1225
+ 44,
1226
+ 51,
1227
+ 58,
1228
+ 59,
1229
+ 52,
1230
+ 45,
1231
+ 38,
1232
+ 31,
1233
+ 39,
1234
+ 46,
1235
+ 53,
1236
+ 60,
1237
+ 61,
1238
+ 54,
1239
+ 47,
1240
+ 55,
1241
+ 62,
1242
+ 63
1243
+ ]);
1151
1244
  dctCos1 = 4017;
1152
1245
  dctSin1 = 799;
1153
1246
  dctCos3 = 3406;
@@ -1254,10 +1347,7 @@ var __exports__ = (() => {
1254
1347
  if (fileMarker === 65504) {
1255
1348
  if (appData[0] === 74 && appData[1] === 70 && appData[2] === 73 && appData[3] === 70 && appData[4] === 0) {
1256
1349
  this.jfif = {
1257
- version: {
1258
- major: appData[5],
1259
- minor: appData[6]
1260
- },
1350
+ version: { major: appData[5], minor: appData[6] },
1261
1351
  densityUnits: appData[7],
1262
1352
  xDensity: appData[8] << 8 | appData[9],
1263
1353
  yDensity: appData[10] << 8 | appData[11],
@@ -1350,9 +1440,15 @@ var __exports__ = (() => {
1350
1440
  }
1351
1441
  i += 17 + codeLengthSum;
1352
1442
  if (huffmanTableSpec >> 4 === 0) {
1353
- this.huffmanTablesDC[huffmanTableSpec & 15] = buildHuffmanTable(codeLengths, huffmanValues);
1443
+ this.huffmanTablesDC[huffmanTableSpec & 15] = buildHuffmanTable(
1444
+ codeLengths,
1445
+ huffmanValues
1446
+ );
1354
1447
  } else {
1355
- this.huffmanTablesAC[huffmanTableSpec & 15] = buildHuffmanTable(codeLengths, huffmanValues);
1448
+ this.huffmanTablesAC[huffmanTableSpec & 15] = buildHuffmanTable(
1449
+ codeLengths,
1450
+ huffmanValues
1451
+ );
1356
1452
  }
1357
1453
  }
1358
1454
  break;
@@ -1376,7 +1472,17 @@ var __exports__ = (() => {
1376
1472
  const spectralStart = data[offset++];
1377
1473
  const spectralEnd = data[offset++];
1378
1474
  const successiveApproximation = data[offset++];
1379
- const processed = decodeScan(data, offset, frame, components, this.resetInterval, spectralStart, spectralEnd, successiveApproximation >> 4, successiveApproximation & 15);
1475
+ const processed = decodeScan(
1476
+ data,
1477
+ offset,
1478
+ frame,
1479
+ components,
1480
+ this.resetInterval,
1481
+ spectralStart,
1482
+ spectralEnd,
1483
+ successiveApproximation >> 4,
1484
+ successiveApproximation & 15
1485
+ );
1380
1486
  offset += processed;
1381
1487
  break;
1382
1488
  }
@@ -1396,9 +1502,7 @@ var __exports__ = (() => {
1396
1502
  }
1397
1503
  }
1398
1504
  getResult() {
1399
- const {
1400
- frames
1401
- } = this;
1505
+ const { frames } = this;
1402
1506
  if (this.frames.length === 0) {
1403
1507
  throw new Error("no frames were decoded");
1404
1508
  } else if (this.frames.length > 1) {
@@ -1412,10 +1516,7 @@ var __exports__ = (() => {
1412
1516
  }
1413
1517
  }
1414
1518
  const frame = frames[0];
1415
- const {
1416
- components,
1417
- componentsOrder
1418
- } = frame;
1519
+ const { components, componentsOrder } = frame;
1419
1520
  const outComponents = [];
1420
1521
  const width = frame.samplesPerLine;
1421
1522
  const height = frame.scanLines;
@@ -5614,14 +5715,14 @@ var __exports__ = (() => {
5614
5715
  }
5615
5716
  });
5616
5717
 
5617
- // ../../node_modules/geotiff/src/compression/deflate.js
5718
+ // ../../node_modules/geotiff/dist-module/compression/deflate.js
5618
5719
  var deflate_exports = {};
5619
5720
  __export(deflate_exports, {
5620
5721
  default: () => DeflateDecoder
5621
5722
  });
5622
5723
  var DeflateDecoder;
5623
5724
  var init_deflate = __esm({
5624
- "../../node_modules/geotiff/src/compression/deflate.js"() {
5725
+ "../../node_modules/geotiff/dist-module/compression/deflate.js"() {
5625
5726
  init_pako_esm();
5626
5727
  init_basedecoder();
5627
5728
  DeflateDecoder = class extends BaseDecoder {
@@ -5632,14 +5733,14 @@ var __exports__ = (() => {
5632
5733
  }
5633
5734
  });
5634
5735
 
5635
- // ../../node_modules/geotiff/src/compression/packbits.js
5736
+ // ../../node_modules/geotiff/dist-module/compression/packbits.js
5636
5737
  var packbits_exports = {};
5637
5738
  __export(packbits_exports, {
5638
5739
  default: () => PackbitsDecoder
5639
5740
  });
5640
5741
  var PackbitsDecoder;
5641
5742
  var init_packbits = __esm({
5642
- "../../node_modules/geotiff/src/compression/packbits.js"() {
5743
+ "../../node_modules/geotiff/dist-module/compression/packbits.js"() {
5643
5744
  init_basedecoder();
5644
5745
  PackbitsDecoder = class extends BaseDecoder {
5645
5746
  decodeBlock(buffer2) {
@@ -7649,18 +7750,66 @@ var __exports__ = (() => {
7649
7750
  }
7650
7751
  });
7651
7752
 
7652
- // ../../node_modules/geotiff/src/compression/lerc.js
7753
+ // ../../node_modules/zstddec/dist/zstddec.modern.js
7754
+ var init, instance, heap, IMPORT_OBJECT, ZSTDDecoder, wasm;
7755
+ var init_zstddec_modern = __esm({
7756
+ "../../node_modules/zstddec/dist/zstddec.modern.js"() {
7757
+ IMPORT_OBJECT = {
7758
+ env: {
7759
+ emscripten_notify_memory_growth: function(index) {
7760
+ heap = new Uint8Array(instance.exports.memory.buffer);
7761
+ }
7762
+ }
7763
+ };
7764
+ ZSTDDecoder = class {
7765
+ init() {
7766
+ if (init)
7767
+ return init;
7768
+ if (typeof fetch !== "undefined") {
7769
+ init = fetch("data:application/wasm;base64," + wasm).then((response) => response.arrayBuffer()).then((arrayBuffer) => WebAssembly.instantiate(arrayBuffer, IMPORT_OBJECT)).then(this._init);
7770
+ } else {
7771
+ init = WebAssembly.instantiate(Buffer.from(wasm, "base64"), IMPORT_OBJECT).then(this._init);
7772
+ }
7773
+ return init;
7774
+ }
7775
+ _init(result) {
7776
+ instance = result.instance;
7777
+ IMPORT_OBJECT.env.emscripten_notify_memory_growth(0);
7778
+ }
7779
+ decode(array, uncompressedSize = 0) {
7780
+ if (!instance)
7781
+ throw new Error(`ZSTDDecoder: Await .init() before decoding.`);
7782
+ const compressedSize = array.byteLength;
7783
+ const compressedPtr = instance.exports.malloc(compressedSize);
7784
+ heap.set(array, compressedPtr);
7785
+ uncompressedSize = uncompressedSize || Number(instance.exports.ZSTD_findDecompressedSize(compressedPtr, compressedSize));
7786
+ const uncompressedPtr = instance.exports.malloc(uncompressedSize);
7787
+ const actualSize = instance.exports.ZSTD_decompress(uncompressedPtr, uncompressedSize, compressedPtr, compressedSize);
7788
+ const dec = heap.slice(uncompressedPtr, uncompressedPtr + actualSize);
7789
+ instance.exports.free(compressedPtr);
7790
+ instance.exports.free(uncompressedPtr);
7791
+ return dec;
7792
+ }
7793
+ };
7794
+ wasm = "AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJqIgFBfGoi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X9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgF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gDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIA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DCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEI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//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ";
7795
+ }
7796
+ });
7797
+
7798
+ // ../../node_modules/geotiff/dist-module/compression/lerc.js
7653
7799
  var lerc_exports = {};
7654
7800
  __export(lerc_exports, {
7655
- default: () => LercDecoder
7801
+ default: () => LercDecoder,
7802
+ zstd: () => zstd
7656
7803
  });
7657
- var import_lerc, LercDecoder;
7804
+ var import_lerc, zstd, LercDecoder;
7658
7805
  var init_lerc = __esm({
7659
- "../../node_modules/geotiff/src/compression/lerc.js"() {
7806
+ "../../node_modules/geotiff/dist-module/compression/lerc.js"() {
7660
7807
  init_pako_esm();
7661
- import_lerc = __toESM(require_LercDecode());
7808
+ import_lerc = __toESM(require_LercDecode(), 1);
7809
+ init_zstddec_modern();
7662
7810
  init_basedecoder();
7663
7811
  init_globals();
7812
+ zstd = new ZSTDDecoder();
7664
7813
  LercDecoder = class extends BaseDecoder {
7665
7814
  constructor(fileDirectory) {
7666
7815
  super();
@@ -7675,12 +7824,13 @@ var __exports__ = (() => {
7675
7824
  case LercAddCompression.Deflate:
7676
7825
  buffer2 = inflate_1(new Uint8Array(buffer2)).buffer;
7677
7826
  break;
7827
+ case LercAddCompression.Zstandard:
7828
+ buffer2 = zstd.decode(new Uint8Array(buffer2)).buffer;
7829
+ break;
7678
7830
  default:
7679
7831
  throw new Error(`Unsupported LERC additional compression method identifier: ${this.addCompression}`);
7680
7832
  }
7681
- const lercResult = import_lerc.default.decode(buffer2, {
7682
- returnPixelInterleavedDims: this.planarConfiguration === 1
7683
- });
7833
+ const lercResult = import_lerc.default.decode(buffer2, { returnPixelInterleavedDims: this.planarConfiguration === 1 });
7684
7834
  const lercData = lercResult.pixels[0];
7685
7835
  return lercData.buffer;
7686
7836
  }
@@ -7688,656 +7838,40 @@ var __exports__ = (() => {
7688
7838
  }
7689
7839
  });
7690
7840
 
7691
- // ../../node_modules/geotiff/node_modules/yallist/iterator.js
7692
- var require_iterator = __commonJS({
7693
- "../../node_modules/geotiff/node_modules/yallist/iterator.js"(exports, module) {
7694
- "use strict";
7695
- module.exports = function(Yallist) {
7696
- Yallist.prototype[Symbol.iterator] = function* () {
7697
- for (let walker = this.head; walker; walker = walker.next) {
7698
- yield walker.value;
7699
- }
7700
- };
7701
- };
7702
- }
7703
- });
7704
-
7705
- // ../../node_modules/geotiff/node_modules/yallist/yallist.js
7706
- var require_yallist = __commonJS({
7707
- "../../node_modules/geotiff/node_modules/yallist/yallist.js"(exports, module) {
7708
- "use strict";
7709
- module.exports = Yallist;
7710
- Yallist.Node = Node;
7711
- Yallist.create = Yallist;
7712
- function Yallist(list) {
7713
- var self = this;
7714
- if (!(self instanceof Yallist)) {
7715
- self = new Yallist();
7716
- }
7717
- self.tail = null;
7718
- self.head = null;
7719
- self.length = 0;
7720
- if (list && typeof list.forEach === "function") {
7721
- list.forEach(function(item) {
7722
- self.push(item);
7723
- });
7724
- } else if (arguments.length > 0) {
7725
- for (var i = 0, l = arguments.length; i < l; i++) {
7726
- self.push(arguments[i]);
7727
- }
7728
- }
7729
- return self;
7730
- }
7731
- Yallist.prototype.removeNode = function(node) {
7732
- if (node.list !== this) {
7733
- throw new Error("removing node which does not belong to this list");
7734
- }
7735
- var next3 = node.next;
7736
- var prev = node.prev;
7737
- if (next3) {
7738
- next3.prev = prev;
7739
- }
7740
- if (prev) {
7741
- prev.next = next3;
7742
- }
7743
- if (node === this.head) {
7744
- this.head = next3;
7745
- }
7746
- if (node === this.tail) {
7747
- this.tail = prev;
7748
- }
7749
- node.list.length--;
7750
- node.next = null;
7751
- node.prev = null;
7752
- node.list = null;
7753
- return next3;
7754
- };
7755
- Yallist.prototype.unshiftNode = function(node) {
7756
- if (node === this.head) {
7757
- return;
7758
- }
7759
- if (node.list) {
7760
- node.list.removeNode(node);
7761
- }
7762
- var head = this.head;
7763
- node.list = this;
7764
- node.next = head;
7765
- if (head) {
7766
- head.prev = node;
7767
- }
7768
- this.head = node;
7769
- if (!this.tail) {
7770
- this.tail = node;
7771
- }
7772
- this.length++;
7773
- };
7774
- Yallist.prototype.pushNode = function(node) {
7775
- if (node === this.tail) {
7776
- return;
7777
- }
7778
- if (node.list) {
7779
- node.list.removeNode(node);
7780
- }
7781
- var tail = this.tail;
7782
- node.list = this;
7783
- node.prev = tail;
7784
- if (tail) {
7785
- tail.next = node;
7786
- }
7787
- this.tail = node;
7788
- if (!this.head) {
7789
- this.head = node;
7790
- }
7791
- this.length++;
7792
- };
7793
- Yallist.prototype.push = function() {
7794
- for (var i = 0, l = arguments.length; i < l; i++) {
7795
- push(this, arguments[i]);
7796
- }
7797
- return this.length;
7798
- };
7799
- Yallist.prototype.unshift = function() {
7800
- for (var i = 0, l = arguments.length; i < l; i++) {
7801
- unshift(this, arguments[i]);
7802
- }
7803
- return this.length;
7804
- };
7805
- Yallist.prototype.pop = function() {
7806
- if (!this.tail) {
7807
- return void 0;
7808
- }
7809
- var res = this.tail.value;
7810
- this.tail = this.tail.prev;
7811
- if (this.tail) {
7812
- this.tail.next = null;
7813
- } else {
7814
- this.head = null;
7815
- }
7816
- this.length--;
7817
- return res;
7818
- };
7819
- Yallist.prototype.shift = function() {
7820
- if (!this.head) {
7821
- return void 0;
7822
- }
7823
- var res = this.head.value;
7824
- this.head = this.head.next;
7825
- if (this.head) {
7826
- this.head.prev = null;
7827
- } else {
7828
- this.tail = null;
7829
- }
7830
- this.length--;
7831
- return res;
7832
- };
7833
- Yallist.prototype.forEach = function(fn, thisp) {
7834
- thisp = thisp || this;
7835
- for (var walker = this.head, i = 0; walker !== null; i++) {
7836
- fn.call(thisp, walker.value, i, this);
7837
- walker = walker.next;
7838
- }
7839
- };
7840
- Yallist.prototype.forEachReverse = function(fn, thisp) {
7841
- thisp = thisp || this;
7842
- for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
7843
- fn.call(thisp, walker.value, i, this);
7844
- walker = walker.prev;
7845
- }
7846
- };
7847
- Yallist.prototype.get = function(n) {
7848
- for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
7849
- walker = walker.next;
7850
- }
7851
- if (i === n && walker !== null) {
7852
- return walker.value;
7853
- }
7854
- };
7855
- Yallist.prototype.getReverse = function(n) {
7856
- for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
7857
- walker = walker.prev;
7858
- }
7859
- if (i === n && walker !== null) {
7860
- return walker.value;
7861
- }
7862
- };
7863
- Yallist.prototype.map = function(fn, thisp) {
7864
- thisp = thisp || this;
7865
- var res = new Yallist();
7866
- for (var walker = this.head; walker !== null; ) {
7867
- res.push(fn.call(thisp, walker.value, this));
7868
- walker = walker.next;
7869
- }
7870
- return res;
7871
- };
7872
- Yallist.prototype.mapReverse = function(fn, thisp) {
7873
- thisp = thisp || this;
7874
- var res = new Yallist();
7875
- for (var walker = this.tail; walker !== null; ) {
7876
- res.push(fn.call(thisp, walker.value, this));
7877
- walker = walker.prev;
7878
- }
7879
- return res;
7880
- };
7881
- Yallist.prototype.reduce = function(fn, initial) {
7882
- var acc;
7883
- var walker = this.head;
7884
- if (arguments.length > 1) {
7885
- acc = initial;
7886
- } else if (this.head) {
7887
- walker = this.head.next;
7888
- acc = this.head.value;
7889
- } else {
7890
- throw new TypeError("Reduce of empty list with no initial value");
7891
- }
7892
- for (var i = 0; walker !== null; i++) {
7893
- acc = fn(acc, walker.value, i);
7894
- walker = walker.next;
7895
- }
7896
- return acc;
7897
- };
7898
- Yallist.prototype.reduceReverse = function(fn, initial) {
7899
- var acc;
7900
- var walker = this.tail;
7901
- if (arguments.length > 1) {
7902
- acc = initial;
7903
- } else if (this.tail) {
7904
- walker = this.tail.prev;
7905
- acc = this.tail.value;
7906
- } else {
7907
- throw new TypeError("Reduce of empty list with no initial value");
7908
- }
7909
- for (var i = this.length - 1; walker !== null; i--) {
7910
- acc = fn(acc, walker.value, i);
7911
- walker = walker.prev;
7912
- }
7913
- return acc;
7914
- };
7915
- Yallist.prototype.toArray = function() {
7916
- var arr = new Array(this.length);
7917
- for (var i = 0, walker = this.head; walker !== null; i++) {
7918
- arr[i] = walker.value;
7919
- walker = walker.next;
7920
- }
7921
- return arr;
7922
- };
7923
- Yallist.prototype.toArrayReverse = function() {
7924
- var arr = new Array(this.length);
7925
- for (var i = 0, walker = this.tail; walker !== null; i++) {
7926
- arr[i] = walker.value;
7927
- walker = walker.prev;
7928
- }
7929
- return arr;
7930
- };
7931
- Yallist.prototype.slice = function(from, to) {
7932
- to = to || this.length;
7933
- if (to < 0) {
7934
- to += this.length;
7935
- }
7936
- from = from || 0;
7937
- if (from < 0) {
7938
- from += this.length;
7939
- }
7940
- var ret = new Yallist();
7941
- if (to < from || to < 0) {
7942
- return ret;
7943
- }
7944
- if (from < 0) {
7945
- from = 0;
7946
- }
7947
- if (to > this.length) {
7948
- to = this.length;
7949
- }
7950
- for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
7951
- walker = walker.next;
7952
- }
7953
- for (; walker !== null && i < to; i++, walker = walker.next) {
7954
- ret.push(walker.value);
7955
- }
7956
- return ret;
7957
- };
7958
- Yallist.prototype.sliceReverse = function(from, to) {
7959
- to = to || this.length;
7960
- if (to < 0) {
7961
- to += this.length;
7962
- }
7963
- from = from || 0;
7964
- if (from < 0) {
7965
- from += this.length;
7966
- }
7967
- var ret = new Yallist();
7968
- if (to < from || to < 0) {
7969
- return ret;
7970
- }
7971
- if (from < 0) {
7972
- from = 0;
7973
- }
7974
- if (to > this.length) {
7975
- to = this.length;
7976
- }
7977
- for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
7978
- walker = walker.prev;
7979
- }
7980
- for (; walker !== null && i > from; i--, walker = walker.prev) {
7981
- ret.push(walker.value);
7982
- }
7983
- return ret;
7984
- };
7985
- Yallist.prototype.splice = function(start, deleteCount, ...nodes) {
7986
- if (start > this.length) {
7987
- start = this.length - 1;
7988
- }
7989
- if (start < 0) {
7990
- start = this.length + start;
7991
- }
7992
- for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
7993
- walker = walker.next;
7994
- }
7995
- var ret = [];
7996
- for (var i = 0; walker && i < deleteCount; i++) {
7997
- ret.push(walker.value);
7998
- walker = this.removeNode(walker);
7999
- }
8000
- if (walker === null) {
8001
- walker = this.tail;
8002
- }
8003
- if (walker !== this.head && walker !== this.tail) {
8004
- walker = walker.prev;
8005
- }
8006
- for (var i = 0; i < nodes.length; i++) {
8007
- walker = insert(this, walker, nodes[i]);
8008
- }
8009
- return ret;
8010
- };
8011
- Yallist.prototype.reverse = function() {
8012
- var head = this.head;
8013
- var tail = this.tail;
8014
- for (var walker = head; walker !== null; walker = walker.prev) {
8015
- var p = walker.prev;
8016
- walker.prev = walker.next;
8017
- walker.next = p;
8018
- }
8019
- this.head = tail;
8020
- this.tail = head;
8021
- return this;
8022
- };
8023
- function insert(self, node, value) {
8024
- var inserted = node === self.head ? new Node(value, null, node, self) : new Node(value, node, node.next, self);
8025
- if (inserted.next === null) {
8026
- self.tail = inserted;
8027
- }
8028
- if (inserted.prev === null) {
8029
- self.head = inserted;
8030
- }
8031
- self.length++;
8032
- return inserted;
8033
- }
8034
- function push(self, item) {
8035
- self.tail = new Node(item, self.tail, null, self);
8036
- if (!self.head) {
8037
- self.head = self.tail;
8038
- }
8039
- self.length++;
8040
- }
8041
- function unshift(self, item) {
8042
- self.head = new Node(item, null, self.head, self);
8043
- if (!self.tail) {
8044
- self.tail = self.head;
8045
- }
8046
- self.length++;
8047
- }
8048
- function Node(value, prev, next3, list) {
8049
- if (!(this instanceof Node)) {
8050
- return new Node(value, prev, next3, list);
8051
- }
8052
- this.list = list;
8053
- this.value = value;
8054
- if (prev) {
8055
- prev.next = this;
8056
- this.prev = prev;
8057
- } else {
8058
- this.prev = null;
8059
- }
8060
- if (next3) {
8061
- next3.prev = this;
8062
- this.next = next3;
8063
- } else {
8064
- this.next = null;
8065
- }
8066
- }
8067
- try {
8068
- require_iterator()(Yallist);
8069
- } catch (er) {
8070
- }
8071
- }
7841
+ // ../../node_modules/geotiff/dist-module/compression/webimage.js
7842
+ var webimage_exports = {};
7843
+ __export(webimage_exports, {
7844
+ default: () => WebImageDecoder
8072
7845
  });
8073
-
8074
- // ../../node_modules/geotiff/node_modules/lru-cache/index.js
8075
- var require_lru_cache = __commonJS({
8076
- "../../node_modules/geotiff/node_modules/lru-cache/index.js"(exports, module) {
8077
- "use strict";
8078
- var Yallist = require_yallist();
8079
- var MAX = Symbol("max");
8080
- var LENGTH2 = Symbol("length");
8081
- var LENGTH_CALCULATOR = Symbol("lengthCalculator");
8082
- var ALLOW_STALE = Symbol("allowStale");
8083
- var MAX_AGE = Symbol("maxAge");
8084
- var DISPOSE = Symbol("dispose");
8085
- var NO_DISPOSE_ON_SET = Symbol("noDisposeOnSet");
8086
- var LRU_LIST = Symbol("lruList");
8087
- var CACHE = Symbol("cache");
8088
- var UPDATE_AGE_ON_GET = Symbol("updateAgeOnGet");
8089
- var naiveLength = () => 1;
8090
- var LRUCache2 = class {
8091
- constructor(options) {
8092
- if (typeof options === "number")
8093
- options = { max: options };
8094
- if (!options)
8095
- options = {};
8096
- if (options.max && (typeof options.max !== "number" || options.max < 0))
8097
- throw new TypeError("max must be a non-negative number");
8098
- const max = this[MAX] = options.max || Infinity;
8099
- const lc = options.length || naiveLength;
8100
- this[LENGTH_CALCULATOR] = typeof lc !== "function" ? naiveLength : lc;
8101
- this[ALLOW_STALE] = options.stale || false;
8102
- if (options.maxAge && typeof options.maxAge !== "number")
8103
- throw new TypeError("maxAge must be a number");
8104
- this[MAX_AGE] = options.maxAge || 0;
8105
- this[DISPOSE] = options.dispose;
8106
- this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
8107
- this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
8108
- this.reset();
8109
- }
8110
- // resize the cache when the max changes.
8111
- set max(mL) {
8112
- if (typeof mL !== "number" || mL < 0)
8113
- throw new TypeError("max must be a non-negative number");
8114
- this[MAX] = mL || Infinity;
8115
- trim(this);
8116
- }
8117
- get max() {
8118
- return this[MAX];
8119
- }
8120
- set allowStale(allowStale) {
8121
- this[ALLOW_STALE] = !!allowStale;
8122
- }
8123
- get allowStale() {
8124
- return this[ALLOW_STALE];
8125
- }
8126
- set maxAge(mA) {
8127
- if (typeof mA !== "number")
8128
- throw new TypeError("maxAge must be a non-negative number");
8129
- this[MAX_AGE] = mA;
8130
- trim(this);
8131
- }
8132
- get maxAge() {
8133
- return this[MAX_AGE];
8134
- }
8135
- // resize the cache when the lengthCalculator changes.
8136
- set lengthCalculator(lC) {
8137
- if (typeof lC !== "function")
8138
- lC = naiveLength;
8139
- if (lC !== this[LENGTH_CALCULATOR]) {
8140
- this[LENGTH_CALCULATOR] = lC;
8141
- this[LENGTH2] = 0;
8142
- this[LRU_LIST].forEach((hit) => {
8143
- hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
8144
- this[LENGTH2] += hit.length;
8145
- });
8146
- }
8147
- trim(this);
8148
- }
8149
- get lengthCalculator() {
8150
- return this[LENGTH_CALCULATOR];
8151
- }
8152
- get length() {
8153
- return this[LENGTH2];
8154
- }
8155
- get itemCount() {
8156
- return this[LRU_LIST].length;
8157
- }
8158
- rforEach(fn, thisp) {
8159
- thisp = thisp || this;
8160
- for (let walker = this[LRU_LIST].tail; walker !== null; ) {
8161
- const prev = walker.prev;
8162
- forEachStep(this, fn, walker, thisp);
8163
- walker = prev;
8164
- }
8165
- }
8166
- forEach(fn, thisp) {
8167
- thisp = thisp || this;
8168
- for (let walker = this[LRU_LIST].head; walker !== null; ) {
8169
- const next3 = walker.next;
8170
- forEachStep(this, fn, walker, thisp);
8171
- walker = next3;
8172
- }
8173
- }
8174
- keys() {
8175
- return this[LRU_LIST].toArray().map((k) => k.key);
8176
- }
8177
- values() {
8178
- return this[LRU_LIST].toArray().map((k) => k.value);
8179
- }
8180
- reset() {
8181
- if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
8182
- this[LRU_LIST].forEach((hit) => this[DISPOSE](hit.key, hit.value));
8183
- }
8184
- this[CACHE] = /* @__PURE__ */ new Map();
8185
- this[LRU_LIST] = new Yallist();
8186
- this[LENGTH2] = 0;
8187
- }
8188
- dump() {
8189
- return this[LRU_LIST].map((hit) => isStale(this, hit) ? false : {
8190
- k: hit.key,
8191
- v: hit.value,
8192
- e: hit.now + (hit.maxAge || 0)
8193
- }).toArray().filter((h) => h);
8194
- }
8195
- dumpLru() {
8196
- return this[LRU_LIST];
8197
- }
8198
- set(key, value, maxAge) {
8199
- maxAge = maxAge || this[MAX_AGE];
8200
- if (maxAge && typeof maxAge !== "number")
8201
- throw new TypeError("maxAge must be a number");
8202
- const now = maxAge ? Date.now() : 0;
8203
- const len = this[LENGTH_CALCULATOR](value, key);
8204
- if (this[CACHE].has(key)) {
8205
- if (len > this[MAX]) {
8206
- del(this, this[CACHE].get(key));
8207
- return false;
8208
- }
8209
- const node = this[CACHE].get(key);
8210
- const item = node.value;
8211
- if (this[DISPOSE]) {
8212
- if (!this[NO_DISPOSE_ON_SET])
8213
- this[DISPOSE](key, item.value);
8214
- }
8215
- item.now = now;
8216
- item.maxAge = maxAge;
8217
- item.value = value;
8218
- this[LENGTH2] += len - item.length;
8219
- item.length = len;
8220
- this.get(key);
8221
- trim(this);
8222
- return true;
8223
- }
8224
- const hit = new Entry(key, value, len, now, maxAge);
8225
- if (hit.length > this[MAX]) {
8226
- if (this[DISPOSE])
8227
- this[DISPOSE](key, value);
8228
- return false;
8229
- }
8230
- this[LENGTH2] += hit.length;
8231
- this[LRU_LIST].unshift(hit);
8232
- this[CACHE].set(key, this[LRU_LIST].head);
8233
- trim(this);
8234
- return true;
8235
- }
8236
- has(key) {
8237
- if (!this[CACHE].has(key))
8238
- return false;
8239
- const hit = this[CACHE].get(key).value;
8240
- return !isStale(this, hit);
8241
- }
8242
- get(key) {
8243
- return get(this, key, true);
8244
- }
8245
- peek(key) {
8246
- return get(this, key, false);
8247
- }
8248
- pop() {
8249
- const node = this[LRU_LIST].tail;
8250
- if (!node)
8251
- return null;
8252
- del(this, node);
8253
- return node.value;
8254
- }
8255
- del(key) {
8256
- del(this, this[CACHE].get(key));
8257
- }
8258
- load(arr) {
8259
- this.reset();
8260
- const now = Date.now();
8261
- for (let l = arr.length - 1; l >= 0; l--) {
8262
- const hit = arr[l];
8263
- const expiresAt = hit.e || 0;
8264
- if (expiresAt === 0)
8265
- this.set(hit.k, hit.v);
8266
- else {
8267
- const maxAge = expiresAt - now;
8268
- if (maxAge > 0) {
8269
- this.set(hit.k, hit.v, maxAge);
8270
- }
8271
- }
7846
+ var WebImageDecoder;
7847
+ var init_webimage = __esm({
7848
+ "../../node_modules/geotiff/dist-module/compression/webimage.js"() {
7849
+ init_basedecoder();
7850
+ WebImageDecoder = class extends BaseDecoder {
7851
+ constructor() {
7852
+ super();
7853
+ if (typeof createImageBitmap === "undefined") {
7854
+ throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");
7855
+ } else if (typeof document === "undefined" && typeof OffscreenCanvas === "undefined") {
7856
+ throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available");
8272
7857
  }
8273
7858
  }
8274
- prune() {
8275
- this[CACHE].forEach((value, key) => get(this, key, false));
8276
- }
8277
- };
8278
- var get = (self, key, doUse) => {
8279
- const node = self[CACHE].get(key);
8280
- if (node) {
8281
- const hit = node.value;
8282
- if (isStale(self, hit)) {
8283
- del(self, node);
8284
- if (!self[ALLOW_STALE])
8285
- return void 0;
7859
+ async decode(fileDirectory, buffer2) {
7860
+ const blob = new Blob([buffer2]);
7861
+ const imageBitmap = await createImageBitmap(blob);
7862
+ let canvas;
7863
+ if (typeof document !== "undefined") {
7864
+ canvas = document.createElement("canvas");
7865
+ canvas.width = imageBitmap.width;
7866
+ canvas.height = imageBitmap.height;
8286
7867
  } else {
8287
- if (doUse) {
8288
- if (self[UPDATE_AGE_ON_GET])
8289
- node.value.now = Date.now();
8290
- self[LRU_LIST].unshiftNode(node);
8291
- }
8292
- }
8293
- return hit.value;
8294
- }
8295
- };
8296
- var isStale = (self, hit) => {
8297
- if (!hit || !hit.maxAge && !self[MAX_AGE])
8298
- return false;
8299
- const diff = Date.now() - hit.now;
8300
- return hit.maxAge ? diff > hit.maxAge : self[MAX_AGE] && diff > self[MAX_AGE];
8301
- };
8302
- var trim = (self) => {
8303
- if (self[LENGTH2] > self[MAX]) {
8304
- for (let walker = self[LRU_LIST].tail; self[LENGTH2] > self[MAX] && walker !== null; ) {
8305
- const prev = walker.prev;
8306
- del(self, walker);
8307
- walker = prev;
7868
+ canvas = new OffscreenCanvas(imageBitmap.width, imageBitmap.height);
8308
7869
  }
7870
+ const ctx = canvas.getContext("2d");
7871
+ ctx.drawImage(imageBitmap, 0, 0);
7872
+ return ctx.getImageData(0, 0, imageBitmap.width, imageBitmap.height).data.buffer;
8309
7873
  }
8310
7874
  };
8311
- var del = (self, node) => {
8312
- if (node) {
8313
- const hit = node.value;
8314
- if (self[DISPOSE])
8315
- self[DISPOSE](hit.key, hit.value);
8316
- self[LENGTH2] -= hit.length;
8317
- self[CACHE].delete(hit.key);
8318
- self[LRU_LIST].removeNode(node);
8319
- }
8320
- };
8321
- var Entry = class {
8322
- constructor(key, value, length, now, maxAge) {
8323
- this.key = key;
8324
- this.value = value;
8325
- this.length = length;
8326
- this.now = now;
8327
- this.maxAge = maxAge || 0;
8328
- }
8329
- };
8330
- var forEachStep = (self, fn, node, thisp) => {
8331
- let hit = node.value;
8332
- if (isStale(self, hit)) {
8333
- del(self, node);
8334
- if (!self[ALLOW_STALE])
8335
- hit = void 0;
8336
- }
8337
- if (hit)
8338
- fn.call(thisp, hit.value, hit.key, self);
8339
- };
8340
- module.exports = LRUCache2;
8341
7875
  }
8342
7876
  });
8343
7877
 
@@ -10077,7 +9611,8 @@ var __exports__ = (() => {
10077
9611
  // src/index.ts
10078
9612
  var src_exports = {};
10079
9613
  __export(src_exports, {
10080
- TiffPixelSource: () => tiff_pixel_source_default,
9614
+ GeoTIFFLoader: () => GeoTIFFLoader,
9615
+ TiffPixelSource: () => TiffPixelSource,
10081
9616
  loadGeoTiff: () => loadGeoTiff
10082
9617
  });
10083
9618
 
@@ -10312,17 +9847,14 @@ var __exports__ = (() => {
10312
9847
  return convertToNumber(DataViewPrototypeGetUint16(dataView, byteOffset, ...safeIfNeeded(opts)));
10313
9848
  }
10314
9849
 
10315
- // ../../node_modules/geotiff/src/geotiffimage.js
10316
- var import_get_attribute = __toESM(require_get_attribute());
10317
- var import_find_tags_by_name = __toESM(require_find_tags_by_name());
9850
+ // ../../node_modules/geotiff/dist-module/geotiffimage.js
9851
+ var import_get_attribute = __toESM(require_get_attribute(), 1);
9852
+ var import_find_tags_by_name = __toESM(require_find_tags_by_name(), 1);
10318
9853
  init_globals();
10319
9854
 
10320
- // ../../node_modules/geotiff/src/rgb.js
9855
+ // ../../node_modules/geotiff/dist-module/rgb.js
10321
9856
  function fromWhiteIsZero(raster, max) {
10322
- const {
10323
- width,
10324
- height
10325
- } = raster;
9857
+ const { width, height } = raster;
10326
9858
  const rgbRaster = new Uint8Array(width * height * 3);
10327
9859
  let value;
10328
9860
  for (let i = 0, j = 0; i < raster.length; ++i, j += 3) {
@@ -10334,10 +9866,7 @@ var __exports__ = (() => {
10334
9866
  return rgbRaster;
10335
9867
  }
10336
9868
  function fromBlackIsZero(raster, max) {
10337
- const {
10338
- width,
10339
- height
10340
- } = raster;
9869
+ const { width, height } = raster;
10341
9870
  const rgbRaster = new Uint8Array(width * height * 3);
10342
9871
  let value;
10343
9872
  for (let i = 0, j = 0; i < raster.length; ++i, j += 3) {
@@ -10349,10 +9878,7 @@ var __exports__ = (() => {
10349
9878
  return rgbRaster;
10350
9879
  }
10351
9880
  function fromPalette(raster, colorMap) {
10352
- const {
10353
- width,
10354
- height
10355
- } = raster;
9881
+ const { width, height } = raster;
10356
9882
  const rgbRaster = new Uint8Array(width * height * 3);
10357
9883
  const greenOffset = colorMap.length / 3;
10358
9884
  const blueOffset = colorMap.length / 3 * 2;
@@ -10365,10 +9891,7 @@ var __exports__ = (() => {
10365
9891
  return rgbRaster;
10366
9892
  }
10367
9893
  function fromCMYK(cmykRaster) {
10368
- const {
10369
- width,
10370
- height
10371
- } = cmykRaster;
9894
+ const { width, height } = cmykRaster;
10372
9895
  const rgbRaster = new Uint8Array(width * height * 3);
10373
9896
  for (let i = 0, j = 0; i < cmykRaster.length; i += 4, j += 3) {
10374
9897
  const c = cmykRaster[i];
@@ -10382,10 +9905,7 @@ var __exports__ = (() => {
10382
9905
  return rgbRaster;
10383
9906
  }
10384
9907
  function fromYCbCr(yCbCrRaster) {
10385
- const {
10386
- width,
10387
- height
10388
- } = yCbCrRaster;
9908
+ const { width, height } = yCbCrRaster;
10389
9909
  const rgbRaster = new Uint8ClampedArray(width * height * 3);
10390
9910
  for (let i = 0, j = 0; i < yCbCrRaster.length; i += 3, j += 3) {
10391
9911
  const y = yCbCrRaster[i];
@@ -10401,10 +9921,7 @@ var __exports__ = (() => {
10401
9921
  var Yn = 1;
10402
9922
  var Zn = 1.08883;
10403
9923
  function fromCIELab(cieLabRaster) {
10404
- const {
10405
- width,
10406
- height
10407
- } = cieLabRaster;
9924
+ const { width, height } = cieLabRaster;
10408
9925
  const rgbRaster = new Uint8Array(width * height * 3);
10409
9926
  for (let i = 0, j = 0; i < cieLabRaster.length; i += 3, j += 3) {
10410
9927
  const L = cieLabRaster[i + 0];
@@ -10432,7 +9949,7 @@ var __exports__ = (() => {
10432
9949
  return rgbRaster;
10433
9950
  }
10434
9951
 
10435
- // ../../node_modules/geotiff/src/compression/index.js
9952
+ // ../../node_modules/geotiff/dist-module/compression/index.js
10436
9953
  var registry = /* @__PURE__ */ new Map();
10437
9954
  function addDecoder(cases, importFn) {
10438
9955
  if (!Array.isArray(cases)) {
@@ -10456,9 +9973,16 @@ var __exports__ = (() => {
10456
9973
  addDecoder(7, () => Promise.resolve().then(() => (init_jpeg(), jpeg_exports)).then((m) => m.default));
10457
9974
  addDecoder([8, 32946], () => Promise.resolve().then(() => (init_deflate(), deflate_exports)).then((m) => m.default));
10458
9975
  addDecoder(32773, () => Promise.resolve().then(() => (init_packbits(), packbits_exports)).then((m) => m.default));
10459
- addDecoder(34887, () => Promise.resolve().then(() => (init_lerc(), lerc_exports)).then((m) => m.default));
9976
+ addDecoder(
9977
+ 34887,
9978
+ () => Promise.resolve().then(() => (init_lerc(), lerc_exports)).then(async (m) => {
9979
+ await m.zstd.init();
9980
+ return m;
9981
+ }).then((m) => m.default)
9982
+ );
9983
+ addDecoder(50001, () => Promise.resolve().then(() => (init_webimage(), webimage_exports)).then((m) => m.default));
10460
9984
 
10461
- // ../../node_modules/geotiff/src/resample.js
9985
+ // ../../node_modules/geotiff/dist-module/resample.js
10462
9986
  function copyNewSize(array, width, height, samplesPerPixel = 1) {
10463
9987
  return new (Object.getPrototypeOf(array)).constructor(width * height * samplesPerPixel);
10464
9988
  }
@@ -10499,7 +10023,11 @@ var __exports__ = (() => {
10499
10023
  const hl = array[yl * inWidth + xh];
10500
10024
  const lh = array[yh * inWidth + xl];
10501
10025
  const hh = array[yh * inWidth + xh];
10502
- const value = lerp(lerp(ll, hl, tx), lerp(lh, hh, tx), rawY % 1);
10026
+ const value = lerp(
10027
+ lerp(ll, hl, tx),
10028
+ lerp(lh, hh, tx),
10029
+ rawY % 1
10030
+ );
10503
10031
  newArray[y * outWidth + x] = value;
10504
10032
  }
10505
10033
  }
@@ -10551,7 +10079,11 @@ var __exports__ = (() => {
10551
10079
  const hl = valueArray[yl * inWidth * samples + xh * samples + i];
10552
10080
  const lh = valueArray[yh * inWidth * samples + xl * samples + i];
10553
10081
  const hh = valueArray[yh * inWidth * samples + xh * samples + i];
10554
- const value = lerp(lerp(ll, hl, tx), lerp(lh, hh, tx), rawY % 1);
10082
+ const value = lerp(
10083
+ lerp(ll, hl, tx),
10084
+ lerp(lh, hh, tx),
10085
+ rawY % 1
10086
+ );
10555
10087
  newArray[y * outWidth * samples + x * samples + i] = value;
10556
10088
  }
10557
10089
  }
@@ -10561,16 +10093,30 @@ var __exports__ = (() => {
10561
10093
  function resampleInterleaved(valueArray, inWidth, inHeight, outWidth, outHeight, samples, method = "nearest") {
10562
10094
  switch (method.toLowerCase()) {
10563
10095
  case "nearest":
10564
- return resampleNearestInterleaved(valueArray, inWidth, inHeight, outWidth, outHeight, samples);
10096
+ return resampleNearestInterleaved(
10097
+ valueArray,
10098
+ inWidth,
10099
+ inHeight,
10100
+ outWidth,
10101
+ outHeight,
10102
+ samples
10103
+ );
10565
10104
  case "bilinear":
10566
10105
  case "linear":
10567
- return resampleBilinearInterleaved(valueArray, inWidth, inHeight, outWidth, outHeight, samples);
10106
+ return resampleBilinearInterleaved(
10107
+ valueArray,
10108
+ inWidth,
10109
+ inHeight,
10110
+ outWidth,
10111
+ outHeight,
10112
+ samples
10113
+ );
10568
10114
  default:
10569
10115
  throw new Error(`Unsupported resampling method: '${method}'`);
10570
10116
  }
10571
10117
  }
10572
10118
 
10573
- // ../../node_modules/geotiff/src/geotiffimage.js
10119
+ // ../../node_modules/geotiff/dist-module/geotiffimage.js
10574
10120
  function sum(array, start, end) {
10575
10121
  let s = 0;
10576
10122
  for (let i = start; i < end; ++i) {
@@ -10666,6 +10212,15 @@ var __exports__ = (() => {
10666
10212
  return outArray.buffer;
10667
10213
  }
10668
10214
  var GeoTIFFImage = class {
10215
+ /**
10216
+ * @constructor
10217
+ * @param {Object} fileDirectory The parsed file directory
10218
+ * @param {Object} geoKeys The parsed geo-keys
10219
+ * @param {DataView} dataView The DataView for the underlying file.
10220
+ * @param {Boolean} littleEndian Whether the file is encoded in little or big endian
10221
+ * @param {Boolean} cache Whether or not decoded tiles shall be cached
10222
+ * @param {import('./source/basesource').BaseSource} source The datasource to read from
10223
+ */
10669
10224
  constructor(fileDirectory, geoKeys2, dataView, littleEndian, cache, source) {
10670
10225
  this.fileDirectory = fileDirectory;
10671
10226
  this.geoKeys = geoKeys2;
@@ -10680,24 +10235,52 @@ var __exports__ = (() => {
10680
10235
  }
10681
10236
  this.source = source;
10682
10237
  }
10238
+ /**
10239
+ * Returns the associated parsed file directory.
10240
+ * @returns {Object} the parsed file directory
10241
+ */
10683
10242
  getFileDirectory() {
10684
10243
  return this.fileDirectory;
10685
10244
  }
10245
+ /**
10246
+ * Returns the associated parsed geo keys.
10247
+ * @returns {Object} the parsed geo keys
10248
+ */
10686
10249
  getGeoKeys() {
10687
10250
  return this.geoKeys;
10688
10251
  }
10252
+ /**
10253
+ * Returns the width of the image.
10254
+ * @returns {Number} the width of the image
10255
+ */
10689
10256
  getWidth() {
10690
10257
  return this.fileDirectory.ImageWidth;
10691
10258
  }
10259
+ /**
10260
+ * Returns the height of the image.
10261
+ * @returns {Number} the height of the image
10262
+ */
10692
10263
  getHeight() {
10693
10264
  return this.fileDirectory.ImageLength;
10694
10265
  }
10266
+ /**
10267
+ * Returns the number of samples per pixel.
10268
+ * @returns {Number} the number of samples per pixel
10269
+ */
10695
10270
  getSamplesPerPixel() {
10696
10271
  return typeof this.fileDirectory.SamplesPerPixel !== "undefined" ? this.fileDirectory.SamplesPerPixel : 1;
10697
10272
  }
10273
+ /**
10274
+ * Returns the width of each tile.
10275
+ * @returns {Number} the width of each tile
10276
+ */
10698
10277
  getTileWidth() {
10699
10278
  return this.isTiled ? this.fileDirectory.TileWidth : this.getWidth();
10700
10279
  }
10280
+ /**
10281
+ * Returns the height of each tile.
10282
+ * @returns {Number} the height of each tile
10283
+ */
10701
10284
  getTileHeight() {
10702
10285
  if (this.isTiled) {
10703
10286
  return this.fileDirectory.TileLength;
@@ -10717,6 +10300,11 @@ var __exports__ = (() => {
10717
10300
  return this.getHeight() - y * this.getTileHeight();
10718
10301
  }
10719
10302
  }
10303
+ /**
10304
+ * Calculates the number of bytes for each pixel across all samples. Only full
10305
+ * bytes are supported, an exception is thrown when this is not the case.
10306
+ * @returns {Number} the bytes per pixel
10307
+ */
10720
10308
  getBytesPerPixel() {
10721
10309
  let bytes = 0;
10722
10310
  for (let i = 0; i < this.fileDirectory.BitsPerSample.length; ++i) {
@@ -10782,13 +10370,21 @@ var __exports__ = (() => {
10782
10370
  const bitsPerSample = this.getBitsPerSample(sampleIndex);
10783
10371
  return arrayForType(format, bitsPerSample, size);
10784
10372
  }
10373
+ /**
10374
+ * Returns the decoded strip or tile.
10375
+ * @param {Number} x the strip or tile x-offset
10376
+ * @param {Number} y the tile y-offset (0 for stripped images)
10377
+ * @param {Number} sample the sample to get for separated samples
10378
+ * @param {import("./geotiff").Pool|import("./geotiff").BaseDecoder} poolOrDecoder the decoder or decoder pool
10379
+ * @param {AbortSignal} [signal] An AbortSignal that may be signalled if the request is
10380
+ * to be aborted
10381
+ * @returns {Promise.<ArrayBuffer>}
10382
+ */
10785
10383
  async getTileOrStrip(x, y, sample, poolOrDecoder, signal) {
10786
10384
  const numTilesPerRow = Math.ceil(this.getWidth() / this.getTileWidth());
10787
10385
  const numTilesPerCol = Math.ceil(this.getHeight() / this.getTileHeight());
10788
10386
  let index;
10789
- const {
10790
- tiles
10791
- } = this;
10387
+ const { tiles } = this;
10792
10388
  if (this.planarConfiguration === 1) {
10793
10389
  index = y * numTilesPerRow + x;
10794
10390
  } else if (this.planarConfiguration === 2) {
@@ -10803,10 +10399,7 @@ var __exports__ = (() => {
10803
10399
  offset = this.fileDirectory.StripOffsets[index];
10804
10400
  byteCount = this.fileDirectory.StripByteCounts[index];
10805
10401
  }
10806
- const slice = (await this.source.fetch([{
10807
- offset,
10808
- length: byteCount
10809
- }], signal))[0];
10402
+ const slice = (await this.source.fetch([{ offset, length: byteCount }], signal))[0];
10810
10403
  let request;
10811
10404
  if (tiles === null || !tiles[index]) {
10812
10405
  request = (async () => {
@@ -10814,7 +10407,15 @@ var __exports__ = (() => {
10814
10407
  const sampleFormat = this.getSampleFormat();
10815
10408
  const bitsPerSample = this.getBitsPerSample();
10816
10409
  if (needsNormalization(sampleFormat, bitsPerSample)) {
10817
- data = normalizeArray(data, sampleFormat, this.planarConfiguration, this.getSamplesPerPixel(), bitsPerSample, this.getTileWidth(), this.getBlockHeight(y));
10410
+ data = normalizeArray(
10411
+ data,
10412
+ sampleFormat,
10413
+ this.planarConfiguration,
10414
+ this.getSamplesPerPixel(),
10415
+ bitsPerSample,
10416
+ this.getTileWidth(),
10417
+ this.getBlockHeight(y)
10418
+ );
10818
10419
  }
10819
10420
  return data;
10820
10421
  })();
@@ -10824,22 +10425,38 @@ var __exports__ = (() => {
10824
10425
  } else {
10825
10426
  request = tiles[index];
10826
10427
  }
10827
- return {
10828
- x,
10829
- y,
10830
- sample,
10831
- data: await request
10832
- };
10833
- }
10428
+ return { x, y, sample, data: await request };
10429
+ }
10430
+ /**
10431
+ * Internal read function.
10432
+ * @private
10433
+ * @param {Array} imageWindow The image window in pixel coordinates
10434
+ * @param {Array} samples The selected samples (0-based indices)
10435
+ * @param {TypedArray|TypedArray[]} valueArrays The array(s) to write into
10436
+ * @param {Boolean} interleave Whether or not to write in an interleaved manner
10437
+ * @param {import("./geotiff").Pool|AbstractDecoder} poolOrDecoder the decoder or decoder pool
10438
+ * @param {number} width the width of window to be read into
10439
+ * @param {number} height the height of window to be read into
10440
+ * @param {number} resampleMethod the resampling method to be used when interpolating
10441
+ * @param {AbortSignal} [signal] An AbortSignal that may be signalled if the request is
10442
+ * to be aborted
10443
+ * @returns {Promise<ReadRasterResult>}
10444
+ */
10834
10445
  async _readRaster(imageWindow, samples, valueArrays, interleave, poolOrDecoder, width, height, resampleMethod, signal) {
10835
10446
  const tileWidth = this.getTileWidth();
10836
10447
  const tileHeight = this.getTileHeight();
10837
10448
  const imageWidth = this.getWidth();
10838
10449
  const imageHeight = this.getHeight();
10839
10450
  const minXTile = Math.max(Math.floor(imageWindow[0] / tileWidth), 0);
10840
- const maxXTile = Math.min(Math.ceil(imageWindow[2] / tileWidth), Math.ceil(imageWidth / tileWidth));
10451
+ const maxXTile = Math.min(
10452
+ Math.ceil(imageWindow[2] / tileWidth),
10453
+ Math.ceil(imageWidth / tileWidth)
10454
+ );
10841
10455
  const minYTile = Math.max(Math.floor(imageWindow[1] / tileHeight), 0);
10842
- const maxYTile = Math.min(Math.ceil(imageWindow[3] / tileHeight), Math.ceil(imageHeight / tileHeight));
10456
+ const maxYTile = Math.min(
10457
+ Math.ceil(imageWindow[3] / tileHeight),
10458
+ Math.ceil(imageHeight / tileHeight)
10459
+ );
10843
10460
  const windowWidth = imageWindow[2] - imageWindow[0];
10844
10461
  let bytesPerPixel = this.getBytesPerPixel();
10845
10462
  const srcSampleOffsets = [];
@@ -10853,20 +10470,21 @@ var __exports__ = (() => {
10853
10470
  sampleReaders.push(this.getReaderForSample(samples[i]));
10854
10471
  }
10855
10472
  const promises = [];
10856
- const {
10857
- littleEndian
10858
- } = this;
10473
+ const { littleEndian } = this;
10859
10474
  for (let yTile = minYTile; yTile < maxYTile; ++yTile) {
10860
10475
  for (let xTile = minXTile; xTile < maxXTile; ++xTile) {
10476
+ let getPromise;
10477
+ if (this.planarConfiguration === 1) {
10478
+ getPromise = this.getTileOrStrip(xTile, yTile, 0, poolOrDecoder, signal);
10479
+ }
10861
10480
  for (let sampleIndex = 0; sampleIndex < samples.length; ++sampleIndex) {
10862
10481
  const si = sampleIndex;
10863
10482
  const sample = samples[sampleIndex];
10864
10483
  if (this.planarConfiguration === 2) {
10865
- bytesPerPixel = this.getSampleByteSize(sampleIndex);
10484
+ bytesPerPixel = this.getSampleByteSize(sample);
10485
+ getPromise = this.getTileOrStrip(xTile, yTile, sample, poolOrDecoder, signal);
10866
10486
  }
10867
- const promise = this.getTileOrStrip(xTile, yTile, sample, poolOrDecoder, signal);
10868
- promises.push(promise);
10869
- promise.then((tile) => {
10487
+ const promise = getPromise.then((tile) => {
10870
10488
  const buffer2 = tile.data;
10871
10489
  const dataView = new DataView(buffer2);
10872
10490
  const blockHeight = this.getBlockHeight(tile.y);
@@ -10880,7 +10498,11 @@ var __exports__ = (() => {
10880
10498
  for (let y = Math.max(0, imageWindow[1] - firstLine); y < ymax; ++y) {
10881
10499
  for (let x = Math.max(0, imageWindow[0] - firstCol); x < xmax; ++x) {
10882
10500
  const pixelOffset = (y * tileWidth + x) * bytesPerPixel;
10883
- const value = reader.call(dataView, pixelOffset + srcSampleOffsets[si], littleEndian);
10501
+ const value = reader.call(
10502
+ dataView,
10503
+ pixelOffset + srcSampleOffsets[si],
10504
+ littleEndian
10505
+ );
10884
10506
  let windowCoordinate;
10885
10507
  if (interleave) {
10886
10508
  windowCoordinate = (y + firstLine - imageWindow[1]) * windowWidth * samples.length + (x + firstCol - imageWindow[0]) * samples.length + si;
@@ -10892,6 +10514,7 @@ var __exports__ = (() => {
10892
10514
  }
10893
10515
  }
10894
10516
  });
10517
+ promises.push(promise);
10895
10518
  }
10896
10519
  }
10897
10520
  }
@@ -10899,9 +10522,24 @@ var __exports__ = (() => {
10899
10522
  if (width && imageWindow[2] - imageWindow[0] !== width || height && imageWindow[3] - imageWindow[1] !== height) {
10900
10523
  let resampled;
10901
10524
  if (interleave) {
10902
- resampled = resampleInterleaved(valueArrays, imageWindow[2] - imageWindow[0], imageWindow[3] - imageWindow[1], width, height, samples.length, resampleMethod);
10525
+ resampled = resampleInterleaved(
10526
+ valueArrays,
10527
+ imageWindow[2] - imageWindow[0],
10528
+ imageWindow[3] - imageWindow[1],
10529
+ width,
10530
+ height,
10531
+ samples.length,
10532
+ resampleMethod
10533
+ );
10903
10534
  } else {
10904
- resampled = resample(valueArrays, imageWindow[2] - imageWindow[0], imageWindow[3] - imageWindow[1], width, height, resampleMethod);
10535
+ resampled = resample(
10536
+ valueArrays,
10537
+ imageWindow[2] - imageWindow[0],
10538
+ imageWindow[3] - imageWindow[1],
10539
+ width,
10540
+ height,
10541
+ resampleMethod
10542
+ );
10905
10543
  }
10906
10544
  resampled.width = width;
10907
10545
  resampled.height = height;
@@ -10911,6 +10549,15 @@ var __exports__ = (() => {
10911
10549
  valueArrays.height = height || imageWindow[3] - imageWindow[1];
10912
10550
  return valueArrays;
10913
10551
  }
10552
+ /**
10553
+ * Reads raster data from the image. This function reads all selected samples
10554
+ * into separate arrays of the correct type for that sample or into a single
10555
+ * combined array when `interleave` is set. When provided, only a subset
10556
+ * of the raster is read for each sample.
10557
+ *
10558
+ * @param {ReadRasterOptions} [options={}] optional parameters
10559
+ * @returns {Promise<ReadRasterResult>} the decoded arrays as a promise
10560
+ */
10914
10561
  async readRasters({
10915
10562
  window: wnd,
10916
10563
  samples = [],
@@ -10962,9 +10609,43 @@ var __exports__ = (() => {
10962
10609
  }
10963
10610
  }
10964
10611
  const poolOrDecoder = pool || await getDecoder(this.fileDirectory);
10965
- const result = await this._readRaster(imageWindow, samples, valueArrays, interleave, poolOrDecoder, width, height, resampleMethod, signal);
10612
+ const result = await this._readRaster(
10613
+ imageWindow,
10614
+ samples,
10615
+ valueArrays,
10616
+ interleave,
10617
+ poolOrDecoder,
10618
+ width,
10619
+ height,
10620
+ resampleMethod,
10621
+ signal
10622
+ );
10966
10623
  return result;
10967
10624
  }
10625
+ /**
10626
+ * Reads raster data from the image as RGB. The result is always an
10627
+ * interleaved typed array.
10628
+ * Colorspaces other than RGB will be transformed to RGB, color maps expanded.
10629
+ * When no other method is applicable, the first sample is used to produce a
10630
+ * grayscale image.
10631
+ * When provided, only a subset of the raster is read for each sample.
10632
+ *
10633
+ * @param {Object} [options] optional parameters
10634
+ * @param {Array<number>} [options.window] the subset to read data from in pixels.
10635
+ * @param {boolean} [options.interleave=true] whether the data shall be read
10636
+ * in one single array or separate
10637
+ * arrays.
10638
+ * @param {import("./geotiff").Pool} [options.pool=null] The optional decoder pool to use.
10639
+ * @param {number} [options.width] The desired width of the output. When the width is no the
10640
+ * same as the images, resampling will be performed.
10641
+ * @param {number} [options.height] The desired height of the output. When the width is no the
10642
+ * same as the images, resampling will be performed.
10643
+ * @param {string} [options.resampleMethod='nearest'] The desired resampling method.
10644
+ * @param {boolean} [options.enableAlpha=false] Enable reading alpha channel if present.
10645
+ * @param {AbortSignal} [options.signal] An AbortSignal that may be signalled if the request is
10646
+ * to be aborted
10647
+ * @returns {Promise<ReadRasterResult>} the RGB array as a Promise
10648
+ */
10968
10649
  async readRGB({
10969
10650
  window: window2,
10970
10651
  interleave = true,
@@ -11026,9 +10707,7 @@ var __exports__ = (() => {
11026
10707
  resampleMethod,
11027
10708
  signal
11028
10709
  };
11029
- const {
11030
- fileDirectory
11031
- } = this;
10710
+ const { fileDirectory } = this;
11032
10711
  const raster = await this.readRasters(subOptions);
11033
10712
  const max = 2 ** this.fileDirectory.BitsPerSample[0];
11034
10713
  let data;
@@ -11069,6 +10748,10 @@ var __exports__ = (() => {
11069
10748
  data.height = raster.height;
11070
10749
  return data;
11071
10750
  }
10751
+ /**
10752
+ * Returns an array of tiepoints.
10753
+ * @returns {Object[]}
10754
+ */
11072
10755
  getTiePoints() {
11073
10756
  if (!this.fileDirectory.ModelTiepoint) {
11074
10757
  return [];
@@ -11086,6 +10769,15 @@ var __exports__ = (() => {
11086
10769
  }
11087
10770
  return tiePoints;
11088
10771
  }
10772
+ /**
10773
+ * Returns the parsed GDAL metadata items.
10774
+ *
10775
+ * If sample is passed to null, dataset-level metadata will be returned.
10776
+ * Otherwise only metadata specific to the provided sample will be returned.
10777
+ *
10778
+ * @param {number} [sample=null] The sample index.
10779
+ * @returns {Object}
10780
+ */
11089
10781
  getGDALMetadata(sample = null) {
11090
10782
  const metadata = {};
11091
10783
  if (!this.fileDirectory.GDAL_METADATA) {
@@ -11093,7 +10785,9 @@ var __exports__ = (() => {
11093
10785
  }
11094
10786
  const string = this.fileDirectory.GDAL_METADATA;
11095
10787
  let items = (0, import_find_tags_by_name.default)(string, "Item");
11096
- if (sample !== null) {
10788
+ if (sample === null) {
10789
+ items = items.filter((item) => (0, import_get_attribute.default)(item, "sample") === void 0);
10790
+ } else {
11097
10791
  items = items.filter((item) => Number((0, import_get_attribute.default)(item, "sample")) === sample);
11098
10792
  }
11099
10793
  for (let i = 0; i < items.length; ++i) {
@@ -11102,6 +10796,10 @@ var __exports__ = (() => {
11102
10796
  }
11103
10797
  return metadata;
11104
10798
  }
10799
+ /**
10800
+ * Returns the GDAL nodata value
10801
+ * @returns {number|null}
10802
+ */
11105
10803
  getGDALNoData() {
11106
10804
  if (!this.fileDirectory.GDAL_NODATA) {
11107
10805
  return null;
@@ -11109,48 +10807,120 @@ var __exports__ = (() => {
11109
10807
  const string = this.fileDirectory.GDAL_NODATA;
11110
10808
  return Number(string.substring(0, string.length - 1));
11111
10809
  }
10810
+ /**
10811
+ * Returns the image origin as a XYZ-vector. When the image has no affine
10812
+ * transformation, then an exception is thrown.
10813
+ * @returns {Array<number>} The origin as a vector
10814
+ */
11112
10815
  getOrigin() {
11113
10816
  const tiePoints = this.fileDirectory.ModelTiepoint;
11114
10817
  const modelTransformation = this.fileDirectory.ModelTransformation;
11115
10818
  if (tiePoints && tiePoints.length === 6) {
11116
- return [tiePoints[3], tiePoints[4], tiePoints[5]];
10819
+ return [
10820
+ tiePoints[3],
10821
+ tiePoints[4],
10822
+ tiePoints[5]
10823
+ ];
11117
10824
  }
11118
10825
  if (modelTransformation) {
11119
- return [modelTransformation[3], modelTransformation[7], modelTransformation[11]];
10826
+ return [
10827
+ modelTransformation[3],
10828
+ modelTransformation[7],
10829
+ modelTransformation[11]
10830
+ ];
11120
10831
  }
11121
10832
  throw new Error("The image does not have an affine transformation.");
11122
10833
  }
10834
+ /**
10835
+ * Returns the image resolution as a XYZ-vector. When the image has no affine
10836
+ * transformation, then an exception is thrown.
10837
+ * @param {GeoTIFFImage} [referenceImage=null] A reference image to calculate the resolution from
10838
+ * in cases when the current image does not have the
10839
+ * required tags on its own.
10840
+ * @returns {Array<number>} The resolution as a vector
10841
+ */
11123
10842
  getResolution(referenceImage = null) {
11124
10843
  const modelPixelScale = this.fileDirectory.ModelPixelScale;
11125
10844
  const modelTransformation = this.fileDirectory.ModelTransformation;
11126
10845
  if (modelPixelScale) {
11127
- return [modelPixelScale[0], -modelPixelScale[1], modelPixelScale[2]];
10846
+ return [
10847
+ modelPixelScale[0],
10848
+ -modelPixelScale[1],
10849
+ modelPixelScale[2]
10850
+ ];
11128
10851
  }
11129
10852
  if (modelTransformation) {
11130
- return [modelTransformation[0], modelTransformation[5], modelTransformation[10]];
10853
+ return [
10854
+ modelTransformation[0],
10855
+ -modelTransformation[5],
10856
+ modelTransformation[10]
10857
+ ];
11131
10858
  }
11132
10859
  if (referenceImage) {
11133
10860
  const [refResX, refResY, refResZ] = referenceImage.getResolution();
11134
- return [refResX * referenceImage.getWidth() / this.getWidth(), refResY * referenceImage.getHeight() / this.getHeight(), refResZ * referenceImage.getWidth() / this.getWidth()];
10861
+ return [
10862
+ refResX * referenceImage.getWidth() / this.getWidth(),
10863
+ refResY * referenceImage.getHeight() / this.getHeight(),
10864
+ refResZ * referenceImage.getWidth() / this.getWidth()
10865
+ ];
11135
10866
  }
11136
10867
  throw new Error("The image does not have an affine transformation.");
11137
10868
  }
10869
+ /**
10870
+ * Returns whether or not the pixels of the image depict an area (or point).
10871
+ * @returns {Boolean} Whether the pixels are a point
10872
+ */
11138
10873
  pixelIsArea() {
11139
10874
  return this.geoKeys.GTRasterTypeGeoKey === 1;
11140
10875
  }
10876
+ /**
10877
+ * Returns the image bounding box as an array of 4 values: min-x, min-y,
10878
+ * max-x and max-y. When the image has no affine transformation, then an
10879
+ * exception is thrown.
10880
+ * @returns {Array<number>} The bounding box
10881
+ */
11141
10882
  getBoundingBox() {
11142
- const origin = this.getOrigin();
11143
- const resolution = this.getResolution();
11144
- const x1 = origin[0];
11145
- const y1 = origin[1];
11146
- const x2 = x1 + resolution[0] * this.getWidth();
11147
- const y2 = y1 + resolution[1] * this.getHeight();
11148
- return [Math.min(x1, x2), Math.min(y1, y2), Math.max(x1, x2), Math.max(y1, y2)];
10883
+ const height = this.getHeight();
10884
+ const width = this.getWidth();
10885
+ if (this.fileDirectory.ModelTransformation) {
10886
+ const [a, b, c, d, e, f, g, h] = this.fileDirectory.ModelTransformation;
10887
+ const corners = [
10888
+ [0, 0],
10889
+ [0, height],
10890
+ [width, 0],
10891
+ [width, height]
10892
+ ];
10893
+ const projected = corners.map(([I, J]) => [
10894
+ d + a * I + b * J,
10895
+ h + e * I + f * J
10896
+ ]);
10897
+ const xs = projected.map((pt) => pt[0]);
10898
+ const ys = projected.map((pt) => pt[1]);
10899
+ return [
10900
+ Math.min(...xs),
10901
+ Math.min(...ys),
10902
+ Math.max(...xs),
10903
+ Math.max(...ys)
10904
+ ];
10905
+ } else {
10906
+ const origin = this.getOrigin();
10907
+ const resolution = this.getResolution();
10908
+ const x1 = origin[0];
10909
+ const y1 = origin[1];
10910
+ const x2 = x1 + resolution[0] * this.getWidth();
10911
+ const y2 = y1 + resolution[1] * this.getHeight();
10912
+ return [
10913
+ Math.min(x1, x2),
10914
+ Math.min(y1, y2),
10915
+ Math.max(x1, x2),
10916
+ Math.max(y1, y2)
10917
+ ];
10918
+ }
11149
10919
  }
11150
10920
  };
11151
10921
  var geotiffimage_default = GeoTIFFImage;
11152
10922
 
11153
- // ../../node_modules/geotiff/src/dataview64.js
10923
+ // ../../node_modules/geotiff/dist-module/dataview64.js
11154
10924
  var DataView64 = class {
11155
10925
  constructor(arrayBuffer) {
11156
10926
  this._dataView = new DataView(arrayBuffer);
@@ -11165,16 +10935,21 @@ var __exports__ = (() => {
11165
10935
  if (littleEndian) {
11166
10936
  combined = left + 2 ** 32 * right;
11167
10937
  if (!Number.isSafeInteger(combined)) {
11168
- throw new Error(`${combined} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);
10938
+ throw new Error(
10939
+ `${combined} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`
10940
+ );
11169
10941
  }
11170
10942
  return combined;
11171
10943
  }
11172
10944
  combined = 2 ** 32 * left + right;
11173
10945
  if (!Number.isSafeInteger(combined)) {
11174
- throw new Error(`${combined} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);
10946
+ throw new Error(
10947
+ `${combined} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`
10948
+ );
11175
10949
  }
11176
10950
  return combined;
11177
10951
  }
10952
+ // adapted from https://stackoverflow.com/a/55338384/8060591
11178
10953
  getInt64(offset, littleEndian) {
11179
10954
  let value = 0;
11180
10955
  const isNegative = (this._dataView.getUint8(offset + (littleEndian ? 7 : 0)) & 128) > 0;
@@ -11227,7 +11002,7 @@ var __exports__ = (() => {
11227
11002
  }
11228
11003
  };
11229
11004
 
11230
- // ../../node_modules/geotiff/src/dataslice.js
11005
+ // ../../node_modules/geotiff/dist-module/dataslice.js
11231
11006
  var DataSlice = class {
11232
11007
  constructor(arrayBuffer, sliceOffset, littleEndian, bigTiff) {
11233
11008
  this._dataView = new DataView(arrayBuffer);
@@ -11254,28 +11029,52 @@ var __exports__ = (() => {
11254
11029
  return this.sliceOffset <= offset && this.sliceTop >= offset + length;
11255
11030
  }
11256
11031
  readUint8(offset) {
11257
- return this._dataView.getUint8(offset - this._sliceOffset, this._littleEndian);
11032
+ return this._dataView.getUint8(
11033
+ offset - this._sliceOffset,
11034
+ this._littleEndian
11035
+ );
11258
11036
  }
11259
11037
  readInt8(offset) {
11260
- return this._dataView.getInt8(offset - this._sliceOffset, this._littleEndian);
11038
+ return this._dataView.getInt8(
11039
+ offset - this._sliceOffset,
11040
+ this._littleEndian
11041
+ );
11261
11042
  }
11262
11043
  readUint16(offset) {
11263
- return this._dataView.getUint16(offset - this._sliceOffset, this._littleEndian);
11044
+ return this._dataView.getUint16(
11045
+ offset - this._sliceOffset,
11046
+ this._littleEndian
11047
+ );
11264
11048
  }
11265
11049
  readInt16(offset) {
11266
- return this._dataView.getInt16(offset - this._sliceOffset, this._littleEndian);
11050
+ return this._dataView.getInt16(
11051
+ offset - this._sliceOffset,
11052
+ this._littleEndian
11053
+ );
11267
11054
  }
11268
11055
  readUint32(offset) {
11269
- return this._dataView.getUint32(offset - this._sliceOffset, this._littleEndian);
11056
+ return this._dataView.getUint32(
11057
+ offset - this._sliceOffset,
11058
+ this._littleEndian
11059
+ );
11270
11060
  }
11271
11061
  readInt32(offset) {
11272
- return this._dataView.getInt32(offset - this._sliceOffset, this._littleEndian);
11062
+ return this._dataView.getInt32(
11063
+ offset - this._sliceOffset,
11064
+ this._littleEndian
11065
+ );
11273
11066
  }
11274
11067
  readFloat32(offset) {
11275
- return this._dataView.getFloat32(offset - this._sliceOffset, this._littleEndian);
11068
+ return this._dataView.getFloat32(
11069
+ offset - this._sliceOffset,
11070
+ this._littleEndian
11071
+ );
11276
11072
  }
11277
11073
  readFloat64(offset) {
11278
- return this._dataView.getFloat64(offset - this._sliceOffset, this._littleEndian);
11074
+ return this._dataView.getFloat64(
11075
+ offset - this._sliceOffset,
11076
+ this._littleEndian
11077
+ );
11279
11078
  }
11280
11079
  readUint64(offset) {
11281
11080
  const left = this.readUint32(offset);
@@ -11284,22 +11083,29 @@ var __exports__ = (() => {
11284
11083
  if (this._littleEndian) {
11285
11084
  combined = left + 2 ** 32 * right;
11286
11085
  if (!Number.isSafeInteger(combined)) {
11287
- throw new Error(`${combined} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);
11086
+ throw new Error(
11087
+ `${combined} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`
11088
+ );
11288
11089
  }
11289
11090
  return combined;
11290
11091
  }
11291
11092
  combined = 2 ** 32 * left + right;
11292
11093
  if (!Number.isSafeInteger(combined)) {
11293
- throw new Error(`${combined} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);
11094
+ throw new Error(
11095
+ `${combined} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`
11096
+ );
11294
11097
  }
11295
11098
  return combined;
11296
11099
  }
11100
+ // adapted from https://stackoverflow.com/a/55338384/8060591
11297
11101
  readInt64(offset) {
11298
11102
  let value = 0;
11299
11103
  const isNegative = (this._dataView.getUint8(offset + (this._littleEndian ? 7 : 0)) & 128) > 0;
11300
11104
  let carrying = true;
11301
11105
  for (let i = 0; i < 8; i++) {
11302
- let byte = this._dataView.getUint8(offset + (this._littleEndian ? i : 7 - i));
11106
+ let byte = this._dataView.getUint8(
11107
+ offset + (this._littleEndian ? i : 7 - i)
11108
+ );
11303
11109
  if (isNegative) {
11304
11110
  if (carrying) {
11305
11111
  if (byte !== 0) {
@@ -11325,7 +11131,7 @@ var __exports__ = (() => {
11325
11131
  }
11326
11132
  };
11327
11133
 
11328
- // ../../node_modules/geotiff/src/source/httputils.js
11134
+ // ../../node_modules/geotiff/dist-module/source/httputils.js
11329
11135
  var CRLFCRLF = "\r\n\r\n";
11330
11136
  function itemsToObject(items) {
11331
11137
  if (typeof Object.fromEntries !== "undefined") {
@@ -11348,10 +11154,7 @@ var __exports__ = (() => {
11348
11154
  function parseContentType(rawContentType) {
11349
11155
  const [type, ...rawParams] = rawContentType.split(";").map((s) => s.trim());
11350
11156
  const paramsItems = rawParams.map((param) => param.split("="));
11351
- return {
11352
- type,
11353
- params: itemsToObject(paramsItems)
11354
- };
11157
+ return { type, params: itemsToObject(paramsItems) };
11355
11158
  }
11356
11159
  function parseContentRange(rawContentRange) {
11357
11160
  let start;
@@ -11363,11 +11166,7 @@ var __exports__ = (() => {
11363
11166
  end = parseInt(end, 10);
11364
11167
  total = parseInt(total, 10);
11365
11168
  }
11366
- return {
11367
- start,
11368
- end,
11369
- total
11370
- };
11169
+ return { start, end, total };
11371
11170
  }
11372
11171
  function parseByteRanges(responseArrayBuffer, boundary) {
11373
11172
  let offset = null;
@@ -11376,7 +11175,9 @@ var __exports__ = (() => {
11376
11175
  const startBoundary = `--${boundary}`;
11377
11176
  const endBoundary = `${startBoundary}--`;
11378
11177
  for (let i = 0; i < 10; ++i) {
11379
- const text = decoder.decode(new Uint8Array(responseArrayBuffer, i, startBoundary.length));
11178
+ const text = decoder.decode(
11179
+ new Uint8Array(responseArrayBuffer, i, startBoundary.length)
11180
+ );
11380
11181
  if (text === startBoundary) {
11381
11182
  offset = i;
11382
11183
  }
@@ -11385,7 +11186,13 @@ var __exports__ = (() => {
11385
11186
  throw new Error("Could not find initial boundary");
11386
11187
  }
11387
11188
  while (offset < responseArrayBuffer.byteLength) {
11388
- const text = decoder.decode(new Uint8Array(responseArrayBuffer, offset, Math.min(startBoundary.length + 1024, responseArrayBuffer.byteLength - offset)));
11189
+ const text = decoder.decode(
11190
+ new Uint8Array(
11191
+ responseArrayBuffer,
11192
+ offset,
11193
+ Math.min(startBoundary.length + 1024, responseArrayBuffer.byteLength - offset)
11194
+ )
11195
+ );
11389
11196
  if (text.length === 0 || text.startsWith(endBoundary)) {
11390
11197
  break;
11391
11198
  }
@@ -11398,11 +11205,7 @@ var __exports__ = (() => {
11398
11205
  }
11399
11206
  const endOfHeaders = innerText.indexOf(CRLFCRLF);
11400
11207
  const headers = parseHeaders(innerText.substr(0, endOfHeaders));
11401
- const {
11402
- start,
11403
- end,
11404
- total
11405
- } = parseContentRange(headers["content-range"]);
11208
+ const { start, end, total } = parseContentRange(headers["content-range"]);
11406
11209
  const startOfData = offset + startBoundary.length + endOfHeaders + CRLFCRLF.length;
11407
11210
  const length = parseInt(end, 10) + 1 - parseInt(start, 10);
11408
11211
  out.push({
@@ -11417,14 +11220,29 @@ var __exports__ = (() => {
11417
11220
  return out;
11418
11221
  }
11419
11222
 
11420
- // ../../node_modules/geotiff/src/source/basesource.js
11223
+ // ../../node_modules/geotiff/dist-module/source/basesource.js
11421
11224
  var BaseSource = class {
11225
+ /**
11226
+ *
11227
+ * @param {Slice[]} slices
11228
+ * @returns {ArrayBuffer[]}
11229
+ */
11422
11230
  async fetch(slices, signal = void 0) {
11423
- return Promise.all(slices.map((slice) => this.fetchSlice(slice, signal)));
11424
- }
11231
+ return Promise.all(
11232
+ slices.map((slice) => this.fetchSlice(slice, signal))
11233
+ );
11234
+ }
11235
+ /**
11236
+ *
11237
+ * @param {Slice} slice
11238
+ * @returns {ArrayBuffer}
11239
+ */
11425
11240
  async fetchSlice(slice) {
11426
11241
  throw new Error(`fetching of slice ${slice} not possible, not implemented`);
11427
11242
  }
11243
+ /**
11244
+ * Returns the filesize if already determined and null otherwise
11245
+ */
11428
11246
  get fileSize() {
11429
11247
  return null;
11430
11248
  }
@@ -11432,10 +11250,241 @@ var __exports__ = (() => {
11432
11250
  }
11433
11251
  };
11434
11252
 
11435
- // ../../node_modules/geotiff/src/source/blockedsource.js
11436
- var import_lru_cache = __toESM(require_lru_cache());
11253
+ // ../../node_modules/geotiff/node_modules/quick-lru/index.js
11254
+ var QuickLRU = class extends Map {
11255
+ constructor(options = {}) {
11256
+ super();
11257
+ if (!(options.maxSize && options.maxSize > 0)) {
11258
+ throw new TypeError("`maxSize` must be a number greater than 0");
11259
+ }
11260
+ if (typeof options.maxAge === "number" && options.maxAge === 0) {
11261
+ throw new TypeError("`maxAge` must be a number greater than 0");
11262
+ }
11263
+ this.maxSize = options.maxSize;
11264
+ this.maxAge = options.maxAge || Number.POSITIVE_INFINITY;
11265
+ this.onEviction = options.onEviction;
11266
+ this.cache = /* @__PURE__ */ new Map();
11267
+ this.oldCache = /* @__PURE__ */ new Map();
11268
+ this._size = 0;
11269
+ }
11270
+ // TODO: Use private class methods when targeting Node.js 16.
11271
+ _emitEvictions(cache) {
11272
+ if (typeof this.onEviction !== "function") {
11273
+ return;
11274
+ }
11275
+ for (const [key, item] of cache) {
11276
+ this.onEviction(key, item.value);
11277
+ }
11278
+ }
11279
+ _deleteIfExpired(key, item) {
11280
+ if (typeof item.expiry === "number" && item.expiry <= Date.now()) {
11281
+ if (typeof this.onEviction === "function") {
11282
+ this.onEviction(key, item.value);
11283
+ }
11284
+ return this.delete(key);
11285
+ }
11286
+ return false;
11287
+ }
11288
+ _getOrDeleteIfExpired(key, item) {
11289
+ const deleted = this._deleteIfExpired(key, item);
11290
+ if (deleted === false) {
11291
+ return item.value;
11292
+ }
11293
+ }
11294
+ _getItemValue(key, item) {
11295
+ return item.expiry ? this._getOrDeleteIfExpired(key, item) : item.value;
11296
+ }
11297
+ _peek(key, cache) {
11298
+ const item = cache.get(key);
11299
+ return this._getItemValue(key, item);
11300
+ }
11301
+ _set(key, value) {
11302
+ this.cache.set(key, value);
11303
+ this._size++;
11304
+ if (this._size >= this.maxSize) {
11305
+ this._size = 0;
11306
+ this._emitEvictions(this.oldCache);
11307
+ this.oldCache = this.cache;
11308
+ this.cache = /* @__PURE__ */ new Map();
11309
+ }
11310
+ }
11311
+ _moveToRecent(key, item) {
11312
+ this.oldCache.delete(key);
11313
+ this._set(key, item);
11314
+ }
11315
+ *_entriesAscending() {
11316
+ for (const item of this.oldCache) {
11317
+ const [key, value] = item;
11318
+ if (!this.cache.has(key)) {
11319
+ const deleted = this._deleteIfExpired(key, value);
11320
+ if (deleted === false) {
11321
+ yield item;
11322
+ }
11323
+ }
11324
+ }
11325
+ for (const item of this.cache) {
11326
+ const [key, value] = item;
11327
+ const deleted = this._deleteIfExpired(key, value);
11328
+ if (deleted === false) {
11329
+ yield item;
11330
+ }
11331
+ }
11332
+ }
11333
+ get(key) {
11334
+ if (this.cache.has(key)) {
11335
+ const item = this.cache.get(key);
11336
+ return this._getItemValue(key, item);
11337
+ }
11338
+ if (this.oldCache.has(key)) {
11339
+ const item = this.oldCache.get(key);
11340
+ if (this._deleteIfExpired(key, item) === false) {
11341
+ this._moveToRecent(key, item);
11342
+ return item.value;
11343
+ }
11344
+ }
11345
+ }
11346
+ set(key, value, { maxAge = this.maxAge } = {}) {
11347
+ const expiry = typeof maxAge === "number" && maxAge !== Number.POSITIVE_INFINITY ? Date.now() + maxAge : void 0;
11348
+ if (this.cache.has(key)) {
11349
+ this.cache.set(key, {
11350
+ value,
11351
+ expiry
11352
+ });
11353
+ } else {
11354
+ this._set(key, { value, expiry });
11355
+ }
11356
+ return this;
11357
+ }
11358
+ has(key) {
11359
+ if (this.cache.has(key)) {
11360
+ return !this._deleteIfExpired(key, this.cache.get(key));
11361
+ }
11362
+ if (this.oldCache.has(key)) {
11363
+ return !this._deleteIfExpired(key, this.oldCache.get(key));
11364
+ }
11365
+ return false;
11366
+ }
11367
+ peek(key) {
11368
+ if (this.cache.has(key)) {
11369
+ return this._peek(key, this.cache);
11370
+ }
11371
+ if (this.oldCache.has(key)) {
11372
+ return this._peek(key, this.oldCache);
11373
+ }
11374
+ }
11375
+ delete(key) {
11376
+ const deleted = this.cache.delete(key);
11377
+ if (deleted) {
11378
+ this._size--;
11379
+ }
11380
+ return this.oldCache.delete(key) || deleted;
11381
+ }
11382
+ clear() {
11383
+ this.cache.clear();
11384
+ this.oldCache.clear();
11385
+ this._size = 0;
11386
+ }
11387
+ resize(newSize) {
11388
+ if (!(newSize && newSize > 0)) {
11389
+ throw new TypeError("`maxSize` must be a number greater than 0");
11390
+ }
11391
+ const items = [...this._entriesAscending()];
11392
+ const removeCount = items.length - newSize;
11393
+ if (removeCount < 0) {
11394
+ this.cache = new Map(items);
11395
+ this.oldCache = /* @__PURE__ */ new Map();
11396
+ this._size = items.length;
11397
+ } else {
11398
+ if (removeCount > 0) {
11399
+ this._emitEvictions(items.slice(0, removeCount));
11400
+ }
11401
+ this.oldCache = new Map(items.slice(removeCount));
11402
+ this.cache = /* @__PURE__ */ new Map();
11403
+ this._size = 0;
11404
+ }
11405
+ this.maxSize = newSize;
11406
+ }
11407
+ *keys() {
11408
+ for (const [key] of this) {
11409
+ yield key;
11410
+ }
11411
+ }
11412
+ *values() {
11413
+ for (const [, value] of this) {
11414
+ yield value;
11415
+ }
11416
+ }
11417
+ *[Symbol.iterator]() {
11418
+ for (const item of this.cache) {
11419
+ const [key, value] = item;
11420
+ const deleted = this._deleteIfExpired(key, value);
11421
+ if (deleted === false) {
11422
+ yield [key, value.value];
11423
+ }
11424
+ }
11425
+ for (const item of this.oldCache) {
11426
+ const [key, value] = item;
11427
+ if (!this.cache.has(key)) {
11428
+ const deleted = this._deleteIfExpired(key, value);
11429
+ if (deleted === false) {
11430
+ yield [key, value.value];
11431
+ }
11432
+ }
11433
+ }
11434
+ }
11435
+ *entriesDescending() {
11436
+ let items = [...this.cache];
11437
+ for (let i = items.length - 1; i >= 0; --i) {
11438
+ const item = items[i];
11439
+ const [key, value] = item;
11440
+ const deleted = this._deleteIfExpired(key, value);
11441
+ if (deleted === false) {
11442
+ yield [key, value.value];
11443
+ }
11444
+ }
11445
+ items = [...this.oldCache];
11446
+ for (let i = items.length - 1; i >= 0; --i) {
11447
+ const item = items[i];
11448
+ const [key, value] = item;
11449
+ if (!this.cache.has(key)) {
11450
+ const deleted = this._deleteIfExpired(key, value);
11451
+ if (deleted === false) {
11452
+ yield [key, value.value];
11453
+ }
11454
+ }
11455
+ }
11456
+ }
11457
+ *entriesAscending() {
11458
+ for (const [key, value] of this._entriesAscending()) {
11459
+ yield [key, value.value];
11460
+ }
11461
+ }
11462
+ get size() {
11463
+ if (!this._size) {
11464
+ return this.oldCache.size;
11465
+ }
11466
+ let oldCacheSize = 0;
11467
+ for (const key of this.oldCache.keys()) {
11468
+ if (!this.cache.has(key)) {
11469
+ oldCacheSize++;
11470
+ }
11471
+ }
11472
+ return Math.min(this._size + oldCacheSize, this.maxSize);
11473
+ }
11474
+ entries() {
11475
+ return this.entriesAscending();
11476
+ }
11477
+ forEach(callbackFunction, thisArgument = this) {
11478
+ for (const [key, value] of this.entriesAscending()) {
11479
+ callbackFunction.call(thisArgument, value, key, this);
11480
+ }
11481
+ }
11482
+ get [Symbol.toStringTag]() {
11483
+ return JSON.stringify([...this.entriesAscending()]);
11484
+ }
11485
+ };
11437
11486
 
11438
- // ../../node_modules/geotiff/src/utils.js
11487
+ // ../../node_modules/geotiff/dist-module/utils.js
11439
11488
  async function wait(milliseconds) {
11440
11489
  return new Promise((resolve) => setTimeout(resolve, milliseconds));
11441
11490
  }
@@ -11463,18 +11512,33 @@ var __exports__ = (() => {
11463
11512
  };
11464
11513
  var AggregateError = CustomAggregateError;
11465
11514
 
11466
- // ../../node_modules/geotiff/src/source/blockedsource.js
11515
+ // ../../node_modules/geotiff/dist-module/source/blockedsource.js
11467
11516
  var Block = class {
11517
+ /**
11518
+ *
11519
+ * @param {number} offset
11520
+ * @param {number} length
11521
+ * @param {ArrayBuffer} [data]
11522
+ */
11468
11523
  constructor(offset, length, data = null) {
11469
11524
  this.offset = offset;
11470
11525
  this.length = length;
11471
11526
  this.data = data;
11472
11527
  }
11528
+ /**
11529
+ * @returns {number} the top byte border
11530
+ */
11473
11531
  get top() {
11474
11532
  return this.offset + this.length;
11475
11533
  }
11476
11534
  };
11477
11535
  var BlockGroup = class {
11536
+ /**
11537
+ *
11538
+ * @param {number} offset
11539
+ * @param {number} length
11540
+ * @param {number[]} blockIds
11541
+ */
11478
11542
  constructor(offset, length, blockIds) {
11479
11543
  this.offset = offset;
11480
11544
  this.length = length;
@@ -11482,105 +11546,98 @@ var __exports__ = (() => {
11482
11546
  }
11483
11547
  };
11484
11548
  var BlockedSource = class extends BaseSource {
11485
- constructor(source, {
11486
- blockSize = 65536,
11487
- cacheSize = 100
11488
- } = {}) {
11549
+ /**
11550
+ *
11551
+ * @param {BaseSource} source The underlying source that shall be blocked and cached
11552
+ * @param {object} options
11553
+ * @param {number} [options.blockSize]
11554
+ * @param {number} [options.cacheSize]
11555
+ */
11556
+ constructor(source, { blockSize = 65536, cacheSize = 100 } = {}) {
11489
11557
  super();
11490
11558
  this.source = source;
11491
11559
  this.blockSize = blockSize;
11492
- this.blockCache = new import_lru_cache.default({
11493
- max: cacheSize
11560
+ this.blockCache = new QuickLRU({
11561
+ maxSize: cacheSize,
11562
+ onEviction: (blockId, block) => {
11563
+ this.evictedBlocks.set(blockId, block);
11564
+ }
11494
11565
  });
11566
+ this.evictedBlocks = /* @__PURE__ */ new Map();
11495
11567
  this.blockRequests = /* @__PURE__ */ new Map();
11496
11568
  this.blockIdsToFetch = /* @__PURE__ */ new Set();
11569
+ this.abortedBlockIds = /* @__PURE__ */ new Set();
11497
11570
  }
11498
11571
  get fileSize() {
11499
11572
  return this.source.fileSize;
11500
11573
  }
11574
+ /**
11575
+ *
11576
+ * @param {import("./basesource").Slice[]} slices
11577
+ */
11501
11578
  async fetch(slices, signal) {
11502
- const cachedBlocks = /* @__PURE__ */ new Map();
11503
- const blockRequests = /* @__PURE__ */ new Map();
11504
- const missingBlockIds = /* @__PURE__ */ new Set();
11505
- for (const {
11506
- offset,
11507
- length
11508
- } of slices) {
11579
+ const blockRequests = [];
11580
+ const missingBlockIds = [];
11581
+ const allBlockIds = [];
11582
+ this.evictedBlocks.clear();
11583
+ for (const { offset, length } of slices) {
11509
11584
  let top = offset + length;
11510
- const {
11511
- fileSize
11512
- } = this;
11585
+ const { fileSize } = this;
11513
11586
  if (fileSize !== null) {
11514
11587
  top = Math.min(top, fileSize);
11515
11588
  }
11516
11589
  const firstBlockOffset = Math.floor(offset / this.blockSize) * this.blockSize;
11517
11590
  for (let current = firstBlockOffset; current < top; current += this.blockSize) {
11518
11591
  const blockId = Math.floor(current / this.blockSize);
11519
- if (this.blockCache.has(blockId)) {
11520
- cachedBlocks.set(blockId, this.blockCache.get(blockId));
11521
- } else if (this.blockRequests.has(blockId)) {
11522
- blockRequests.set(blockId, this.blockRequests.get(blockId));
11523
- } else if (this.blockIdsToFetch.has(blockId)) {
11524
- missingBlockIds.add(blockId);
11525
- } else {
11592
+ if (!this.blockCache.has(blockId) && !this.blockRequests.has(blockId)) {
11526
11593
  this.blockIdsToFetch.add(blockId);
11527
- missingBlockIds.add(blockId);
11594
+ missingBlockIds.push(blockId);
11528
11595
  }
11596
+ if (this.blockRequests.has(blockId)) {
11597
+ blockRequests.push(this.blockRequests.get(blockId));
11598
+ }
11599
+ allBlockIds.push(blockId);
11529
11600
  }
11530
11601
  }
11531
11602
  await wait();
11532
11603
  this.fetchBlocks(signal);
11604
+ const missingRequests = [];
11533
11605
  for (const blockId of missingBlockIds) {
11534
- const block = this.blockRequests.get(blockId);
11535
- const cachedBlock = this.blockCache.get(blockId);
11536
- if (block) {
11537
- blockRequests.set(blockId, block);
11538
- } else if (cachedBlock) {
11539
- cachedBlocks.set(blockId, cachedBlock);
11540
- } else {
11541
- throw new Error(`Block ${blockId} is not in the block requests`);
11606
+ if (this.blockRequests.has(blockId)) {
11607
+ missingRequests.push(this.blockRequests.get(blockId));
11542
11608
  }
11543
11609
  }
11544
- let results = await Promise.allSettled(Array.from(blockRequests.values()));
11545
- if (results.some((result) => result.status === "rejected")) {
11546
- const retriedBlockRequests = /* @__PURE__ */ new Set();
11547
- for (const [blockId, result] of zip(blockRequests.keys(), results)) {
11548
- const {
11549
- rejected,
11550
- reason
11551
- } = result;
11552
- if (rejected) {
11553
- if (reason.name === "AbortError" && reason.signal !== signal) {
11554
- this.blockIdsToFetch.add(blockId);
11555
- retriedBlockRequests.add(blockId);
11556
- }
11610
+ await Promise.allSettled(blockRequests);
11611
+ await Promise.allSettled(missingRequests);
11612
+ const abortedBlockRequests = [];
11613
+ const abortedBlockIds = allBlockIds.filter((id) => this.abortedBlockIds.has(id) || !this.blockCache.has(id));
11614
+ abortedBlockIds.forEach((id) => this.blockIdsToFetch.add(id));
11615
+ if (abortedBlockIds.length > 0 && signal && !signal.aborted) {
11616
+ this.fetchBlocks(null);
11617
+ for (const blockId of abortedBlockIds) {
11618
+ const block = this.blockRequests.get(blockId);
11619
+ if (!block) {
11620
+ throw new Error(`Block ${blockId} is not in the block requests`);
11557
11621
  }
11622
+ abortedBlockRequests.push(block);
11558
11623
  }
11559
- if (this.blockIdsToFetch.length > 0) {
11560
- this.fetchBlocks(signal);
11561
- for (const blockId of retriedBlockRequests) {
11562
- const block = this.blockRequests.get(blockId);
11563
- if (!block) {
11564
- throw new Error(`Block ${blockId} is not in the block requests`);
11565
- }
11566
- blockRequests.set(blockId, block);
11567
- }
11568
- results = await Promise.allSettled(Array.from(blockRequests.values()));
11569
- }
11624
+ await Promise.allSettled(abortedBlockRequests);
11570
11625
  }
11571
- if (results.some((result) => result.status === "rejected")) {
11572
- if (signal && signal.aborted) {
11573
- throw new AbortError("Request was aborted");
11574
- }
11575
- throw new AggregateError(results.filter((result) => result.status === "rejected").map((result) => result.reason), "Request failed");
11626
+ if (signal && signal.aborted) {
11627
+ throw new AbortError("Request was aborted");
11576
11628
  }
11577
- const values2 = results.map((result) => result.value);
11578
- const requiredBlocks = new Map(zip(Array.from(blockRequests.keys()), values2));
11579
- for (const [blockId, block] of cachedBlocks) {
11580
- requiredBlocks.set(blockId, block);
11629
+ const blocks = allBlockIds.map((id) => this.blockCache.get(id) || this.evictedBlocks.get(id));
11630
+ const failedBlocks = blocks.filter((i) => !i);
11631
+ if (failedBlocks.length) {
11632
+ throw new AggregateError(failedBlocks, "Request failed");
11581
11633
  }
11634
+ const requiredBlocks = new Map(zip(allBlockIds, blocks));
11582
11635
  return this.readSliceData(slices, requiredBlocks);
11583
11636
  }
11637
+ /**
11638
+ *
11639
+ * @param {AbortSignal} signal
11640
+ */
11584
11641
  fetchBlocks(signal) {
11585
11642
  if (this.blockIdsToFetch.size > 0) {
11586
11643
  const groups = this.groupBlocks(this.blockIdsToFetch);
@@ -11588,31 +11645,43 @@ var __exports__ = (() => {
11588
11645
  for (let groupIndex = 0; groupIndex < groups.length; ++groupIndex) {
11589
11646
  const group = groups[groupIndex];
11590
11647
  for (const blockId of group.blockIds) {
11591
- const blockRequest = (async () => {
11648
+ this.blockRequests.set(blockId, (async () => {
11592
11649
  try {
11593
11650
  const response = (await groupRequests)[groupIndex];
11594
11651
  const blockOffset = blockId * this.blockSize;
11595
11652
  const o = blockOffset - response.offset;
11596
11653
  const t = Math.min(o + this.blockSize, response.data.byteLength);
11597
11654
  const data = response.data.slice(o, t);
11598
- const block = new Block(blockOffset, data.byteLength, data);
11655
+ const block = new Block(
11656
+ blockOffset,
11657
+ data.byteLength,
11658
+ data,
11659
+ blockId
11660
+ );
11599
11661
  this.blockCache.set(blockId, block);
11600
- return block;
11662
+ this.abortedBlockIds.delete(blockId);
11601
11663
  } catch (err2) {
11602
11664
  if (err2.name === "AbortError") {
11603
11665
  err2.signal = signal;
11666
+ this.blockCache.delete(blockId);
11667
+ this.abortedBlockIds.add(blockId);
11668
+ } else {
11669
+ throw err2;
11604
11670
  }
11605
- throw err2;
11606
11671
  } finally {
11607
11672
  this.blockRequests.delete(blockId);
11608
11673
  }
11609
- })();
11610
- this.blockRequests.set(blockId, blockRequest);
11674
+ })());
11611
11675
  }
11612
11676
  }
11613
11677
  this.blockIdsToFetch.clear();
11614
11678
  }
11615
11679
  }
11680
+ /**
11681
+ *
11682
+ * @param {Set} blockIds
11683
+ * @returns {BlockGroup[]}
11684
+ */
11616
11685
  groupBlocks(blockIds) {
11617
11686
  const sortedBlockIds = Array.from(blockIds).sort((a, b) => a - b);
11618
11687
  if (sortedBlockIds.length === 0) {
@@ -11626,19 +11695,35 @@ var __exports__ = (() => {
11626
11695
  current.push(blockId);
11627
11696
  lastBlockId = blockId;
11628
11697
  } else {
11629
- groups.push(new BlockGroup(current[0] * this.blockSize, current.length * this.blockSize, current));
11698
+ groups.push(new BlockGroup(
11699
+ current[0] * this.blockSize,
11700
+ current.length * this.blockSize,
11701
+ current
11702
+ ));
11630
11703
  current = [blockId];
11631
11704
  lastBlockId = blockId;
11632
11705
  }
11633
11706
  }
11634
- groups.push(new BlockGroup(current[0] * this.blockSize, current.length * this.blockSize, current));
11707
+ groups.push(new BlockGroup(
11708
+ current[0] * this.blockSize,
11709
+ current.length * this.blockSize,
11710
+ current
11711
+ ));
11635
11712
  return groups;
11636
11713
  }
11714
+ /**
11715
+ *
11716
+ * @param {import("./basesource").Slice[]} slices
11717
+ * @param {Map} blocks
11718
+ */
11637
11719
  readSliceData(slices, blocks) {
11638
11720
  return slices.map((slice) => {
11639
- const top = slice.offset + slice.length;
11721
+ let top = slice.offset + slice.length;
11722
+ if (this.fileSize !== null) {
11723
+ top = Math.min(this.fileSize, top);
11724
+ }
11640
11725
  const blockIdLow = Math.floor(slice.offset / this.blockSize);
11641
- const blockIdHigh = Math.floor((slice.offset + slice.length) / this.blockSize);
11726
+ const blockIdHigh = Math.floor(top / this.blockSize);
11642
11727
  const sliceData = new ArrayBuffer(slice.length);
11643
11728
  const sliceView = new Uint8Array(sliceData);
11644
11729
  for (let blockId = blockIdLow; blockId <= blockIdHigh; ++blockId) {
@@ -11666,17 +11751,31 @@ var __exports__ = (() => {
11666
11751
  }
11667
11752
  };
11668
11753
 
11669
- // ../../node_modules/geotiff/src/source/client/base.js
11754
+ // ../../node_modules/geotiff/dist-module/source/client/base.js
11670
11755
  var BaseResponse = class {
11756
+ /**
11757
+ * Returns whether the response has an ok'ish status code
11758
+ */
11671
11759
  get ok() {
11672
11760
  return this.status >= 200 && this.status <= 299;
11673
11761
  }
11762
+ /**
11763
+ * Returns the status code of the response
11764
+ */
11674
11765
  get status() {
11675
11766
  throw new Error("not implemented");
11676
11767
  }
11768
+ /**
11769
+ * Returns the value of the specified header
11770
+ * @param {string} headerName the header name
11771
+ * @returns {string} the header value
11772
+ */
11677
11773
  getHeader(headerName) {
11678
11774
  throw new Error("not implemented");
11679
11775
  }
11776
+ /**
11777
+ * @returns {ArrayBuffer} the response data of the request
11778
+ */
11680
11779
  async getData() {
11681
11780
  throw new Error("not implemented");
11682
11781
  }
@@ -11685,17 +11784,21 @@ var __exports__ = (() => {
11685
11784
  constructor(url) {
11686
11785
  this.url = url;
11687
11786
  }
11688
- async request({
11689
- headers,
11690
- credentials,
11691
- signal
11692
- } = {}) {
11787
+ /**
11788
+ * Send a request with the options
11789
+ * @param {object} [options]
11790
+ */
11791
+ async request({ headers, credentials, signal } = {}) {
11693
11792
  throw new Error("request is not implemented");
11694
11793
  }
11695
11794
  };
11696
11795
 
11697
- // ../../node_modules/geotiff/src/source/client/fetch.js
11796
+ // ../../node_modules/geotiff/dist-module/source/client/fetch.js
11698
11797
  var FetchResponse = class extends BaseResponse {
11798
+ /**
11799
+ * BaseResponse facade for fetch API Response
11800
+ * @param {Response} response
11801
+ */
11699
11802
  constructor(response) {
11700
11803
  super();
11701
11804
  this.response = response;
@@ -11716,11 +11819,7 @@ var __exports__ = (() => {
11716
11819
  super(url);
11717
11820
  this.credentials = credentials;
11718
11821
  }
11719
- async request({
11720
- headers,
11721
- credentials,
11722
- signal
11723
- } = {}) {
11822
+ async request({ headers, credentials, signal } = {}) {
11724
11823
  const response = await fetch(this.url, {
11725
11824
  headers,
11726
11825
  credentials,
@@ -11730,8 +11829,13 @@ var __exports__ = (() => {
11730
11829
  }
11731
11830
  };
11732
11831
 
11733
- // ../../node_modules/geotiff/src/source/client/xhr.js
11832
+ // ../../node_modules/geotiff/dist-module/source/client/xhr.js
11734
11833
  var XHRResponse = class extends BaseResponse {
11834
+ /**
11835
+ * BaseResponse facade for XMLHttpRequest
11836
+ * @param {XMLHttpRequest} xhr
11837
+ * @param {ArrayBuffer} data
11838
+ */
11735
11839
  constructor(xhr, data) {
11736
11840
  super();
11737
11841
  this.xhr = xhr;
@@ -11771,20 +11875,21 @@ var __exports__ = (() => {
11771
11875
  }
11772
11876
  });
11773
11877
  }
11774
- async request({
11775
- headers,
11776
- signal
11777
- } = {}) {
11878
+ async request({ headers, signal } = {}) {
11778
11879
  const response = await this.constructRequest(headers, signal);
11779
11880
  return response;
11780
11881
  }
11781
11882
  };
11782
11883
 
11783
- // ../../node_modules/geotiff/src/source/client/http.js
11784
- var import_http = __toESM(require_http());
11785
- var import_https = __toESM(require_https());
11786
- var import_url = __toESM(require_url());
11884
+ // ../../node_modules/geotiff/dist-module/source/client/http.js
11885
+ var import_http = __toESM(require_http(), 1);
11886
+ var import_https = __toESM(require_https(), 1);
11887
+ var import_url = __toESM(require_url(), 1);
11787
11888
  var HttpResponse = class extends BaseResponse {
11889
+ /**
11890
+ * BaseResponse facade for node HTTP/HTTPS API Response
11891
+ * @param {http.ServerResponse} response
11892
+ */
11788
11893
  constructor(response, dataPromise) {
11789
11894
  super();
11790
11895
  this.response = response;
@@ -11809,23 +11914,26 @@ var __exports__ = (() => {
11809
11914
  }
11810
11915
  constructRequest(headers, signal) {
11811
11916
  return new Promise((resolve, reject) => {
11812
- const request = this.httpApi.get({
11813
- ...this.parsedUrl,
11814
- headers
11815
- }, (response) => {
11816
- const dataPromise = new Promise((resolveData) => {
11817
- const chunks = [];
11818
- response.on("data", (chunk) => {
11819
- chunks.push(chunk);
11820
- });
11821
- response.on("end", () => {
11822
- const data = Buffer.concat(chunks).buffer;
11823
- resolveData(data);
11917
+ const request = this.httpApi.get(
11918
+ {
11919
+ ...this.parsedUrl,
11920
+ headers
11921
+ },
11922
+ (response) => {
11923
+ const dataPromise = new Promise((resolveData) => {
11924
+ const chunks = [];
11925
+ response.on("data", (chunk) => {
11926
+ chunks.push(chunk);
11927
+ });
11928
+ response.on("end", () => {
11929
+ const data = Buffer.concat(chunks).buffer;
11930
+ resolveData(data);
11931
+ });
11932
+ response.on("error", reject);
11824
11933
  });
11825
- response.on("error", reject);
11826
- });
11827
- resolve(new HttpResponse(response, dataPromise));
11828
- });
11934
+ resolve(new HttpResponse(response, dataPromise));
11935
+ }
11936
+ );
11829
11937
  request.on("error", reject);
11830
11938
  if (signal) {
11831
11939
  if (signal.aborted) {
@@ -11835,17 +11943,21 @@ var __exports__ = (() => {
11835
11943
  }
11836
11944
  });
11837
11945
  }
11838
- async request({
11839
- headers,
11840
- signal
11841
- } = {}) {
11946
+ async request({ headers, signal } = {}) {
11842
11947
  const response = await this.constructRequest(headers, signal);
11843
11948
  return response;
11844
11949
  }
11845
11950
  };
11846
11951
 
11847
- // ../../node_modules/geotiff/src/source/remote.js
11952
+ // ../../node_modules/geotiff/dist-module/source/remote.js
11848
11953
  var RemoteSource = class extends BaseSource {
11954
+ /**
11955
+ *
11956
+ * @param {BaseClient} client
11957
+ * @param {object} headers
11958
+ * @param {numbers} maxRanges
11959
+ * @param {boolean} allowFullFile
11960
+ */
11849
11961
  constructor(client, headers, maxRanges, allowFullFile) {
11850
11962
  super();
11851
11963
  this.client = client;
@@ -11854,42 +11966,38 @@ var __exports__ = (() => {
11854
11966
  this.allowFullFile = allowFullFile;
11855
11967
  this._fileSize = null;
11856
11968
  }
11969
+ /**
11970
+ *
11971
+ * @param {Slice[]} slices
11972
+ */
11857
11973
  async fetch(slices, signal) {
11858
11974
  if (this.maxRanges >= slices.length) {
11859
11975
  return this.fetchSlices(slices, signal);
11860
11976
  } else if (this.maxRanges > 0 && slices.length > 1) {
11861
11977
  }
11862
- return Promise.all(slices.map((slice) => this.fetchSlice(slice, signal)));
11978
+ return Promise.all(
11979
+ slices.map((slice) => this.fetchSlice(slice, signal))
11980
+ );
11863
11981
  }
11864
11982
  async fetchSlices(slices, signal) {
11865
11983
  const response = await this.client.request({
11866
11984
  headers: {
11867
11985
  ...this.headers,
11868
- Range: `bytes=${slices.map(({
11869
- offset,
11870
- length
11871
- }) => `${offset}-${offset + length}`).join(",")}`
11986
+ Range: `bytes=${slices.map(({ offset, length }) => `${offset}-${offset + length}`).join(",")}`
11872
11987
  },
11873
11988
  signal
11874
11989
  });
11875
11990
  if (!response.ok) {
11876
11991
  throw new Error("Error fetching data.");
11877
11992
  } else if (response.status === 206) {
11878
- const {
11879
- type,
11880
- params
11881
- } = parseContentType(response.getHeader("content-type"));
11993
+ const { type, params } = parseContentType(response.getHeader("content-type"));
11882
11994
  if (type === "multipart/byteranges") {
11883
11995
  const byteRanges = parseByteRanges(await response.getData(), params.boundary);
11884
11996
  this._fileSize = byteRanges[0].fileSize || null;
11885
11997
  return byteRanges;
11886
11998
  }
11887
11999
  const data = await response.getData();
11888
- const {
11889
- start,
11890
- end,
11891
- total
11892
- } = parseContentRange(response.getHeader("content-range"));
12000
+ const { start, end, total } = parseContentRange(response.getHeader("content-range"));
11893
12001
  this._fileSize = total || null;
11894
12002
  const first = [{
11895
12003
  data,
@@ -11915,10 +12023,7 @@ var __exports__ = (() => {
11915
12023
  }
11916
12024
  }
11917
12025
  async fetchSlice(slice, signal) {
11918
- const {
11919
- offset,
11920
- length
11921
- } = slice;
12026
+ const { offset, length } = slice;
11922
12027
  const response = await this.client.request({
11923
12028
  headers: {
11924
12029
  ...this.headers,
@@ -11930,9 +12035,7 @@ var __exports__ = (() => {
11930
12035
  throw new Error("Error fetching data.");
11931
12036
  } else if (response.status === 206) {
11932
12037
  const data = await response.getData();
11933
- const {
11934
- total
11935
- } = parseContentRange(response.getHeader("content-range"));
12038
+ const { total } = parseContentRange(response.getHeader("content-range"));
11936
12039
  this._fileSize = total || null;
11937
12040
  return {
11938
12041
  data,
@@ -11956,50 +12059,28 @@ var __exports__ = (() => {
11956
12059
  return this._fileSize;
11957
12060
  }
11958
12061
  };
11959
- function maybeWrapInBlockedSource(source, {
11960
- blockSize,
11961
- cacheSize
11962
- }) {
12062
+ function maybeWrapInBlockedSource(source, { blockSize, cacheSize }) {
11963
12063
  if (blockSize === null) {
11964
12064
  return source;
11965
12065
  }
11966
- return new BlockedSource(source, blockSize, cacheSize);
12066
+ return new BlockedSource(source, { blockSize, cacheSize });
11967
12067
  }
11968
- function makeFetchSource(url, {
11969
- headers = {},
11970
- credentials,
11971
- maxRanges = 0,
11972
- allowFullFile = false,
11973
- ...blockOptions
11974
- } = {}) {
12068
+ function makeFetchSource(url, { headers = {}, credentials, maxRanges = 0, allowFullFile = false, ...blockOptions } = {}) {
11975
12069
  const client = new FetchClient(url, credentials);
11976
12070
  const source = new RemoteSource(client, headers, maxRanges, allowFullFile);
11977
12071
  return maybeWrapInBlockedSource(source, blockOptions);
11978
12072
  }
11979
- function makeXHRSource(url, {
11980
- headers = {},
11981
- maxRanges = 0,
11982
- allowFullFile = false,
11983
- ...blockOptions
11984
- } = {}) {
12073
+ function makeXHRSource(url, { headers = {}, maxRanges = 0, allowFullFile = false, ...blockOptions } = {}) {
11985
12074
  const client = new XHRClient(url);
11986
12075
  const source = new RemoteSource(client, headers, maxRanges, allowFullFile);
11987
12076
  return maybeWrapInBlockedSource(source, blockOptions);
11988
12077
  }
11989
- function makeHttpSource(url, {
11990
- headers = {},
11991
- maxRanges = 0,
11992
- allowFullFile = false,
11993
- ...blockOptions
11994
- } = {}) {
12078
+ function makeHttpSource(url, { headers = {}, maxRanges = 0, allowFullFile = false, ...blockOptions } = {}) {
11995
12079
  const client = new HttpClient(url);
11996
12080
  const source = new RemoteSource(client, headers, maxRanges, allowFullFile);
11997
12081
  return maybeWrapInBlockedSource(source, blockOptions);
11998
12082
  }
11999
- function makeRemoteSource(url, {
12000
- forceXHR = false,
12001
- ...clientOptions
12002
- } = {}) {
12083
+ function makeRemoteSource(url, { forceXHR = false, ...clientOptions } = {}) {
12003
12084
  if (typeof fetch === "function" && !forceXHR) {
12004
12085
  return makeFetchSource(url, clientOptions);
12005
12086
  }
@@ -12009,7 +12090,24 @@ var __exports__ = (() => {
12009
12090
  return makeHttpSource(url, clientOptions);
12010
12091
  }
12011
12092
 
12012
- // ../../node_modules/geotiff/src/source/filereader.js
12093
+ // ../../node_modules/geotiff/dist-module/source/arraybuffer.js
12094
+ var ArrayBufferSource = class extends BaseSource {
12095
+ constructor(arrayBuffer) {
12096
+ super();
12097
+ this.arrayBuffer = arrayBuffer;
12098
+ }
12099
+ fetchSlice(slice, signal) {
12100
+ if (signal && signal.aborted) {
12101
+ throw new AbortError("Request aborted");
12102
+ }
12103
+ return this.arrayBuffer.slice(slice.offset, slice.offset + slice.length);
12104
+ }
12105
+ };
12106
+ function makeBufferSource(arrayBuffer) {
12107
+ return new ArrayBufferSource(arrayBuffer);
12108
+ }
12109
+
12110
+ // ../../node_modules/geotiff/dist-module/source/filereader.js
12013
12111
  var FileReaderSource = class extends BaseSource {
12014
12112
  constructor(file) {
12015
12113
  super();
@@ -12033,7 +12131,7 @@ var __exports__ = (() => {
12033
12131
  return new FileReaderSource(file);
12034
12132
  }
12035
12133
 
12036
- // ../../node_modules/geotiff/src/geotiff.js
12134
+ // ../../node_modules/geotiff/dist-module/geotiff.js
12037
12135
  init_globals();
12038
12136
  function getFieldTypeLength(fieldType) {
12039
12137
  switch (fieldType) {
@@ -12154,12 +12252,21 @@ var __exports__ = (() => {
12154
12252
  }
12155
12253
  if (!(fieldType === fieldTypes.RATIONAL || fieldType === fieldTypes.SRATIONAL)) {
12156
12254
  for (let i = 0; i < count; ++i) {
12157
- values2[i] = readMethod.call(dataSlice, offset + i * fieldTypeLength);
12255
+ values2[i] = readMethod.call(
12256
+ dataSlice,
12257
+ offset + i * fieldTypeLength
12258
+ );
12158
12259
  }
12159
12260
  } else {
12160
12261
  for (let i = 0; i < count; i += 2) {
12161
- values2[i] = readMethod.call(dataSlice, offset + i * fieldTypeLength);
12162
- values2[i + 1] = readMethod.call(dataSlice, offset + (i * fieldTypeLength + 4));
12262
+ values2[i] = readMethod.call(
12263
+ dataSlice,
12264
+ offset + i * fieldTypeLength
12265
+ );
12266
+ values2[i + 1] = readMethod.call(
12267
+ dataSlice,
12268
+ offset + (i * fieldTypeLength + 4)
12269
+ );
12163
12270
  }
12164
12271
  }
12165
12272
  if (fieldType === fieldTypes.ASCII) {
@@ -12181,17 +12288,21 @@ var __exports__ = (() => {
12181
12288
  }
12182
12289
  };
12183
12290
  var GeoTIFFBase = class {
12291
+ /**
12292
+ * (experimental) Reads raster data from the best fitting image. This function uses
12293
+ * the image with the lowest resolution that is still a higher resolution than the
12294
+ * requested resolution.
12295
+ * When specified, the `bbox` option is translated to the `window` option and the
12296
+ * `resX` and `resY` to `width` and `height` respectively.
12297
+ * Then, the [readRasters]{@link GeoTIFFImage#readRasters} method of the selected
12298
+ * image is called and the result returned.
12299
+ * @see GeoTIFFImage.readRasters
12300
+ * @param {import('./geotiffimage').ReadRasterOptions} [options={}] optional parameters
12301
+ * @returns {Promise<ReadRasterResult>} the decoded array(s), with `height` and `width`, as a promise
12302
+ */
12184
12303
  async readRasters(options = {}) {
12185
- const {
12186
- window: imageWindow,
12187
- width,
12188
- height
12189
- } = options;
12190
- let {
12191
- resX,
12192
- resY,
12193
- bbox
12194
- } = options;
12304
+ const { window: imageWindow, width, height } = options;
12305
+ let { resX, resY, bbox } = options;
12195
12306
  const firstImage = await this.getImage();
12196
12307
  let usedImage = firstImage;
12197
12308
  const imageCount = await this.getImageCount();
@@ -12203,7 +12314,12 @@ var __exports__ = (() => {
12203
12314
  if (imageWindow) {
12204
12315
  const [oX, oY] = firstImage.getOrigin();
12205
12316
  const [rX, rY] = firstImage.getResolution();
12206
- bbox = [oX + imageWindow[0] * rX, oY + imageWindow[1] * rY, oX + imageWindow[2] * rX, oY + imageWindow[3] * rY];
12317
+ bbox = [
12318
+ oX + imageWindow[0] * rX,
12319
+ oY + imageWindow[1] * rY,
12320
+ oX + imageWindow[2] * rX,
12321
+ oY + imageWindow[3] * rY
12322
+ ];
12207
12323
  }
12208
12324
  const usedBBox = bbox || imgBBox;
12209
12325
  if (width) {
@@ -12223,10 +12339,7 @@ var __exports__ = (() => {
12223
12339
  const allImages = [];
12224
12340
  for (let i = 0; i < imageCount; ++i) {
12225
12341
  const image = await this.getImage(i);
12226
- const {
12227
- SubfileType: subfileType,
12228
- NewSubfileType: newSubfileType
12229
- } = image.fileDirectory;
12342
+ const { SubfileType: subfileType, NewSubfileType: newSubfileType } = image.fileDirectory;
12230
12343
  if (i === 0 || subfileType === 2 || newSubfileType & 1) {
12231
12344
  allImages.push(image);
12232
12345
  }
@@ -12246,16 +12359,32 @@ var __exports__ = (() => {
12246
12359
  if (bbox) {
12247
12360
  const [oX, oY] = firstImage.getOrigin();
12248
12361
  const [imageResX, imageResY] = usedImage.getResolution(firstImage);
12249
- wnd = [Math.round((bbox[0] - oX) / imageResX), Math.round((bbox[1] - oY) / imageResY), Math.round((bbox[2] - oX) / imageResX), Math.round((bbox[3] - oY) / imageResY)];
12250
- wnd = [Math.min(wnd[0], wnd[2]), Math.min(wnd[1], wnd[3]), Math.max(wnd[0], wnd[2]), Math.max(wnd[1], wnd[3])];
12362
+ wnd = [
12363
+ Math.round((bbox[0] - oX) / imageResX),
12364
+ Math.round((bbox[1] - oY) / imageResY),
12365
+ Math.round((bbox[2] - oX) / imageResX),
12366
+ Math.round((bbox[3] - oY) / imageResY)
12367
+ ];
12368
+ wnd = [
12369
+ Math.min(wnd[0], wnd[2]),
12370
+ Math.min(wnd[1], wnd[3]),
12371
+ Math.max(wnd[0], wnd[2]),
12372
+ Math.max(wnd[1], wnd[3])
12373
+ ];
12251
12374
  }
12252
- return usedImage.readRasters({
12253
- ...options,
12254
- window: wnd
12255
- });
12375
+ return usedImage.readRasters({ ...options, window: wnd });
12256
12376
  }
12257
12377
  };
12258
12378
  var GeoTIFF = class extends GeoTIFFBase {
12379
+ /**
12380
+ * @constructor
12381
+ * @param {*} source The datasource to read from.
12382
+ * @param {boolean} littleEndian Whether the image uses little endian.
12383
+ * @param {boolean} bigTiff Whether the image uses bigTIFF conventions.
12384
+ * @param {number} firstIFDOffset The numeric byte-offset from the start of the image
12385
+ * to the first IFD.
12386
+ * @param {GeoTIFFOptions} [options] further options.
12387
+ */
12259
12388
  constructor(source, littleEndian, bigTiff, firstIFDOffset, options = {}) {
12260
12389
  super();
12261
12390
  this.source = source;
@@ -12268,11 +12397,24 @@ var __exports__ = (() => {
12268
12397
  }
12269
12398
  async getSlice(offset, size) {
12270
12399
  const fallbackSize = this.bigTiff ? 4048 : 1024;
12271
- return new DataSlice((await this.source.fetch([{
12400
+ return new DataSlice(
12401
+ (await this.source.fetch([{
12402
+ offset,
12403
+ length: typeof size !== "undefined" ? size : fallbackSize
12404
+ }]))[0],
12272
12405
  offset,
12273
- length: typeof size !== "undefined" ? size : fallbackSize
12274
- }]))[0], offset, this.littleEndian, this.bigTiff);
12275
- }
12406
+ this.littleEndian,
12407
+ this.bigTiff
12408
+ );
12409
+ }
12410
+ /**
12411
+ * Instructs to parse an image file directory at the given file offset.
12412
+ * As there is no way to ensure that a location is indeed the start of an IFD,
12413
+ * this function must be called with caution (e.g only using the IFD offsets from
12414
+ * the headers or other IFDs).
12415
+ * @param {number} offset the offset to parse the IFD at
12416
+ * @returns {Promise<ImageFileDirectory>} the parsed IFD
12417
+ */
12276
12418
  async parseFileDirectoryAt(offset) {
12277
12419
  const entrySize = this.bigTiff ? 20 : 12;
12278
12420
  const offsetSize = this.bigTiff ? 8 : 2;
@@ -12312,8 +12454,14 @@ var __exports__ = (() => {
12312
12454
  fileDirectory[fieldTagNames[fieldTag]] = value;
12313
12455
  }
12314
12456
  const geoKeyDirectory = parseGeoKeyDirectory(fileDirectory);
12315
- const nextIFDByteOffset = dataSlice.readOffset(offset + offsetSize + entrySize * numDirEntries);
12316
- return new ImageFileDirectory(fileDirectory, geoKeyDirectory, nextIFDByteOffset);
12457
+ const nextIFDByteOffset = dataSlice.readOffset(
12458
+ offset + offsetSize + entrySize * numDirEntries
12459
+ );
12460
+ return new ImageFileDirectory(
12461
+ fileDirectory,
12462
+ geoKeyDirectory,
12463
+ nextIFDByteOffset
12464
+ );
12317
12465
  }
12318
12466
  async requestIFD(index) {
12319
12467
  if (this.ifdRequests[index]) {
@@ -12340,10 +12488,28 @@ var __exports__ = (() => {
12340
12488
  })();
12341
12489
  return this.ifdRequests[index];
12342
12490
  }
12491
+ /**
12492
+ * Get the n-th internal subfile of an image. By default, the first is returned.
12493
+ *
12494
+ * @param {number} [index=0] the index of the image to return.
12495
+ * @returns {Promise<GeoTIFFImage>} the image at the given index
12496
+ */
12343
12497
  async getImage(index = 0) {
12344
12498
  const ifd = await this.requestIFD(index);
12345
- return new geotiffimage_default(ifd.fileDirectory, ifd.geoKeyDirectory, this.dataView, this.littleEndian, this.cache, this.source);
12346
- }
12499
+ return new geotiffimage_default(
12500
+ ifd.fileDirectory,
12501
+ ifd.geoKeyDirectory,
12502
+ this.dataView,
12503
+ this.littleEndian,
12504
+ this.cache,
12505
+ this.source
12506
+ );
12507
+ }
12508
+ /**
12509
+ * Returns the count of the internal subfiles.
12510
+ *
12511
+ * @returns {Promise<number>} the number of internal subfile images
12512
+ */
12347
12513
  async getImageCount() {
12348
12514
  let index = 0;
12349
12515
  let hasNext = true;
@@ -12361,6 +12527,11 @@ var __exports__ = (() => {
12361
12527
  }
12362
12528
  return index;
12363
12529
  }
12530
+ /**
12531
+ * Get the values of the COG ghost area as a parsed map.
12532
+ * See https://gdal.org/drivers/raster/cog.html#header-ghost-area for reference
12533
+ * @returns {Promise<Object>} the parsed ghost area or null, if no such area was found
12534
+ */
12364
12535
  async getGhostValues() {
12365
12536
  const offset = this.bigTiff ? 16 : 8;
12366
12537
  if (this.ghostValues) {
@@ -12384,11 +12555,16 @@ var __exports__ = (() => {
12384
12555
  }
12385
12556
  return this.ghostValues;
12386
12557
  }
12558
+ /**
12559
+ * Parse a (Geo)TIFF file from the given source.
12560
+ *
12561
+ * @param {*} source The source of data to parse from.
12562
+ * @param {GeoTIFFOptions} [options] Additional options.
12563
+ * @param {AbortSignal} [signal] An AbortSignal that may be signalled if the request is
12564
+ * to be aborted
12565
+ */
12387
12566
  static async fromSource(source, options, signal) {
12388
- const headerData = (await source.fetch([{
12389
- offset: 0,
12390
- length: 1024
12391
- }], signal))[0];
12567
+ const headerData = (await source.fetch([{ offset: 0, length: 1024 }], signal))[0];
12392
12568
  const dataView = new DataView64(headerData);
12393
12569
  const BOM = dataView.getUint16(0, 0);
12394
12570
  let littleEndian;
@@ -12415,6 +12591,11 @@ var __exports__ = (() => {
12415
12591
  const firstIFDOffset = bigTiff ? dataView.getUint64(8, littleEndian) : dataView.getUint32(4, littleEndian);
12416
12592
  return new GeoTIFF(source, littleEndian, bigTiff, firstIFDOffset, options);
12417
12593
  }
12594
+ /**
12595
+ * Closes the underlying file buffer
12596
+ * N.B. After the GeoTIFF has been completely processed it needs
12597
+ * to be closed but only if it has been constructed from a file.
12598
+ */
12418
12599
  close() {
12419
12600
  if (typeof this.source.close === "function") {
12420
12601
  return this.source.close();
@@ -12425,44 +12606,50 @@ var __exports__ = (() => {
12425
12606
  async function fromUrl(url, options = {}, signal) {
12426
12607
  return GeoTIFF.fromSource(makeRemoteSource(url, options), signal);
12427
12608
  }
12609
+ async function fromArrayBuffer(arrayBuffer, signal) {
12610
+ return GeoTIFF.fromSource(makeBufferSource(arrayBuffer), signal);
12611
+ }
12428
12612
  async function fromBlob(blob, signal) {
12429
12613
  return GeoTIFF.fromSource(makeFileReaderSource(blob), signal);
12430
12614
  }
12431
12615
 
12432
- // src/lib/utils/proxies.ts
12433
- var VIV_PROXY_KEY = "__viv";
12434
- var OFFSETS_PROXY_KEY = `${VIV_PROXY_KEY}-offsets`;
12435
- var POOL_PROXY_KEY = `${VIV_PROXY_KEY}-decoder-pool`;
12436
- function checkProxies(tiff) {
12437
- if (!isProxy(tiff, OFFSETS_PROXY_KEY)) {
12438
- console.warn("GeoTIFF source is missing offsets proxy.");
12439
- }
12440
- if (!isProxy(tiff, POOL_PROXY_KEY)) {
12441
- console.warn("GeoTIFF source is missing decoder-pool proxy.");
12616
+ // src/geotiff-loader.ts
12617
+ var VERSION = true ? "4.1.0-alpha.11" : "latest";
12618
+ var GeoTIFFLoader = {
12619
+ id: "geotiff",
12620
+ name: "GeoTIFF",
12621
+ module: "geotiff",
12622
+ version: VERSION,
12623
+ options: {
12624
+ enableAlpha: true
12625
+ },
12626
+ mimeTypes: ["image/tiff", "image/geotiff"],
12627
+ extensions: ["geotiff", "tiff", "geotif", "tif"],
12628
+ parse: parseGeoTIFF
12629
+ };
12630
+ async function parseGeoTIFF(data, options) {
12631
+ const tiff = await fromArrayBuffer(data);
12632
+ const image = await tiff.getImage();
12633
+ const rgbData = await image.readRGB({
12634
+ enableAlpha: options?.geotiff?.enableAlpha
12635
+ });
12636
+ const width = image.getWidth();
12637
+ const height = image.getHeight();
12638
+ const imageData = new Uint8ClampedArray(rgbData);
12639
+ const bounds = image.getBoundingBox();
12640
+ const metadata = image.getGeoKeys();
12641
+ let crs;
12642
+ if (metadata?.ProjectedCSTypeGeoKey) {
12643
+ crs = `EPSG:${metadata.ProjectedCSTypeGeoKey}`;
12442
12644
  }
12443
- }
12444
- function isProxy(tiff, proxyFlag) {
12445
- return tiff[proxyFlag];
12446
- }
12447
- function createOffsetsProxy(tiff, offsets) {
12448
- const get = (target, key) => {
12449
- if (key === "getImage") {
12450
- return (index) => {
12451
- if (!(index in target.ifdRequests) && index in offsets) {
12452
- const offset = offsets[index];
12453
- target.ifdRequests[index] = target.parseFileDirectoryAt(offset);
12454
- }
12455
- return target.getImage(index);
12456
- };
12457
- }
12458
- if (key === OFFSETS_PROXY_KEY) {
12459
- return true;
12460
- }
12461
- return Reflect.get(target, key);
12645
+ return {
12646
+ crs,
12647
+ bounds,
12648
+ width,
12649
+ height,
12650
+ data: imageData,
12651
+ metadata
12462
12652
  };
12463
- return new Proxy(tiff, {
12464
- get
12465
- });
12466
12653
  }
12467
12654
 
12468
12655
  // src/lib/utils/tiff-utils.ts
@@ -12573,7 +12760,6 @@ var __exports__ = (() => {
12573
12760
  console.error(err2);
12574
12761
  }
12575
12762
  };
12576
- var tiff_pixel_source_default = TiffPixelSource;
12577
12763
 
12578
12764
  // src/lib/ome/ome-indexers.ts
12579
12765
  function getOmeLegacyIndexer(tiff, rootMeta) {
@@ -12853,7 +13039,7 @@ var __exports__ = (() => {
12853
13039
  }).map((_, resolution) => {
12854
13040
  const shape = getShape(resolution);
12855
13041
  const indexer = (sel) => pyramidIndexer(sel, resolution);
12856
- const source = new tiff_pixel_source_default(indexer, dtype, tileSize, shape, labels, meta);
13042
+ const source = new TiffPixelSource(indexer, dtype, tileSize, shape, labels, meta);
12857
13043
  return source;
12858
13044
  });
12859
13045
  return {
@@ -12877,9 +13063,7 @@ var __exports__ = (() => {
12877
13063
  tiff = await fromBlob(source);
12878
13064
  }
12879
13065
  if (offsets) {
12880
- tiff = createOffsetsProxy(tiff, offsets);
12881
13066
  }
12882
- checkProxies(tiff);
12883
13067
  const firstImage = await tiff.getImage(0);
12884
13068
  if (isOmeTiff(firstImage)) {
12885
13069
  return loadOmeTiff(tiff, firstImage);