@basemaps/lambda-tiler 7.13.0 → 7.14.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.
- package/CHANGELOG.md +8 -0
- package/dist/index.js +183 -72
- package/dist/node_modules/.package-lock.json +1 -1
- package/dist/package-lock.json +2 -2
- package/dist/package.json +1 -1
- package/package.json +6 -6
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [7.14.0](https://github.com/linz/basemaps/compare/v7.13.0...v7.14.0) (2025-01-26)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @basemaps/lambda-tiler
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [7.13.0](https://github.com/linz/basemaps/compare/v7.12.0...v7.13.0) (2025-01-06)
|
|
7
15
|
|
|
8
16
|
|
package/dist/index.js
CHANGED
|
@@ -269,6 +269,7 @@ __export(tslib_es6_exports, {
|
|
|
269
269
|
__propKey: () => __propKey,
|
|
270
270
|
__read: () => __read,
|
|
271
271
|
__rest: () => __rest,
|
|
272
|
+
__rewriteRelativeImportExtension: () => __rewriteRelativeImportExtension,
|
|
272
273
|
__runInitializers: () => __runInitializers,
|
|
273
274
|
__setFunctionName: () => __setFunctionName,
|
|
274
275
|
__spread: () => __spread,
|
|
@@ -408,8 +409,8 @@ function __generator(thisArg, body) {
|
|
|
408
409
|
if (t[0] & 1)
|
|
409
410
|
throw t[1];
|
|
410
411
|
return t[1];
|
|
411
|
-
}, trys: [], ops: [] }, f, y, t, g;
|
|
412
|
-
return g =
|
|
412
|
+
}, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
413
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
413
414
|
return this;
|
|
414
415
|
}), g;
|
|
415
416
|
function verb(n) {
|
|
@@ -550,16 +551,24 @@ function __asyncGenerator(thisArg, _arguments, generator) {
|
|
|
550
551
|
if (!Symbol.asyncIterator)
|
|
551
552
|
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
552
553
|
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
553
|
-
return i =
|
|
554
|
+
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function() {
|
|
554
555
|
return this;
|
|
555
556
|
}, i;
|
|
556
|
-
function
|
|
557
|
-
|
|
557
|
+
function awaitReturn(f) {
|
|
558
|
+
return function(v) {
|
|
559
|
+
return Promise.resolve(v).then(f, reject);
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
function verb(n, f) {
|
|
563
|
+
if (g[n]) {
|
|
558
564
|
i[n] = function(v) {
|
|
559
565
|
return new Promise(function(a, b) {
|
|
560
566
|
q.push([n, v, a, b]) > 1 || resume(n, v);
|
|
561
567
|
});
|
|
562
568
|
};
|
|
569
|
+
if (f)
|
|
570
|
+
i[n] = f(i[n]);
|
|
571
|
+
}
|
|
563
572
|
}
|
|
564
573
|
function resume(n, v) {
|
|
565
574
|
try {
|
|
@@ -628,9 +637,9 @@ function __importStar(mod) {
|
|
|
628
637
|
return mod;
|
|
629
638
|
var result = {};
|
|
630
639
|
if (mod != null) {
|
|
631
|
-
for (var k
|
|
632
|
-
if (k !== "default"
|
|
633
|
-
__createBinding(result, mod, k);
|
|
640
|
+
for (var k = ownKeys(mod), i = 0; i < k.length; i++)
|
|
641
|
+
if (k[i] !== "default")
|
|
642
|
+
__createBinding(result, mod, k[i]);
|
|
634
643
|
}
|
|
635
644
|
__setModuleDefault(result, mod);
|
|
636
645
|
return result;
|
|
@@ -663,7 +672,7 @@ function __addDisposableResource(env, value, async) {
|
|
|
663
672
|
if (value !== null && value !== void 0) {
|
|
664
673
|
if (typeof value !== "object" && typeof value !== "function")
|
|
665
674
|
throw new TypeError("Object expected.");
|
|
666
|
-
var dispose;
|
|
675
|
+
var dispose, inner;
|
|
667
676
|
if (async) {
|
|
668
677
|
if (!Symbol.asyncDispose)
|
|
669
678
|
throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
@@ -673,9 +682,19 @@ function __addDisposableResource(env, value, async) {
|
|
|
673
682
|
if (!Symbol.dispose)
|
|
674
683
|
throw new TypeError("Symbol.dispose is not defined.");
|
|
675
684
|
dispose = value[Symbol.dispose];
|
|
685
|
+
if (async)
|
|
686
|
+
inner = dispose;
|
|
676
687
|
}
|
|
677
688
|
if (typeof dispose !== "function")
|
|
678
689
|
throw new TypeError("Object not disposable.");
|
|
690
|
+
if (inner)
|
|
691
|
+
dispose = function() {
|
|
692
|
+
try {
|
|
693
|
+
inner.call(this);
|
|
694
|
+
} catch (e) {
|
|
695
|
+
return Promise.reject(e);
|
|
696
|
+
}
|
|
697
|
+
};
|
|
679
698
|
env.stack.push({ value, dispose, async });
|
|
680
699
|
} else if (async) {
|
|
681
700
|
env.stack.push({ async: true });
|
|
@@ -687,26 +706,41 @@ function __disposeResources(env) {
|
|
|
687
706
|
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
688
707
|
env.hasError = true;
|
|
689
708
|
}
|
|
709
|
+
var r, s = 0;
|
|
690
710
|
function next() {
|
|
691
|
-
while (env.stack.
|
|
692
|
-
var rec = env.stack.pop();
|
|
711
|
+
while (r = env.stack.pop()) {
|
|
693
712
|
try {
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
713
|
+
if (!r.async && s === 1)
|
|
714
|
+
return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
715
|
+
if (r.dispose) {
|
|
716
|
+
var result = r.dispose.call(r.value);
|
|
717
|
+
if (r.async)
|
|
718
|
+
return s |= 2, Promise.resolve(result).then(next, function(e) {
|
|
719
|
+
fail(e);
|
|
720
|
+
return next();
|
|
721
|
+
});
|
|
722
|
+
} else
|
|
723
|
+
s |= 1;
|
|
700
724
|
} catch (e) {
|
|
701
725
|
fail(e);
|
|
702
726
|
}
|
|
703
727
|
}
|
|
728
|
+
if (s === 1)
|
|
729
|
+
return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
704
730
|
if (env.hasError)
|
|
705
731
|
throw env.error;
|
|
706
732
|
}
|
|
707
733
|
return next();
|
|
708
734
|
}
|
|
709
|
-
|
|
735
|
+
function __rewriteRelativeImportExtension(path2, preserveJsx) {
|
|
736
|
+
if (typeof path2 === "string" && /^\.\.?\//.test(path2)) {
|
|
737
|
+
return path2.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {
|
|
738
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js";
|
|
739
|
+
});
|
|
740
|
+
}
|
|
741
|
+
return path2;
|
|
742
|
+
}
|
|
743
|
+
var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default;
|
|
710
744
|
var init_tslib_es6 = __esm({
|
|
711
745
|
"../../node_modules/tslib/tslib.es6.mjs"() {
|
|
712
746
|
extendStatics = function(d, b) {
|
|
@@ -751,6 +785,16 @@ var init_tslib_es6 = __esm({
|
|
|
751
785
|
} : function(o, v) {
|
|
752
786
|
o["default"] = v;
|
|
753
787
|
};
|
|
788
|
+
ownKeys = function(o) {
|
|
789
|
+
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
790
|
+
var ar = [];
|
|
791
|
+
for (var k in o2)
|
|
792
|
+
if (Object.prototype.hasOwnProperty.call(o2, k))
|
|
793
|
+
ar[ar.length] = k;
|
|
794
|
+
return ar;
|
|
795
|
+
};
|
|
796
|
+
return ownKeys(o);
|
|
797
|
+
};
|
|
754
798
|
_SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
755
799
|
var e = new Error(message);
|
|
756
800
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
@@ -761,6 +805,10 @@ var init_tslib_es6 = __esm({
|
|
|
761
805
|
__rest,
|
|
762
806
|
__decorate,
|
|
763
807
|
__param,
|
|
808
|
+
__esDecorate,
|
|
809
|
+
__runInitializers,
|
|
810
|
+
__propKey,
|
|
811
|
+
__setFunctionName,
|
|
764
812
|
__metadata,
|
|
765
813
|
__awaiter,
|
|
766
814
|
__generator,
|
|
@@ -782,7 +830,8 @@ var init_tslib_es6 = __esm({
|
|
|
782
830
|
__classPrivateFieldSet,
|
|
783
831
|
__classPrivateFieldIn,
|
|
784
832
|
__addDisposableResource,
|
|
785
|
-
__disposeResources
|
|
833
|
+
__disposeResources,
|
|
834
|
+
__rewriteRelativeImportExtension
|
|
786
835
|
};
|
|
787
836
|
}
|
|
788
837
|
});
|
|
@@ -1854,7 +1903,7 @@ var require_Endpoint = __commonJS({
|
|
|
1854
1903
|
// ../../node_modules/obliterator/iterator.js
|
|
1855
1904
|
var require_iterator = __commonJS({
|
|
1856
1905
|
"../../node_modules/obliterator/iterator.js"(exports, module2) {
|
|
1857
|
-
function
|
|
1906
|
+
function Iterator2(next) {
|
|
1858
1907
|
Object.defineProperty(this, "_next", {
|
|
1859
1908
|
writable: false,
|
|
1860
1909
|
enumerable: false,
|
|
@@ -1862,7 +1911,7 @@ var require_iterator = __commonJS({
|
|
|
1862
1911
|
});
|
|
1863
1912
|
this.done = false;
|
|
1864
1913
|
}
|
|
1865
|
-
|
|
1914
|
+
Iterator2.prototype.next = function() {
|
|
1866
1915
|
if (this.done)
|
|
1867
1916
|
return { done: true };
|
|
1868
1917
|
var step = this._next();
|
|
@@ -1871,28 +1920,28 @@ var require_iterator = __commonJS({
|
|
|
1871
1920
|
return step;
|
|
1872
1921
|
};
|
|
1873
1922
|
if (typeof Symbol !== "undefined")
|
|
1874
|
-
|
|
1923
|
+
Iterator2.prototype[Symbol.iterator] = function() {
|
|
1875
1924
|
return this;
|
|
1876
1925
|
};
|
|
1877
|
-
|
|
1926
|
+
Iterator2.of = function() {
|
|
1878
1927
|
var args = arguments, l = args.length, i = 0;
|
|
1879
|
-
return new
|
|
1928
|
+
return new Iterator2(function() {
|
|
1880
1929
|
if (i >= l)
|
|
1881
1930
|
return { done: true };
|
|
1882
1931
|
return { done: false, value: args[i++] };
|
|
1883
1932
|
});
|
|
1884
1933
|
};
|
|
1885
|
-
|
|
1886
|
-
var iterator = new
|
|
1934
|
+
Iterator2.empty = function() {
|
|
1935
|
+
var iterator = new Iterator2(null);
|
|
1887
1936
|
iterator.done = true;
|
|
1888
1937
|
return iterator;
|
|
1889
1938
|
};
|
|
1890
|
-
|
|
1891
|
-
if (value instanceof
|
|
1939
|
+
Iterator2.is = function(value) {
|
|
1940
|
+
if (value instanceof Iterator2)
|
|
1892
1941
|
return true;
|
|
1893
1942
|
return typeof value === "object" && value !== null && typeof value.next === "function";
|
|
1894
1943
|
};
|
|
1895
|
-
module2.exports =
|
|
1944
|
+
module2.exports = Iterator2;
|
|
1896
1945
|
}
|
|
1897
1946
|
});
|
|
1898
1947
|
|
|
@@ -2119,7 +2168,7 @@ var require_iterables = __commonJS({
|
|
|
2119
2168
|
// ../../node_modules/mnemonist/lru-cache.js
|
|
2120
2169
|
var require_lru_cache = __commonJS({
|
|
2121
2170
|
"../../node_modules/mnemonist/lru-cache.js"(exports, module2) {
|
|
2122
|
-
var
|
|
2171
|
+
var Iterator2 = require_iterator();
|
|
2123
2172
|
var forEach = require_foreach();
|
|
2124
2173
|
var typed = require_typed_arrays();
|
|
2125
2174
|
var iterables = require_iterables();
|
|
@@ -2245,7 +2294,7 @@ var require_lru_cache = __commonJS({
|
|
|
2245
2294
|
LRUCache.prototype.keys = function() {
|
|
2246
2295
|
var i = 0, l = this.size;
|
|
2247
2296
|
var pointer = this.head, keys = this.K, forward = this.forward;
|
|
2248
|
-
return new
|
|
2297
|
+
return new Iterator2(function() {
|
|
2249
2298
|
if (i >= l)
|
|
2250
2299
|
return { done: true };
|
|
2251
2300
|
var key = keys[pointer];
|
|
@@ -2261,7 +2310,7 @@ var require_lru_cache = __commonJS({
|
|
|
2261
2310
|
LRUCache.prototype.values = function() {
|
|
2262
2311
|
var i = 0, l = this.size;
|
|
2263
2312
|
var pointer = this.head, values = this.V, forward = this.forward;
|
|
2264
|
-
return new
|
|
2313
|
+
return new Iterator2(function() {
|
|
2265
2314
|
if (i >= l)
|
|
2266
2315
|
return { done: true };
|
|
2267
2316
|
var value = values[pointer];
|
|
@@ -2277,7 +2326,7 @@ var require_lru_cache = __commonJS({
|
|
|
2277
2326
|
LRUCache.prototype.entries = function() {
|
|
2278
2327
|
var i = 0, l = this.size;
|
|
2279
2328
|
var pointer = this.head, keys = this.K, values = this.V, forward = this.forward;
|
|
2280
|
-
return new
|
|
2329
|
+
return new Iterator2(function() {
|
|
2281
2330
|
if (i >= l)
|
|
2282
2331
|
return { done: true };
|
|
2283
2332
|
var key = keys[pointer], value = values[pointer];
|
|
@@ -71136,7 +71185,16 @@ var Env = {
|
|
|
71136
71185
|
Analytics: {
|
|
71137
71186
|
CloudFrontId: "ANALYTICS_CLOUD_FRONT_ID",
|
|
71138
71187
|
CloudFrontSourceBucket: "ANALYTICS_CLOUD_FRONT_SOURCE_BUCKET",
|
|
71139
|
-
|
|
71188
|
+
/** Where to store the analytic cache data */
|
|
71189
|
+
CacheBucket: "ANALYTICS_CACHE_BUCKET",
|
|
71190
|
+
/** Max number of records to process in the analytics process */
|
|
71191
|
+
MaxRecords: "ANALYTICS_MAX_RECORDS",
|
|
71192
|
+
/** Elastic server Id */
|
|
71193
|
+
ElasticId: "ELASTIC_ID",
|
|
71194
|
+
/** ElasticSearch's API key */
|
|
71195
|
+
ElasticApiKey: "ELASTIC_API_KEY",
|
|
71196
|
+
/** Index to use for storing analytic data */
|
|
71197
|
+
ElasticIndexName: "ELASTIC_INDEX_NAME"
|
|
71140
71198
|
},
|
|
71141
71199
|
/** Load a environment var defaulting to defaultOutput if it does not exist */
|
|
71142
71200
|
get(envName) {
|
|
@@ -82210,9 +82268,9 @@ var Router = class {
|
|
|
82210
82268
|
};
|
|
82211
82269
|
|
|
82212
82270
|
// ../../node_modules/@linzjs/lambda/build/src/function.js
|
|
82213
|
-
var version2 = "v7.
|
|
82214
|
-
var hash = "
|
|
82215
|
-
var buildId = "
|
|
82271
|
+
var version2 = "v7.13.0-9-g72f2a811";
|
|
82272
|
+
var hash = "72f2a811d4851c6f50758617c9e65179d2b27bc8";
|
|
82273
|
+
var buildId = "12978670711-1";
|
|
82216
82274
|
var versionInfo = { version: version2, hash, buildId };
|
|
82217
82275
|
async function runFunction(req, fn) {
|
|
82218
82276
|
if (!req.timer.timers.has("lambda"))
|
|
@@ -84521,22 +84579,39 @@ var LercDecompressor = {
|
|
|
84521
84579
|
async bytes(source, tile) {
|
|
84522
84580
|
await import_lerc.default.load();
|
|
84523
84581
|
const bytes = import_lerc.default.decode(tile);
|
|
84524
|
-
if (bytes.pixelType !== "F32") {
|
|
84525
|
-
throw new Error(`Lerc: Invalid output pixelType:${bytes.pixelType} from:${source.source.url.href}`);
|
|
84526
|
-
}
|
|
84527
84582
|
if (bytes.depthCount !== 1) {
|
|
84528
84583
|
throw new Error(`Lerc: Invalid output depthCount:${bytes.depthCount} from:${source.source.url.href}`);
|
|
84529
84584
|
}
|
|
84530
84585
|
if (bytes.pixels.length !== 1) {
|
|
84531
84586
|
throw new Error(`Lerc: Invalid output bandCount:${bytes.pixels.length} from:${source.source.url.href}`);
|
|
84532
84587
|
}
|
|
84533
|
-
|
|
84534
|
-
|
|
84535
|
-
|
|
84536
|
-
|
|
84537
|
-
|
|
84538
|
-
|
|
84539
|
-
|
|
84588
|
+
switch (bytes.pixelType) {
|
|
84589
|
+
case "F32":
|
|
84590
|
+
return {
|
|
84591
|
+
pixels: bytes.pixels[0],
|
|
84592
|
+
width: bytes.width,
|
|
84593
|
+
height: bytes.height,
|
|
84594
|
+
channels: 1,
|
|
84595
|
+
depth: "float32"
|
|
84596
|
+
};
|
|
84597
|
+
case "U32":
|
|
84598
|
+
return {
|
|
84599
|
+
pixels: bytes.pixels[0],
|
|
84600
|
+
width: bytes.width,
|
|
84601
|
+
height: bytes.height,
|
|
84602
|
+
channels: 1,
|
|
84603
|
+
depth: "uint32"
|
|
84604
|
+
};
|
|
84605
|
+
case "U8":
|
|
84606
|
+
return {
|
|
84607
|
+
pixels: bytes.pixels[0],
|
|
84608
|
+
width: bytes.width,
|
|
84609
|
+
height: bytes.height,
|
|
84610
|
+
channels: 1,
|
|
84611
|
+
depth: "uint8"
|
|
84612
|
+
};
|
|
84613
|
+
}
|
|
84614
|
+
throw new Error(`Lerc: Invalid output pixelType:${bytes.pixelType} from:${source.source.url.href}`);
|
|
84540
84615
|
}
|
|
84541
84616
|
};
|
|
84542
84617
|
var Decompressors = {
|
|
@@ -84554,8 +84629,6 @@ function cropResize(tiff, data, comp, mode) {
|
|
|
84554
84629
|
}
|
|
84555
84630
|
if (data.channels !== 1)
|
|
84556
84631
|
throw new Error("Unable to crop-resize more than one channel got:" + data.channels);
|
|
84557
|
-
if (data.depth !== "float32")
|
|
84558
|
-
throw new Error("Unable to crop-resize other than float32 got:" + data.depth);
|
|
84559
84632
|
const source = { x: 0, y: 0, width: data.width, height: data.height };
|
|
84560
84633
|
const target = { width: 0, height: 0, scale: 1 };
|
|
84561
84634
|
if (comp.extract) {
|
|
@@ -84601,7 +84674,8 @@ function resizeNearest(data, comp, source, target) {
|
|
|
84601
84674
|
const maxWidth = Math.min(comp.source.width, data.width) - 1;
|
|
84602
84675
|
const maxHeight = Math.min(comp.source.height, data.height) - 1;
|
|
84603
84676
|
const invScale = 1 / target.scale;
|
|
84604
|
-
const
|
|
84677
|
+
const ret = getOutputBuffer(data, target);
|
|
84678
|
+
const outputBuffer = ret.pixels;
|
|
84605
84679
|
for (let y = 0; y < target.height; y++) {
|
|
84606
84680
|
let sourceY = Math.round((y + 0.5) * invScale + source.y);
|
|
84607
84681
|
if (sourceY > maxHeight)
|
|
@@ -84613,13 +84687,43 @@ function resizeNearest(data, comp, source, target) {
|
|
|
84613
84687
|
outputBuffer[y * target.width + x] = data.pixels[sourceY * data.width + sourceX];
|
|
84614
84688
|
}
|
|
84615
84689
|
}
|
|
84616
|
-
return
|
|
84690
|
+
return ret;
|
|
84691
|
+
}
|
|
84692
|
+
function getOutputBuffer(source, target) {
|
|
84693
|
+
switch (source.depth) {
|
|
84694
|
+
case "uint8":
|
|
84695
|
+
return {
|
|
84696
|
+
pixels: new Uint8Array(target.width * target.height),
|
|
84697
|
+
width: target.width,
|
|
84698
|
+
height: target.height,
|
|
84699
|
+
depth: source.depth,
|
|
84700
|
+
channels: 1
|
|
84701
|
+
};
|
|
84702
|
+
case "float32":
|
|
84703
|
+
return {
|
|
84704
|
+
pixels: new Float32Array(target.width * target.height),
|
|
84705
|
+
width: target.width,
|
|
84706
|
+
height: target.height,
|
|
84707
|
+
depth: source.depth,
|
|
84708
|
+
channels: 1
|
|
84709
|
+
};
|
|
84710
|
+
case "uint32":
|
|
84711
|
+
return {
|
|
84712
|
+
pixels: new Uint32Array(target.width * target.height),
|
|
84713
|
+
width: target.width,
|
|
84714
|
+
height: target.height,
|
|
84715
|
+
depth: source.depth,
|
|
84716
|
+
channels: 1
|
|
84717
|
+
};
|
|
84718
|
+
}
|
|
84617
84719
|
}
|
|
84618
84720
|
function resizeBilinear(data, comp, source, target, noData) {
|
|
84619
84721
|
const invScale = 1 / target.scale;
|
|
84620
84722
|
const maxWidth = Math.min(comp.source.width, data.width) - 2;
|
|
84621
84723
|
const maxHeight = Math.min(comp.source.height, data.height) - 2;
|
|
84622
|
-
const
|
|
84724
|
+
const ret = getOutputBuffer(data, target);
|
|
84725
|
+
const outputBuffer = ret.pixels;
|
|
84726
|
+
const needsRounding = !data.depth.startsWith("float");
|
|
84623
84727
|
for (let y = 0; y < target.height; y++) {
|
|
84624
84728
|
const sourceY = Math.min((y + 0.5) * invScale + source.y, maxHeight);
|
|
84625
84729
|
const minY = Math.floor(sourceY);
|
|
@@ -84656,24 +84760,24 @@ function resizeBilinear(data, comp, source, target, noData) {
|
|
|
84656
84760
|
const weightC = (1 - xDiff) * yDiff;
|
|
84657
84761
|
const weightD = xDiff * yDiff;
|
|
84658
84762
|
const pixel = minXMinY * weightA + maxXMinY * weightB + minXMaxY * weightC + maxXMaxY * weightD;
|
|
84659
|
-
outputBuffer[outPx] = pixel;
|
|
84763
|
+
outputBuffer[outPx] = needsRounding ? Math.round(pixel) : pixel;
|
|
84660
84764
|
}
|
|
84661
84765
|
}
|
|
84662
|
-
return
|
|
84766
|
+
return ret;
|
|
84663
84767
|
}
|
|
84664
84768
|
|
|
84665
84769
|
// ../tiler-sharp/build/pipeline/pipeline.color.ramp.js
|
|
84666
84770
|
var ColorRamp = class {
|
|
84667
|
-
constructor(
|
|
84771
|
+
constructor(ramp) {
|
|
84668
84772
|
Object.defineProperty(this, "ramps", {
|
|
84669
84773
|
enumerable: true,
|
|
84670
84774
|
configurable: true,
|
|
84671
84775
|
writable: true,
|
|
84672
84776
|
value: []
|
|
84673
84777
|
});
|
|
84674
|
-
const ramps =
|
|
84675
|
-
for (const
|
|
84676
|
-
const parts =
|
|
84778
|
+
const ramps = ramp.trim().split("\n");
|
|
84779
|
+
for (const ramp2 of ramps) {
|
|
84780
|
+
const parts = ramp2.trim().split(" ");
|
|
84677
84781
|
const numbers = parts.map(Number);
|
|
84678
84782
|
this.ramps.push({ v: numbers[0], color: numbers.slice(1) });
|
|
84679
84783
|
}
|
|
@@ -84683,27 +84787,33 @@ var ColorRamp = class {
|
|
|
84683
84787
|
if (num <= first.v)
|
|
84684
84788
|
return first.color;
|
|
84685
84789
|
for (let i = 0; i < this.ramps.length - 1; i++) {
|
|
84686
|
-
const
|
|
84687
|
-
if (num <
|
|
84790
|
+
const ramp = this.ramps[i];
|
|
84791
|
+
if (num < ramp.v)
|
|
84688
84792
|
continue;
|
|
84689
|
-
if (
|
|
84690
|
-
return
|
|
84793
|
+
if (ramp.v === num)
|
|
84794
|
+
return ramp.color;
|
|
84691
84795
|
const rampNext = this.ramps[i + 1];
|
|
84692
84796
|
if (num >= rampNext.v)
|
|
84693
84797
|
continue;
|
|
84694
|
-
const range = rampNext.v -
|
|
84695
|
-
const offset = num -
|
|
84798
|
+
const range = rampNext.v - ramp.v;
|
|
84799
|
+
const offset = num - ramp.v;
|
|
84696
84800
|
const scale = offset / range;
|
|
84697
|
-
const r = Math.round((rampNext.color[0] -
|
|
84698
|
-
const g = Math.round((rampNext.color[1] -
|
|
84699
|
-
const b = Math.round((rampNext.color[2] -
|
|
84700
|
-
const a = Math.round((rampNext.color[3] -
|
|
84801
|
+
const r = Math.round((rampNext.color[0] - ramp.color[0]) * scale + ramp.color[0]);
|
|
84802
|
+
const g = Math.round((rampNext.color[1] - ramp.color[1]) * scale + ramp.color[1]);
|
|
84803
|
+
const b = Math.round((rampNext.color[2] - ramp.color[2]) * scale + ramp.color[2]);
|
|
84804
|
+
const a = Math.round((rampNext.color[3] - ramp.color[3]) * scale + ramp.color[3]);
|
|
84701
84805
|
return [r, g, b, a];
|
|
84702
84806
|
}
|
|
84703
84807
|
return this.ramps[this.ramps.length - 1].color;
|
|
84704
84808
|
}
|
|
84705
84809
|
};
|
|
84706
|
-
var
|
|
84810
|
+
var Ramps = {
|
|
84811
|
+
float32: new ColorRamp(DefaultColorRamp),
|
|
84812
|
+
uint8: new ColorRamp(`0 0 0 0 255
|
|
84813
|
+
255 255 255 255 255`),
|
|
84814
|
+
uint32: new ColorRamp(`0 0 0 0 255
|
|
84815
|
+
${2 ** 32 - 1} 255 255 255 255`)
|
|
84816
|
+
};
|
|
84707
84817
|
var PipelineColorRamp = {
|
|
84708
84818
|
type: "color-ramp",
|
|
84709
84819
|
process(comp, data) {
|
|
@@ -84715,6 +84825,7 @@ var PipelineColorRamp = {
|
|
|
84715
84825
|
width: data.width,
|
|
84716
84826
|
height: data.height
|
|
84717
84827
|
};
|
|
84828
|
+
const ramp = Ramps[data.depth];
|
|
84718
84829
|
const size = data.width * data.height;
|
|
84719
84830
|
const noData = comp.asset.images[0].noData;
|
|
84720
84831
|
for (let i = 0; i < size; i++) {
|
|
@@ -86410,17 +86521,17 @@ function versionGet() {
|
|
|
86410
86521
|
* last git version tag
|
|
86411
86522
|
* @example "v6.42.1"
|
|
86412
86523
|
*/
|
|
86413
|
-
version: "v7.
|
|
86524
|
+
version: "v7.13.0-9-g72f2a811",
|
|
86414
86525
|
/**
|
|
86415
86526
|
* Full git commit hash
|
|
86416
86527
|
* @example "e4231b1ee62c276c8657c56677ced02681dfe5d6"
|
|
86417
86528
|
*/
|
|
86418
|
-
hash: "
|
|
86529
|
+
hash: "72f2a811d4851c6f50758617c9e65179d2b27bc8",
|
|
86419
86530
|
/**
|
|
86420
86531
|
* The exact build that this release was run from
|
|
86421
86532
|
* @example "1658821493-3"
|
|
86422
86533
|
*/
|
|
86423
|
-
buildId: "
|
|
86534
|
+
buildId: "12978670711-1"
|
|
86424
86535
|
});
|
|
86425
86536
|
return Promise.resolve(response);
|
|
86426
86537
|
}
|
package/dist/package-lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@basemaps/lambda-tiler",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.14.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@basemaps/lambda-tiler",
|
|
9
|
-
"version": "7.
|
|
9
|
+
"version": "7.14.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"lerc": "4.0.4",
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@basemaps/lambda-tiler",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.14.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/linz/basemaps.git",
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
"types": "./build/index.d.ts",
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@basemaps/config": "^7.
|
|
26
|
-
"@basemaps/config-loader": "^7.
|
|
25
|
+
"@basemaps/config": "^7.14.0",
|
|
26
|
+
"@basemaps/config-loader": "^7.14.0",
|
|
27
27
|
"@basemaps/geo": "^7.12.0",
|
|
28
|
-
"@basemaps/shared": "^7.
|
|
28
|
+
"@basemaps/shared": "^7.14.0",
|
|
29
29
|
"@basemaps/tiler": "^7.12.0",
|
|
30
|
-
"@basemaps/tiler-sharp": "^7.
|
|
30
|
+
"@basemaps/tiler-sharp": "^7.14.0",
|
|
31
31
|
"@linzjs/geojson": "^7.10.0",
|
|
32
32
|
"@linzjs/lambda": "^4.0.0",
|
|
33
33
|
"@mapbox/vector-tile": "^2.0.3",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"@types/pixelmatch": "^5.0.0",
|
|
57
57
|
"pretty-json-log": "^1.0.0"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "72f2a811d4851c6f50758617c9e65179d2b27bc8"
|
|
60
60
|
}
|