@basemaps/cli-vector 8.9.0 → 8.10.2
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.
|
@@ -23,19 +23,19 @@ describe('HandleLayerContours', () => {
|
|
|
23
23
|
},
|
|
24
24
|
};
|
|
25
25
|
describe('handleKindContours', () => {
|
|
26
|
-
it('should assign
|
|
26
|
+
it('should not assign the feature a type or override its minzoom', () => {
|
|
27
27
|
const feature = structuredClone(FakeFeature);
|
|
28
|
-
feature.properties['elevation'] =
|
|
28
|
+
feature.properties['elevation'] = 105;
|
|
29
29
|
const modifiedFeature = handleKindContours(feature, Logger);
|
|
30
|
-
strictEqual(modifiedFeature.properties['type'],
|
|
31
|
-
strictEqual(modifiedFeature.tippecanoe.minzoom,
|
|
30
|
+
strictEqual(modifiedFeature.properties['type'], undefined);
|
|
31
|
+
strictEqual(modifiedFeature.tippecanoe.minzoom, 13);
|
|
32
32
|
});
|
|
33
|
-
it(
|
|
33
|
+
it('should assign the feature a type of index and override its minzoom', () => {
|
|
34
34
|
const feature = structuredClone(FakeFeature);
|
|
35
|
-
feature.properties['elevation'] =
|
|
35
|
+
feature.properties['elevation'] = 100;
|
|
36
36
|
const modifiedFeature = handleKindContours(feature, Logger);
|
|
37
|
-
strictEqual(modifiedFeature.properties['type'],
|
|
38
|
-
strictEqual(modifiedFeature.tippecanoe.minzoom,
|
|
37
|
+
strictEqual(modifiedFeature.properties['type'], 'index');
|
|
38
|
+
strictEqual(modifiedFeature.tippecanoe.minzoom, FakeFeature.tippecanoe.minzoom);
|
|
39
39
|
});
|
|
40
40
|
});
|
|
41
41
|
describe('handleKindPeak', () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contours.test.js","sourceRoot":"","sources":["../../../../src/modify/layers/__test__/contours.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,SAA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AAC,gBAAgB,EAAE,GAAG,EAAE;QAC9B,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;YACjD,MAAM,KAAK,GAAG;gBACZ,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE;gBAC5B,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE;gBAC5B,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE;gBAC5B,EAAE,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE;gBAC3B,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;aAC1B,CAAC;YAEF,KAAK,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,KAAK,EAAE,CAAC;gBACxC,MAAM,OAAO,GAAG,eAAe,CAAC,WAAW,CAAC,CAAC;gBAC7C,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,SAAS,CAAC;gBAE5C,MAAM,eAAe,GAAG,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;gBAExD,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC;YACxD,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -82885,9 +82885,9 @@ var ulid2 = __toESM(require_index_umd(), 1);
|
|
|
82885
82885
|
var CliInfo = {
|
|
82886
82886
|
// Detect unlinked packages looks for this string since its a package name, slightly work around it
|
|
82887
82887
|
package: "@basemaps/cli",
|
|
82888
|
-
version: "v8.
|
|
82889
|
-
hash: "
|
|
82890
|
-
buildId: "
|
|
82888
|
+
version: "v8.14.0",
|
|
82889
|
+
hash: "eb807c6d0f091b41e4d6d972b77c24f584cec230",
|
|
82890
|
+
buildId: "18453645562-1"
|
|
82891
82891
|
};
|
|
82892
82892
|
var CliDate = (/* @__PURE__ */ new Date()).toISOString();
|
|
82893
82893
|
var CliId = ulid2.ulid();
|
|
@@ -87130,15 +87130,39 @@ var ConfigImageFormatParser = z.union([
|
|
|
87130
87130
|
z.literal("avif")
|
|
87131
87131
|
]);
|
|
87132
87132
|
var ConfigResizeKernelParser = z.union([z.literal("nearest"), z.literal("lanczos3"), z.literal("lanczos2")]);
|
|
87133
|
-
var
|
|
87134
|
-
|
|
87135
|
-
|
|
87136
|
-
|
|
87137
|
-
|
|
87138
|
-
|
|
87139
|
-
|
|
87140
|
-
|
|
87133
|
+
var ColorParser = z.object({
|
|
87134
|
+
r: z.number(),
|
|
87135
|
+
g: z.number(),
|
|
87136
|
+
b: z.number(),
|
|
87137
|
+
alpha: z.number()
|
|
87138
|
+
});
|
|
87139
|
+
var PipelineTerrainRgbParser = z.object({ type: z.literal("terrain-rgb") });
|
|
87140
|
+
var PipelineColorRampParser = z.object({ type: z.literal("color-ramp"), ramp: z.string().optional() });
|
|
87141
|
+
var PipelineNdviParser = z.object({
|
|
87142
|
+
type: z.literal("ndvi"),
|
|
87143
|
+
nir: z.number(),
|
|
87144
|
+
r: z.number(),
|
|
87145
|
+
alpha: z.number(),
|
|
87146
|
+
scale: z.object({
|
|
87147
|
+
nir: z.number(),
|
|
87148
|
+
r: z.number(),
|
|
87149
|
+
alpha: z.number()
|
|
87150
|
+
}).optional()
|
|
87141
87151
|
});
|
|
87152
|
+
var PipelineExtractParser = z.object({
|
|
87153
|
+
type: z.literal("extract"),
|
|
87154
|
+
r: z.number(),
|
|
87155
|
+
g: z.number(),
|
|
87156
|
+
b: z.number(),
|
|
87157
|
+
alpha: z.number(),
|
|
87158
|
+
scale: ColorParser.optional()
|
|
87159
|
+
});
|
|
87160
|
+
var ConfigTileSetPipelineParser = z.discriminatedUnion("type", [
|
|
87161
|
+
PipelineExtractParser,
|
|
87162
|
+
PipelineTerrainRgbParser,
|
|
87163
|
+
PipelineColorRampParser,
|
|
87164
|
+
PipelineNdviParser
|
|
87165
|
+
]);
|
|
87142
87166
|
var ConfigRgbaParser = z.object({ r: z.number(), g: z.number(), b: z.number(), alpha: z.number() });
|
|
87143
87167
|
var ConfigTileSetOutputParser = z.object({
|
|
87144
87168
|
/**
|
|
@@ -88601,6 +88625,13 @@ var Env = {
|
|
|
88601
88625
|
/** Index to use for storing analytic data */
|
|
88602
88626
|
ElasticIndexName: "ELASTIC_INDEX_NAME"
|
|
88603
88627
|
},
|
|
88628
|
+
/** Load a environment variable throw a exception if the value is empty */
|
|
88629
|
+
getRequired(envName) {
|
|
88630
|
+
const value = Env.get(envName);
|
|
88631
|
+
if (value == null || value === "")
|
|
88632
|
+
throw new Error(`Missing env $${envName}`);
|
|
88633
|
+
return value;
|
|
88634
|
+
},
|
|
88604
88635
|
/** Load a environment var defaulting to defaultOutput if it does not exist */
|
|
88605
88636
|
get(envName) {
|
|
88606
88637
|
return process.env[envName];
|
|
@@ -92405,7 +92436,7 @@ function getTiffTagSize(fieldType) {
|
|
|
92405
92436
|
case TiffTagValueType.Ifd8:
|
|
92406
92437
|
return 8;
|
|
92407
92438
|
default:
|
|
92408
|
-
throw new Error(`Invalid fieldType ${fieldType}`);
|
|
92439
|
+
throw new Error(`Invalid fieldType ${String(fieldType)}`);
|
|
92409
92440
|
}
|
|
92410
92441
|
}
|
|
92411
92442
|
|
|
@@ -92579,10 +92610,14 @@ async function getValueAt(tiff, tag2, index) {
|
|
|
92579
92610
|
const bytes = await tiff.source.fetch(tag2.dataOffset + index * dataTypeSize, dataTypeSize);
|
|
92580
92611
|
const view = new DataView(bytes);
|
|
92581
92612
|
const value2 = readValue(tiff, void 0, view, 0, tag2.dataType, 1);
|
|
92613
|
+
if (typeof value2 !== "number")
|
|
92614
|
+
throw new Error("Value is not a number");
|
|
92582
92615
|
tag2.value[index] = value2;
|
|
92583
92616
|
return value2;
|
|
92584
92617
|
}
|
|
92585
92618
|
const value = readValue(tiff, void 0, tag2.view, index * dataTypeSize, tag2.dataType, 1);
|
|
92619
|
+
if (typeof value !== "number")
|
|
92620
|
+
throw new Error("Value is not a number");
|
|
92586
92621
|
tag2.value[index] = value;
|
|
92587
92622
|
return value;
|
|
92588
92623
|
}
|
|
@@ -93350,8 +93385,6 @@ var Tiff = class _Tiff {
|
|
|
93350
93385
|
const endian = bytes.getUint16(offset, this.isLittleEndian);
|
|
93351
93386
|
offset += 2;
|
|
93352
93387
|
this.isLittleEndian = endian === TiffEndian.Little;
|
|
93353
|
-
if (!this.isLittleEndian)
|
|
93354
|
-
throw new Error("Only little endian is supported");
|
|
93355
93388
|
this.version = bytes.getUint16(offset, this.isLittleEndian);
|
|
93356
93389
|
offset += 2;
|
|
93357
93390
|
let nextOffsetIfd;
|
|
@@ -93371,7 +93404,7 @@ var Tiff = class _Tiff {
|
|
|
93371
93404
|
nextOffsetIfd = getUint(bytes, offset, this.ifdConfig.pointer, this.isLittleEndian);
|
|
93372
93405
|
offset += this.ifdConfig.pointer;
|
|
93373
93406
|
} else {
|
|
93374
|
-
throw new Error(`Only tiff supported version:${this.version}`);
|
|
93407
|
+
throw new Error(`Only tiff supported version:${String(this.version)}`);
|
|
93375
93408
|
}
|
|
93376
93409
|
const ghostSize = nextOffsetIfd - offset;
|
|
93377
93410
|
if (ghostSize > 0 && ghostSize < 16 * 1024) {
|
|
@@ -93385,7 +93418,7 @@ var Tiff = class _Tiff {
|
|
|
93385
93418
|
lastView = new DataView(bytes2);
|
|
93386
93419
|
lastView.sourceOffset = nextOffsetIfd;
|
|
93387
93420
|
}
|
|
93388
|
-
nextOffsetIfd =
|
|
93421
|
+
nextOffsetIfd = this.readIfd(nextOffsetIfd, lastView);
|
|
93389
93422
|
}
|
|
93390
93423
|
await Promise.all(this.images.map((i) => i.init()));
|
|
93391
93424
|
this.isInitialized = true;
|
|
@@ -93397,7 +93430,7 @@ var Tiff = class _Tiff {
|
|
|
93397
93430
|
* @param offset file offset to read the header from
|
|
93398
93431
|
* @param view offset that contains the bytes for the header
|
|
93399
93432
|
*/
|
|
93400
|
-
|
|
93433
|
+
readIfd(offset, view) {
|
|
93401
93434
|
const viewOffset = offset - view.sourceOffset;
|
|
93402
93435
|
const tagCount = getUint(view, viewOffset, this.ifdConfig.offset, this.isLittleEndian);
|
|
93403
93436
|
const tags = /* @__PURE__ */ new Map();
|
|
@@ -94257,7 +94290,7 @@ function handleKindContours(feature, logger) {
|
|
|
94257
94290
|
feature.properties["type"] = type;
|
|
94258
94291
|
logger?.trace({ type }, "new/overidden tags");
|
|
94259
94292
|
} else {
|
|
94260
|
-
const minzoom =
|
|
94293
|
+
const minzoom = 13;
|
|
94261
94294
|
feature.tippecanoe.minzoom = minzoom;
|
|
94262
94295
|
logger?.trace({ minzoom }, "overidden styles");
|
|
94263
94296
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@basemaps/cli-vector",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.10.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"build": "tsc",
|
|
23
23
|
"bundle": "../../scripts/bundle.mjs package.json",
|
|
24
24
|
"prepack": "../../scripts/bundle.mjs package.json",
|
|
25
|
-
"test": "node --test"
|
|
25
|
+
"test": "node --test \"build/**/*.test.js\""
|
|
26
26
|
},
|
|
27
27
|
"bundle": [
|
|
28
28
|
{
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"dist/"
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@basemaps/config": "^8.
|
|
52
|
+
"@basemaps/config": "^8.11.0",
|
|
53
53
|
"@basemaps/geo": "^8.9.0",
|
|
54
|
-
"@basemaps/shared": "^8.9.
|
|
54
|
+
"@basemaps/shared": "^8.9.3",
|
|
55
55
|
"@cotar/builder": "^6.0.1",
|
|
56
56
|
"@cotar/core": "^6.0.1",
|
|
57
57
|
"@linzjs/docker-command": "^7.5.0",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"tar-stream": "^2.2.0",
|
|
66
66
|
"zod": "^3.24.4"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "eb807c6d0f091b41e4d6d972b77c24f584cec230"
|
|
69
69
|
}
|