@basemaps/server 7.13.0 → 7.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -274,6 +274,7 @@ __export(tslib_es6_exports, {
274
274
  __propKey: () => __propKey,
275
275
  __read: () => __read,
276
276
  __rest: () => __rest,
277
+ __rewriteRelativeImportExtension: () => __rewriteRelativeImportExtension,
277
278
  __runInitializers: () => __runInitializers,
278
279
  __setFunctionName: () => __setFunctionName,
279
280
  __spread: () => __spread,
@@ -413,8 +414,8 @@ function __generator(thisArg, body) {
413
414
  if (t[0] & 1)
414
415
  throw t[1];
415
416
  return t[1];
416
- }, trys: [], ops: [] }, f, y, t, g;
417
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
417
+ }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
418
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
418
419
  return this;
419
420
  }), g;
420
421
  function verb(n) {
@@ -555,16 +556,24 @@ function __asyncGenerator(thisArg, _arguments, generator) {
555
556
  if (!Symbol.asyncIterator)
556
557
  throw new TypeError("Symbol.asyncIterator is not defined.");
557
558
  var g = generator.apply(thisArg, _arguments || []), i, q = [];
558
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
559
+ return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function() {
559
560
  return this;
560
561
  }, i;
561
- function verb(n) {
562
- if (g[n])
562
+ function awaitReturn(f) {
563
+ return function(v) {
564
+ return Promise.resolve(v).then(f, reject);
565
+ };
566
+ }
567
+ function verb(n, f) {
568
+ if (g[n]) {
563
569
  i[n] = function(v) {
564
570
  return new Promise(function(a, b) {
565
571
  q.push([n, v, a, b]) > 1 || resume(n, v);
566
572
  });
567
573
  };
574
+ if (f)
575
+ i[n] = f(i[n]);
576
+ }
568
577
  }
569
578
  function resume(n, v) {
570
579
  try {
@@ -633,9 +642,9 @@ function __importStar(mod) {
633
642
  return mod;
634
643
  var result = {};
635
644
  if (mod != null) {
636
- for (var k in mod)
637
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
638
- __createBinding(result, mod, k);
645
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++)
646
+ if (k[i] !== "default")
647
+ __createBinding(result, mod, k[i]);
639
648
  }
640
649
  __setModuleDefault(result, mod);
641
650
  return result;
@@ -668,7 +677,7 @@ function __addDisposableResource(env, value, async) {
668
677
  if (value !== null && value !== void 0) {
669
678
  if (typeof value !== "object" && typeof value !== "function")
670
679
  throw new TypeError("Object expected.");
671
- var dispose;
680
+ var dispose, inner;
672
681
  if (async) {
673
682
  if (!Symbol.asyncDispose)
674
683
  throw new TypeError("Symbol.asyncDispose is not defined.");
@@ -678,9 +687,19 @@ function __addDisposableResource(env, value, async) {
678
687
  if (!Symbol.dispose)
679
688
  throw new TypeError("Symbol.dispose is not defined.");
680
689
  dispose = value[Symbol.dispose];
690
+ if (async)
691
+ inner = dispose;
681
692
  }
682
693
  if (typeof dispose !== "function")
683
694
  throw new TypeError("Object not disposable.");
695
+ if (inner)
696
+ dispose = function() {
697
+ try {
698
+ inner.call(this);
699
+ } catch (e) {
700
+ return Promise.reject(e);
701
+ }
702
+ };
684
703
  env.stack.push({ value, dispose, async });
685
704
  } else if (async) {
686
705
  env.stack.push({ async: true });
@@ -692,26 +711,41 @@ function __disposeResources(env) {
692
711
  env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
693
712
  env.hasError = true;
694
713
  }
714
+ var r, s = 0;
695
715
  function next() {
696
- while (env.stack.length) {
697
- var rec = env.stack.pop();
716
+ while (r = env.stack.pop()) {
698
717
  try {
699
- var result = rec.dispose && rec.dispose.call(rec.value);
700
- if (rec.async)
701
- return Promise.resolve(result).then(next, function(e) {
702
- fail(e);
703
- return next();
704
- });
718
+ if (!r.async && s === 1)
719
+ return s = 0, env.stack.push(r), Promise.resolve().then(next);
720
+ if (r.dispose) {
721
+ var result = r.dispose.call(r.value);
722
+ if (r.async)
723
+ return s |= 2, Promise.resolve(result).then(next, function(e) {
724
+ fail(e);
725
+ return next();
726
+ });
727
+ } else
728
+ s |= 1;
705
729
  } catch (e) {
706
730
  fail(e);
707
731
  }
708
732
  }
733
+ if (s === 1)
734
+ return env.hasError ? Promise.reject(env.error) : Promise.resolve();
709
735
  if (env.hasError)
710
736
  throw env.error;
711
737
  }
712
738
  return next();
713
739
  }
714
- var extendStatics, __assign, __createBinding, __setModuleDefault, _SuppressedError, tslib_es6_default;
740
+ function __rewriteRelativeImportExtension(path3, preserveJsx) {
741
+ if (typeof path3 === "string" && /^\.\.?\//.test(path3)) {
742
+ return path3.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {
743
+ return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js";
744
+ });
745
+ }
746
+ return path3;
747
+ }
748
+ var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default;
715
749
  var init_tslib_es6 = __esm({
716
750
  "../../node_modules/tslib/tslib.es6.mjs"() {
717
751
  extendStatics = function(d, b) {
@@ -756,6 +790,16 @@ var init_tslib_es6 = __esm({
756
790
  } : function(o, v) {
757
791
  o["default"] = v;
758
792
  };
793
+ ownKeys = function(o) {
794
+ ownKeys = Object.getOwnPropertyNames || function(o2) {
795
+ var ar = [];
796
+ for (var k in o2)
797
+ if (Object.prototype.hasOwnProperty.call(o2, k))
798
+ ar[ar.length] = k;
799
+ return ar;
800
+ };
801
+ return ownKeys(o);
802
+ };
759
803
  _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
760
804
  var e = new Error(message);
761
805
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
@@ -766,6 +810,10 @@ var init_tslib_es6 = __esm({
766
810
  __rest,
767
811
  __decorate,
768
812
  __param,
813
+ __esDecorate,
814
+ __runInitializers,
815
+ __propKey,
816
+ __setFunctionName,
769
817
  __metadata,
770
818
  __awaiter,
771
819
  __generator,
@@ -787,7 +835,8 @@ var init_tslib_es6 = __esm({
787
835
  __classPrivateFieldSet,
788
836
  __classPrivateFieldIn,
789
837
  __addDisposableResource,
790
- __disposeResources
838
+ __disposeResources,
839
+ __rewriteRelativeImportExtension
791
840
  };
792
841
  }
793
842
  });
@@ -1859,7 +1908,7 @@ var require_Endpoint = __commonJS({
1859
1908
  // ../../node_modules/obliterator/iterator.js
1860
1909
  var require_iterator = __commonJS({
1861
1910
  "../../node_modules/obliterator/iterator.js"(exports, module2) {
1862
- function Iterator(next) {
1911
+ function Iterator2(next) {
1863
1912
  Object.defineProperty(this, "_next", {
1864
1913
  writable: false,
1865
1914
  enumerable: false,
@@ -1867,7 +1916,7 @@ var require_iterator = __commonJS({
1867
1916
  });
1868
1917
  this.done = false;
1869
1918
  }
1870
- Iterator.prototype.next = function() {
1919
+ Iterator2.prototype.next = function() {
1871
1920
  if (this.done)
1872
1921
  return { done: true };
1873
1922
  var step = this._next();
@@ -1876,28 +1925,28 @@ var require_iterator = __commonJS({
1876
1925
  return step;
1877
1926
  };
1878
1927
  if (typeof Symbol !== "undefined")
1879
- Iterator.prototype[Symbol.iterator] = function() {
1928
+ Iterator2.prototype[Symbol.iterator] = function() {
1880
1929
  return this;
1881
1930
  };
1882
- Iterator.of = function() {
1931
+ Iterator2.of = function() {
1883
1932
  var args = arguments, l = args.length, i = 0;
1884
- return new Iterator(function() {
1933
+ return new Iterator2(function() {
1885
1934
  if (i >= l)
1886
1935
  return { done: true };
1887
1936
  return { done: false, value: args[i++] };
1888
1937
  });
1889
1938
  };
1890
- Iterator.empty = function() {
1891
- var iterator = new Iterator(null);
1939
+ Iterator2.empty = function() {
1940
+ var iterator = new Iterator2(null);
1892
1941
  iterator.done = true;
1893
1942
  return iterator;
1894
1943
  };
1895
- Iterator.is = function(value) {
1896
- if (value instanceof Iterator)
1944
+ Iterator2.is = function(value) {
1945
+ if (value instanceof Iterator2)
1897
1946
  return true;
1898
1947
  return typeof value === "object" && value !== null && typeof value.next === "function";
1899
1948
  };
1900
- module2.exports = Iterator;
1949
+ module2.exports = Iterator2;
1901
1950
  }
1902
1951
  });
1903
1952
 
@@ -2124,7 +2173,7 @@ var require_iterables = __commonJS({
2124
2173
  // ../../node_modules/mnemonist/lru-cache.js
2125
2174
  var require_lru_cache = __commonJS({
2126
2175
  "../../node_modules/mnemonist/lru-cache.js"(exports, module2) {
2127
- var Iterator = require_iterator();
2176
+ var Iterator2 = require_iterator();
2128
2177
  var forEach = require_foreach();
2129
2178
  var typed = require_typed_arrays();
2130
2179
  var iterables = require_iterables();
@@ -2250,7 +2299,7 @@ var require_lru_cache = __commonJS({
2250
2299
  LRUCache.prototype.keys = function() {
2251
2300
  var i = 0, l = this.size;
2252
2301
  var pointer = this.head, keys = this.K, forward = this.forward;
2253
- return new Iterator(function() {
2302
+ return new Iterator2(function() {
2254
2303
  if (i >= l)
2255
2304
  return { done: true };
2256
2305
  var key = keys[pointer];
@@ -2266,7 +2315,7 @@ var require_lru_cache = __commonJS({
2266
2315
  LRUCache.prototype.values = function() {
2267
2316
  var i = 0, l = this.size;
2268
2317
  var pointer = this.head, values = this.V, forward = this.forward;
2269
- return new Iterator(function() {
2318
+ return new Iterator2(function() {
2270
2319
  if (i >= l)
2271
2320
  return { done: true };
2272
2321
  var value = values[pointer];
@@ -2282,7 +2331,7 @@ var require_lru_cache = __commonJS({
2282
2331
  LRUCache.prototype.entries = function() {
2283
2332
  var i = 0, l = this.size;
2284
2333
  var pointer = this.head, keys = this.K, values = this.V, forward = this.forward;
2285
- return new Iterator(function() {
2334
+ return new Iterator2(function() {
2286
2335
  if (i >= l)
2287
2336
  return { done: true };
2288
2337
  var key = keys[pointer], value = values[pointer];
@@ -124629,7 +124678,16 @@ var Env = {
124629
124678
  Analytics: {
124630
124679
  CloudFrontId: "ANALYTICS_CLOUD_FRONT_ID",
124631
124680
  CloudFrontSourceBucket: "ANALYTICS_CLOUD_FRONT_SOURCE_BUCKET",
124632
- CacheBucket: "ANALYTICS_CACHE_BUCKET"
124681
+ /** Where to store the analytic cache data */
124682
+ CacheBucket: "ANALYTICS_CACHE_BUCKET",
124683
+ /** Max number of records to process in the analytics process */
124684
+ MaxRecords: "ANALYTICS_MAX_RECORDS",
124685
+ /** Elastic server Id */
124686
+ ElasticId: "ELASTIC_ID",
124687
+ /** ElasticSearch's API key */
124688
+ ElasticApiKey: "ELASTIC_API_KEY",
124689
+ /** Index to use for storing analytic data */
124690
+ ElasticIndexName: "ELASTIC_INDEX_NAME"
124633
124691
  },
124634
124692
  /** Load a environment var defaulting to defaultOutput if it does not exist */
124635
124693
  get(envName) {
@@ -130842,9 +130900,16 @@ credentials.onFileSystemFound = (acc, fs4, path3) => {
130842
130900
  applyS3MiddleWare(fs4);
130843
130901
  fsa.register(acc.prefix, fs4);
130844
130902
  };
130903
+ function splitConfig(x) {
130904
+ if (x.startsWith("["))
130905
+ return JSON.parse(x);
130906
+ return x.split(",");
130907
+ }
130845
130908
  var credentialPath = Env.get(Env.AwsRoleConfigPath);
130846
- if (credentialPath)
130847
- credentials.registerConfig(fsa.toUrl(credentialPath), s3Fs);
130909
+ if (credentialPath) {
130910
+ for (const loc of splitConfig(credentialPath))
130911
+ credentials.registerConfig(fsa.toUrl(loc), s3Fs);
130912
+ }
130848
130913
  s3Fs.credentials = credentials;
130849
130914
  fsa.register("https://", new FsHttp());
130850
130915
  fsa.register("s3://", s3Fs);
@@ -131882,16 +131947,11 @@ var CHAR_2 = "2".charCodeAt(0);
131882
131947
  var CHAR_3 = "3".charCodeAt(0);
131883
131948
 
131884
131949
  // ../geo/build/xy.order.js
131885
- var XyOrder;
131886
- (function(XyOrder2) {
131887
- XyOrder2[XyOrder2["Xy"] = 0] = "Xy";
131888
- XyOrder2[XyOrder2["Yx"] = 1] = "Yx";
131889
- })(XyOrder || (XyOrder = {}));
131890
131950
  function getXyOrder(epsg) {
131891
- if (epsg === Epsg.Nztm2000) {
131892
- return XyOrder.Yx;
131893
- }
131894
- return XyOrder.Xy;
131951
+ const code = typeof epsg === "number" ? epsg : epsg.code;
131952
+ if (code === EpsgCode.Nztm2000 || code === EpsgCode.Citm2000)
131953
+ return "yx";
131954
+ return "xy";
131895
131955
  }
131896
131956
 
131897
131957
  // ../geo/build/tile.matrix.set.js
@@ -131971,7 +132031,7 @@ var TileMatrixSet = class {
131971
132031
  if (projection == null)
131972
132032
  throw new Error(`Unable to find supported projection ${def.supportedCRS}`);
131973
132033
  this.projection = projection;
131974
- if (getXyOrder(this.projection) === XyOrder.Yx) {
132034
+ if (getXyOrder(this.projection) === "yx") {
131975
132035
  this.indexX = 1;
131976
132036
  this.indexY = 0;
131977
132037
  }
@@ -132171,6 +132231,204 @@ var TileMatrixSet = class {
132171
132231
  }
132172
132232
  };
132173
132233
 
132234
+ // ../geo/build/tms/citm2000.js
132235
+ var Citm2000Tmst = {
132236
+ type: "TileMatrixSetType",
132237
+ title: "Debug tile matrix for EPSG:3793",
132238
+ abstract: "",
132239
+ identifier: "CITM2000Quad",
132240
+ supportedCRS: "https://www.opengis.net/def/crs/EPSG/0/3793",
132241
+ boundingBox: {
132242
+ type: "BoundingBoxType",
132243
+ crs: "https://www.opengis.net/def/crs/EPSG/0/3793",
132244
+ lowerCorner: [5051234111622438e-9, 3.4301543757978342e6],
132245
+ upperCorner: [5207777145550478e-9, 3.5866974097258747e6]
132246
+ },
132247
+ tileMatrix: [
132248
+ {
132249
+ type: "TileMatrixType",
132250
+ identifier: "0",
132251
+ scaleDenominator: 218391509386217e-8,
132252
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132253
+ tileWidth: 256,
132254
+ tileHeight: 256,
132255
+ matrixWidth: 1,
132256
+ matrixHeight: 1
132257
+ },
132258
+ {
132259
+ type: "TileMatrixType",
132260
+ identifier: "1",
132261
+ scaleDenominator: 109195754693108e-8,
132262
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132263
+ tileWidth: 256,
132264
+ tileHeight: 256,
132265
+ matrixWidth: 2,
132266
+ matrixHeight: 2
132267
+ },
132268
+ {
132269
+ type: "TileMatrixType",
132270
+ identifier: "2",
132271
+ scaleDenominator: 545978.773465544,
132272
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132273
+ tileWidth: 256,
132274
+ tileHeight: 256,
132275
+ matrixWidth: 4,
132276
+ matrixHeight: 4
132277
+ },
132278
+ {
132279
+ type: "TileMatrixType",
132280
+ identifier: "3",
132281
+ scaleDenominator: 272989.386732772,
132282
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132283
+ tileWidth: 256,
132284
+ tileHeight: 256,
132285
+ matrixWidth: 8,
132286
+ matrixHeight: 8
132287
+ },
132288
+ {
132289
+ type: "TileMatrixType",
132290
+ identifier: "4",
132291
+ scaleDenominator: 136494.693366386,
132292
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132293
+ tileWidth: 256,
132294
+ tileHeight: 256,
132295
+ matrixWidth: 16,
132296
+ matrixHeight: 16
132297
+ },
132298
+ {
132299
+ type: "TileMatrixType",
132300
+ identifier: "5",
132301
+ scaleDenominator: 68247.346683193,
132302
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132303
+ tileWidth: 256,
132304
+ tileHeight: 256,
132305
+ matrixWidth: 32,
132306
+ matrixHeight: 32
132307
+ },
132308
+ {
132309
+ type: "TileMatrixType",
132310
+ identifier: "6",
132311
+ scaleDenominator: 34123.6733415964,
132312
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132313
+ tileWidth: 256,
132314
+ tileHeight: 256,
132315
+ matrixWidth: 64,
132316
+ matrixHeight: 64
132317
+ },
132318
+ {
132319
+ type: "TileMatrixType",
132320
+ identifier: "7",
132321
+ scaleDenominator: 17061.8366707982,
132322
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132323
+ tileWidth: 256,
132324
+ tileHeight: 256,
132325
+ matrixWidth: 128,
132326
+ matrixHeight: 128
132327
+ },
132328
+ {
132329
+ type: "TileMatrixType",
132330
+ identifier: "8",
132331
+ scaleDenominator: 8530.91833539913,
132332
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132333
+ tileWidth: 256,
132334
+ tileHeight: 256,
132335
+ matrixWidth: 256,
132336
+ matrixHeight: 256
132337
+ },
132338
+ {
132339
+ type: "TileMatrixType",
132340
+ identifier: "9",
132341
+ scaleDenominator: 4265.45916769956,
132342
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132343
+ tileWidth: 256,
132344
+ tileHeight: 256,
132345
+ matrixWidth: 512,
132346
+ matrixHeight: 512
132347
+ },
132348
+ {
132349
+ type: "TileMatrixType",
132350
+ identifier: "10",
132351
+ scaleDenominator: 2132.72958384978,
132352
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132353
+ tileWidth: 256,
132354
+ tileHeight: 256,
132355
+ matrixWidth: 1024,
132356
+ matrixHeight: 1024
132357
+ },
132358
+ {
132359
+ type: "TileMatrixType",
132360
+ identifier: "11",
132361
+ scaleDenominator: 1066.36479192489,
132362
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132363
+ tileWidth: 256,
132364
+ tileHeight: 256,
132365
+ matrixWidth: 2048,
132366
+ matrixHeight: 2048
132367
+ },
132368
+ {
132369
+ type: "TileMatrixType",
132370
+ identifier: "12",
132371
+ scaleDenominator: 533.182395962445,
132372
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132373
+ tileWidth: 256,
132374
+ tileHeight: 256,
132375
+ matrixWidth: 4096,
132376
+ matrixHeight: 4096
132377
+ },
132378
+ {
132379
+ type: "TileMatrixType",
132380
+ identifier: "13",
132381
+ scaleDenominator: 266.591197981222,
132382
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132383
+ tileWidth: 256,
132384
+ tileHeight: 256,
132385
+ matrixWidth: 8192,
132386
+ matrixHeight: 8192
132387
+ },
132388
+ {
132389
+ type: "TileMatrixType",
132390
+ identifier: "14",
132391
+ scaleDenominator: 133.295598990611,
132392
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132393
+ tileWidth: 256,
132394
+ tileHeight: 256,
132395
+ matrixWidth: 16384,
132396
+ matrixHeight: 16384
132397
+ },
132398
+ {
132399
+ type: "TileMatrixType",
132400
+ identifier: "15",
132401
+ scaleDenominator: 66.6477994953056,
132402
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132403
+ tileWidth: 256,
132404
+ tileHeight: 256,
132405
+ matrixWidth: 32768,
132406
+ matrixHeight: 32768
132407
+ },
132408
+ {
132409
+ type: "TileMatrixType",
132410
+ identifier: "16",
132411
+ scaleDenominator: 33.3238997476528,
132412
+ topLeftCorner: [5207777145550478e-9, 3.4301543757978342e6],
132413
+ tileWidth: 256,
132414
+ tileHeight: 256,
132415
+ matrixWidth: 65536,
132416
+ matrixHeight: 65536
132417
+ }
132418
+ ],
132419
+ $generated: {
132420
+ package: "@basemaps/cli",
132421
+ version: "v7.14.0-4-g2766010d",
132422
+ hash: "2766010d8d2bb8b673f6bcbef2fe2636f2e0f4ea",
132423
+ createdAt: "2025-02-10T20:34:46.643Z"
132424
+ },
132425
+ $options: {
132426
+ sourceTileMatrix: "WebMercatorQuad",
132427
+ zoomOffset: 8
132428
+ }
132429
+ };
132430
+ var Citm2000Tms = new TileMatrixSet(Citm2000Tmst);
132431
+
132174
132432
  // ../geo/build/tms/google.js
132175
132433
  var GoogleTmst = {
132176
132434
  type: "TileMatrixSetType",
@@ -132447,11 +132705,12 @@ var Nztm2000QuadTms = new TileMatrixSet(Nztm20002.Nztm2000Quad);
132447
132705
  // ../geo/build/tms/index.js
132448
132706
  var TileMatrixSets = {
132449
132707
  /** All TileMatrixSets that are currently supported */
132450
- All: [GoogleTms, Nztm2000Tms, Nztm2000QuadTms],
132708
+ All: [GoogleTms, Nztm2000Tms, Nztm2000QuadTms, Citm2000Tms],
132451
132709
  /** Default mapping of EPSG code to Tile matrix set */
132452
132710
  Defaults: /* @__PURE__ */ new Map([
132453
132711
  [Epsg.Google.code, GoogleTms],
132454
- [Epsg.Nztm2000.code, Nztm2000Tms]
132712
+ [Epsg.Nztm2000.code, Nztm2000Tms],
132713
+ [Epsg.Citm2000.code, Citm2000Tms]
132455
132714
  ]),
132456
132715
  /**
132457
132716
  * Get a tile matrix set by EPSG Code
@@ -135043,10 +135302,11 @@ var ulid3 = __toESM(require_index_umd(), 1);
135043
135302
  var CliInfo = {
135044
135303
  // Detect unlinked packages looks for this string since its a package name, slightly work around it
135045
135304
  package: "@basemaps/cli",
135046
- version: "v7.12.0-12-g9c1d78fe",
135047
- hash: "9c1d78fe9e4cccb6309b761f17dc249681ce1769",
135048
- buildId: "12624609360-1"
135305
+ version: "v7.14.0-9-ga2fa0faa",
135306
+ hash: "a2fa0faa57e5591a50900fd469dbb9637b7d9c8e",
135307
+ buildId: "13911363896-1"
135049
135308
  };
135309
+ var CliDate = (/* @__PURE__ */ new Date()).toISOString();
135050
135310
  var CliId = ulid3.ulid();
135051
135311
 
135052
135312
  // src/cli.ts
@@ -135753,9 +136013,9 @@ var Router = class {
135753
136013
  };
135754
136014
 
135755
136015
  // ../../node_modules/@linzjs/lambda/build/src/function.js
135756
- var version2 = "v7.12.0-12-g9c1d78fe";
135757
- var hash = "9c1d78fe9e4cccb6309b761f17dc249681ce1769";
135758
- var buildId = "12624609360-1";
136016
+ var version2 = "v7.14.0-9-ga2fa0faa";
136017
+ var hash = "a2fa0faa57e5591a50900fd469dbb9637b7d9c8e";
136018
+ var buildId = "13911363896-1";
135759
136019
  var versionInfo = { version: version2, hash, buildId };
135760
136020
  async function runFunction(req, fn) {
135761
136021
  if (!req.timer.timers.has("lambda"))
@@ -138117,22 +138377,39 @@ var LercDecompressor = {
138117
138377
  async bytes(source, tile) {
138118
138378
  await import_lerc.default.load();
138119
138379
  const bytes = import_lerc.default.decode(tile);
138120
- if (bytes.pixelType !== "F32") {
138121
- throw new Error(`Lerc: Invalid output pixelType:${bytes.pixelType} from:${source.source.url.href}`);
138122
- }
138123
138380
  if (bytes.depthCount !== 1) {
138124
138381
  throw new Error(`Lerc: Invalid output depthCount:${bytes.depthCount} from:${source.source.url.href}`);
138125
138382
  }
138126
138383
  if (bytes.pixels.length !== 1) {
138127
138384
  throw new Error(`Lerc: Invalid output bandCount:${bytes.pixels.length} from:${source.source.url.href}`);
138128
138385
  }
138129
- return {
138130
- pixels: bytes.pixels[0],
138131
- width: bytes.width,
138132
- height: bytes.height,
138133
- channels: 1,
138134
- depth: "float32"
138135
- };
138386
+ switch (bytes.pixelType) {
138387
+ case "F32":
138388
+ return {
138389
+ pixels: bytes.pixels[0],
138390
+ width: bytes.width,
138391
+ height: bytes.height,
138392
+ channels: 1,
138393
+ depth: "float32"
138394
+ };
138395
+ case "U32":
138396
+ return {
138397
+ pixels: bytes.pixels[0],
138398
+ width: bytes.width,
138399
+ height: bytes.height,
138400
+ channels: 1,
138401
+ depth: "uint32"
138402
+ };
138403
+ case "U8":
138404
+ return {
138405
+ pixels: bytes.pixels[0],
138406
+ width: bytes.width,
138407
+ height: bytes.height,
138408
+ channels: 1,
138409
+ depth: "uint8"
138410
+ };
138411
+ }
138412
+ throw new Error(`Lerc: Invalid output pixelType:${bytes.pixelType} from:${source.source.url.href}`);
138136
138413
  }
138137
138414
  };
138138
138415
  var Decompressors = {
@@ -138150,8 +138427,6 @@ function cropResize(tiff, data, comp, mode) {
138150
138427
  }
138151
138428
  if (data.channels !== 1)
138152
138429
  throw new Error("Unable to crop-resize more than one channel got:" + data.channels);
138153
- if (data.depth !== "float32")
138154
- throw new Error("Unable to crop-resize other than float32 got:" + data.depth);
138155
138430
  const source = { x: 0, y: 0, width: data.width, height: data.height };
138156
138431
  const target = { width: 0, height: 0, scale: 1 };
138157
138432
  if (comp.extract) {
@@ -138197,7 +138472,8 @@ function resizeNearest(data, comp, source, target) {
138197
138472
  const maxWidth = Math.min(comp.source.width, data.width) - 1;
138198
138473
  const maxHeight = Math.min(comp.source.height, data.height) - 1;
138199
138474
  const invScale = 1 / target.scale;
138200
- const outputBuffer = new Float32Array(target.width * target.height);
138475
+ const ret = getOutputBuffer(data, target);
138476
+ const outputBuffer = ret.pixels;
138201
138477
  for (let y = 0; y < target.height; y++) {
138202
138478
  let sourceY = Math.round((y + 0.5) * invScale + source.y);
138203
138479
  if (sourceY > maxHeight)
@@ -138209,13 +138485,43 @@ function resizeNearest(data, comp, source, target) {
138209
138485
  outputBuffer[y * target.width + x] = data.pixels[sourceY * data.width + sourceX];
138210
138486
  }
138211
138487
  }
138212
- return { pixels: outputBuffer, width: target.width, height: target.height, depth: "float32", channels: 1 };
138488
+ return ret;
138489
+ }
138490
+ function getOutputBuffer(source, target) {
138491
+ switch (source.depth) {
138492
+ case "uint8":
138493
+ return {
138494
+ pixels: new Uint8Array(target.width * target.height),
138495
+ width: target.width,
138496
+ height: target.height,
138497
+ depth: source.depth,
138498
+ channels: 1
138499
+ };
138500
+ case "float32":
138501
+ return {
138502
+ pixels: new Float32Array(target.width * target.height),
138503
+ width: target.width,
138504
+ height: target.height,
138505
+ depth: source.depth,
138506
+ channels: 1
138507
+ };
138508
+ case "uint32":
138509
+ return {
138510
+ pixels: new Uint32Array(target.width * target.height),
138511
+ width: target.width,
138512
+ height: target.height,
138513
+ depth: source.depth,
138514
+ channels: 1
138515
+ };
138516
+ }
138213
138517
  }
138214
138518
  function resizeBilinear(data, comp, source, target, noData) {
138215
138519
  const invScale = 1 / target.scale;
138216
138520
  const maxWidth = Math.min(comp.source.width, data.width) - 2;
138217
138521
  const maxHeight = Math.min(comp.source.height, data.height) - 2;
138218
- const outputBuffer = new Float32Array(target.width * target.height);
138522
+ const ret = getOutputBuffer(data, target);
138523
+ const outputBuffer = ret.pixels;
138524
+ const needsRounding = !data.depth.startsWith("float");
138219
138525
  for (let y = 0; y < target.height; y++) {
138220
138526
  const sourceY = Math.min((y + 0.5) * invScale + source.y, maxHeight);
138221
138527
  const minY = Math.floor(sourceY);
@@ -138252,24 +138558,24 @@ function resizeBilinear(data, comp, source, target, noData) {
138252
138558
  const weightC = (1 - xDiff) * yDiff;
138253
138559
  const weightD = xDiff * yDiff;
138254
138560
  const pixel = minXMinY * weightA + maxXMinY * weightB + minXMaxY * weightC + maxXMaxY * weightD;
138255
- outputBuffer[outPx] = pixel;
138561
+ outputBuffer[outPx] = needsRounding ? Math.round(pixel) : pixel;
138256
138562
  }
138257
138563
  }
138258
- return { pixels: outputBuffer, width: target.width, height: target.height, depth: "float32", channels: 1 };
138564
+ return ret;
138259
138565
  }
138260
138566
 
138261
138567
  // ../tiler-sharp/build/pipeline/pipeline.color.ramp.js
138262
138568
  var ColorRamp = class {
138263
- constructor(ramp2) {
138569
+ constructor(ramp) {
138264
138570
  Object.defineProperty(this, "ramps", {
138265
138571
  enumerable: true,
138266
138572
  configurable: true,
138267
138573
  writable: true,
138268
138574
  value: []
138269
138575
  });
138270
- const ramps = ramp2.trim().split("\n");
138271
- for (const ramp3 of ramps) {
138272
- const parts = ramp3.trim().split(" ");
138576
+ const ramps = ramp.trim().split("\n");
138577
+ for (const ramp2 of ramps) {
138578
+ const parts = ramp2.trim().split(" ");
138273
138579
  const numbers = parts.map(Number);
138274
138580
  this.ramps.push({ v: numbers[0], color: numbers.slice(1) });
138275
138581
  }
@@ -138279,27 +138585,33 @@ var ColorRamp = class {
138279
138585
  if (num <= first.v)
138280
138586
  return first.color;
138281
138587
  for (let i = 0; i < this.ramps.length - 1; i++) {
138282
- const ramp2 = this.ramps[i];
138283
- if (num < ramp2.v)
138588
+ const ramp = this.ramps[i];
138589
+ if (num < ramp.v)
138284
138590
  continue;
138285
- if (ramp2.v === num)
138286
- return ramp2.color;
138591
+ if (ramp.v === num)
138592
+ return ramp.color;
138287
138593
  const rampNext = this.ramps[i + 1];
138288
138594
  if (num >= rampNext.v)
138289
138595
  continue;
138290
- const range = rampNext.v - ramp2.v;
138291
- const offset = num - ramp2.v;
138596
+ const range = rampNext.v - ramp.v;
138597
+ const offset = num - ramp.v;
138292
138598
  const scale = offset / range;
138293
- const r = Math.round((rampNext.color[0] - ramp2.color[0]) * scale + ramp2.color[0]);
138294
- const g = Math.round((rampNext.color[1] - ramp2.color[1]) * scale + ramp2.color[1]);
138295
- const b = Math.round((rampNext.color[2] - ramp2.color[2]) * scale + ramp2.color[2]);
138296
- const a = Math.round((rampNext.color[3] - ramp2.color[3]) * scale + ramp2.color[3]);
138599
+ const r = Math.round((rampNext.color[0] - ramp.color[0]) * scale + ramp.color[0]);
138600
+ const g = Math.round((rampNext.color[1] - ramp.color[1]) * scale + ramp.color[1]);
138601
+ const b = Math.round((rampNext.color[2] - ramp.color[2]) * scale + ramp.color[2]);
138602
+ const a = Math.round((rampNext.color[3] - ramp.color[3]) * scale + ramp.color[3]);
138297
138603
  return [r, g, b, a];
138298
138604
  }
138299
138605
  return this.ramps[this.ramps.length - 1].color;
138300
138606
  }
138301
138607
  };
138302
- var ramp = new ColorRamp(DefaultColorRamp);
138608
+ var Ramps = {
138609
+ float32: new ColorRamp(DefaultColorRamp),
138610
+ uint8: new ColorRamp(`0 0 0 0 255
138611
+ 255 255 255 255 255`),
138612
+ uint32: new ColorRamp(`0 0 0 0 255
138613
+ ${2 ** 32 - 1} 255 255 255 255`)
138614
+ };
138303
138615
  var PipelineColorRamp = {
138304
138616
  type: "color-ramp",
138305
138617
  process(comp, data) {
@@ -138311,6 +138623,7 @@ var PipelineColorRamp = {
138311
138623
  width: data.width,
138312
138624
  height: data.height
138313
138625
  };
138626
+ const ramp = Ramps[data.depth];
138314
138627
  const size = data.width * data.height;
138315
138628
  const noData = comp.asset.images[0].noData;
138316
138629
  for (let i = 0; i < size; i++) {
@@ -140046,17 +140359,17 @@ function versionGet() {
140046
140359
  * last git version tag
140047
140360
  * @example "v6.42.1"
140048
140361
  */
140049
- version: "v7.12.0-12-g9c1d78fe",
140362
+ version: "v7.14.0-9-ga2fa0faa",
140050
140363
  /**
140051
140364
  * Full git commit hash
140052
140365
  * @example "e4231b1ee62c276c8657c56677ced02681dfe5d6"
140053
140366
  */
140054
- hash: "9c1d78fe9e4cccb6309b761f17dc249681ce1769",
140367
+ hash: "a2fa0faa57e5591a50900fd469dbb9637b7d9c8e",
140055
140368
  /**
140056
140369
  * The exact build that this release was run from
140057
140370
  * @example "1658821493-3"
140058
140371
  */
140059
- buildId: "12624609360-1"
140372
+ buildId: "13911363896-1"
140060
140373
  });
140061
140374
  return Promise.resolve(response);
140062
140375
  }
@@ -140427,7 +140740,8 @@ var IgnoredTitles = /* @__PURE__ */ new Set([
140427
140740
  "flat",
140428
140741
  // Projections
140429
140742
  "2193",
140430
- "3857"
140743
+ "3857",
140744
+ "3793"
140431
140745
  ]);
140432
140746
  function getImageryName(target) {
140433
140747
  const parts = target.pathname.split("/");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basemaps/server",
3
- "version": "7.13.0",
3
+ "version": "7.15.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/linz/basemaps.git",
@@ -52,17 +52,17 @@
52
52
  "sharp": "^0.33.0"
53
53
  },
54
54
  "devDependencies": {
55
- "@basemaps/config": "^7.12.0",
56
- "@basemaps/config-loader": "^7.12.0",
57
- "@basemaps/geo": "^7.12.0",
58
- "@basemaps/lambda-tiler": "^7.13.0",
55
+ "@basemaps/config": "^7.15.0",
56
+ "@basemaps/config-loader": "^7.15.0",
57
+ "@basemaps/geo": "^7.15.0",
58
+ "@basemaps/lambda-tiler": "^7.15.0",
59
59
  "@basemaps/landing": "^6.39.0",
60
- "@basemaps/shared": "^7.12.0",
60
+ "@basemaps/shared": "^7.15.0",
61
61
  "@fastify/formbody": "^7.0.1",
62
62
  "@fastify/static": "^6.5.0",
63
63
  "cmd-ts": "^0.12.1",
64
64
  "fastify": "^4.9.2",
65
65
  "pretty-json-log": "^1.0.0"
66
66
  },
67
- "gitHead": "9c1d78fe9e4cccb6309b761f17dc249681ce1769"
67
+ "gitHead": "a2fa0faa57e5591a50900fd469dbb9637b7d9c8e"
68
68
  }