@basemaps/cli-vector 8.5.0 → 8.7.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.
@@ -1,15 +1,7 @@
1
1
  import { LogType } from '@basemaps/shared';
2
2
  import { VectorGeoFeature } from '../../types/VectorGeoFeature.js';
3
- import { VectorGeoPlaceLabelsFeature } from '../schema.js';
4
- export declare const PlaceLabelsFeatures: Map<string, VectorGeoPlaceLabelsFeature>;
5
3
  /**
6
- * Processes a 'place_labels' layer feature of the gazatteer dataset.
7
- *
8
- * The gazatteer dataset contains multiple features that technically describe the same feature, such that:
9
- * - 1. Many features have the same `label` value.
10
- * - a. The 1st feature always contains the properties.
11
- * - b. The 2nd, 3rd, ... features always define the `label`, `zoom_level` and `style` properties. But, all others properties will be `null`.
12
- * - 2. All features with the same `label` value have different `zoom_level` values.
4
+ * Processes a 'place_labels' layer feature.
13
5
  *
14
6
  * @param feature - the feature to process
15
7
  * @param options - the layer's options
@@ -1,14 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { zPlaceLabelsProperties } from '../parser.js';
3
- export const PlaceLabelsFeatures = new Map();
4
3
  /**
5
- * Processes a 'place_labels' layer feature of the gazatteer dataset.
6
- *
7
- * The gazatteer dataset contains multiple features that technically describe the same feature, such that:
8
- * - 1. Many features have the same `label` value.
9
- * - a. The 1st feature always contains the properties.
10
- * - b. The 2nd, 3rd, ... features always define the `label`, `zoom_level` and `style` properties. But, all others properties will be `null`.
11
- * - 2. All features with the same `label` value have different `zoom_level` values.
4
+ * Processes a 'place_labels' layer feature.
12
5
  *
13
6
  * @param feature - the feature to process
14
7
  * @param options - the layer's options
@@ -17,90 +10,27 @@ export const PlaceLabelsFeatures = new Map();
17
10
  */
18
11
  export function handleLayerPlaceLabels(feature, logger) {
19
12
  logger.trace({}, 'HandlePlaceLabels:Start');
20
- const newFeature = createNewFeature(feature, logger);
21
- const name = newFeature.properties.name;
22
- // DATA PROBLEM: Multiple features will have the same `label` value. However, only the first feature will
23
- // contain all of the expected properties. All other features with the same `label` value will have null
24
- // values for the expected properties. So, as we encounter each of the 'other' features, we need to copy
25
- // the expected properties from the first feature to it, before returning it.
26
- const storedFeature = PlaceLabelsFeatures.get(name);
27
- if (storedFeature == null) {
28
- PlaceLabelsFeatures.set(name, newFeature);
29
- logger.trace({}, 'HandlePlaceLabels:End');
30
- return newFeature;
31
- }
32
- // update the stored feature's 'minzoom' value
33
- storedFeature.tippecanoe.minzoom = newFeature.tippecanoe.minzoom;
34
- // update the stored feature's 'maxzoom' value
35
- storedFeature.tippecanoe.maxzoom = newFeature.tippecanoe.minzoom;
36
- logger.trace({}, 'HandlePlaceLabels:End');
37
- return structuredClone(storedFeature);
38
- }
39
- /**
40
- * Parses a 'place_labels' layer feature into a VectorGeoPlaceLabelsFeature object.
41
- *
42
- * @param feature - the feature to process
43
- * @param label - the feature's 'label' property
44
- * @param zoomLevel - the feature's 'zoom_level' property
45
- * @param logger - a logger instance
46
- * @returns a VectorGeoPlaceLabelsFeature object
47
- */
48
- function createNewFeature(feature, logger) {
49
13
  try {
14
+ feature = structuredClone(feature);
50
15
  const properties = zPlaceLabelsProperties.parse({
51
16
  label: feature.properties['label'],
52
- zoom_level: feature.properties['zoom_level'],
53
- style: feature.properties['style'],
17
+ admin_level: feature.properties['adminlevel'],
54
18
  natural: feature.properties['natural'],
55
19
  place: feature.properties['place'],
56
20
  water: feature.properties['water'],
57
21
  });
58
- const tippecanoe = {
59
- layer: 'place_labels',
60
- minzoom: properties.zoom_level,
61
- maxzoom: properties.zoom_level,
62
- };
63
- const newFeature = {
64
- type: feature.type,
65
- properties: {
66
- name: properties.label,
67
- kind: convertStyleToKind(properties.style, tippecanoe.minzoom),
68
- natural: properties.natural,
69
- place: properties.place,
70
- water: properties.water,
71
- },
72
- geometry: feature.geometry,
73
- tippecanoe,
74
- };
75
- return newFeature;
22
+ feature.properties = properties;
23
+ // TODO: once we finalise the new style entries, we will update the desired `minzoom` and `maxzoom` values.
24
+ feature.tippecanoe.minzoom = properties.admin_level;
25
+ logger.trace({}, 'HandlePlaceLabels:End');
26
+ return feature;
76
27
  }
77
28
  catch (e) {
29
+ // discard the handful of features with null-valued `label` properties.
78
30
  if (e instanceof z.ZodError) {
79
- logger.trace({ properties: feature.properties }, 'Failed to parse required properties.');
31
+ logger.trace({ properties: feature.properties }, 'Failed to parse required properties. Discarding feature.');
80
32
  }
81
- throw e;
82
- }
83
- }
84
- /**
85
- * Determines a feature's 'kind' based on its 'styles' property.
86
- *
87
- * @param style - the feature's 'style' property
88
- */
89
- function convertStyleToKind(style, minzoom) {
90
- if (style.startsWith('ANT'))
91
- return 'ant';
92
- if (style.startsWith('GEO'))
93
- return 'geo';
94
- if (style.startsWith('TWN')) {
95
- if (minzoom <= 8)
96
- return 'city';
97
- if (style === 'TWN1')
98
- return 'suburb';
99
- if (style === 'TWN2')
100
- return 'town';
101
- if (style === 'TWN3')
102
- return 'city';
33
+ return null;
103
34
  }
104
- return '';
105
35
  }
106
36
  //# sourceMappingURL=place_labels.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"place_labels.js","sourceRoot":"","sources":["../../../src/modify/layers/place_labels.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAGtD,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAuC,CAAC;AAElF;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAyB,EAAE,MAAe;IAC/E,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,yBAAyB,CAAC,CAAC;IAE5C,MAAM,UAAU,GAAG,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACrD,MAAM,IAAI,GAAG,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC;IAExC,yGAAyG;IACzG,wGAAwG;IACxG,wGAAwG;IACxG,6EAA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ZodString;
5
- /** @example 8 */
6
- zoom_level: z.ZodNumber;
7
- /** @example "TWN1" */
8
- style: z.ZodString;
9
- /** @example "cape" */
5
+ /** @example 7 */
6
+ admin_level: z.ZodNumber;
7
+ /** @example "peak" */
10
8
  natural: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, unknown>;
11
9
  /** @example "city" */
12
10
  place: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, unknown>;
13
- /** @example "bay" */
11
+ /** @example "sea" */
14
12
  water: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, unknown>;
15
13
  }, "strip", z.ZodTypeAny, {
16
- style: string;
17
14
  label: string;
18
- zoom_level: number;
15
+ admin_level: number;
19
16
  natural?: string | undefined;
20
17
  place?: string | undefined;
21
18
  water?: string | undefined;
22
19
  }, {
23
- style: string;
24
20
  label: string;
25
- zoom_level: number;
21
+ admin_level: number;
26
22
  natural?: unknown;
27
23
  place?: unknown;
28
24
  water?: unknown;
@@ -1,24 +1,15 @@
1
1
  import { z } from 'zod';
2
- const optionalString = z.preprocess((value) => {
3
- if (value === '0' || value === null) {
4
- return undefined;
5
- }
6
- else {
7
- return value;
8
- }
9
- }, z.string().optional());
2
+ const optionalString = z.preprocess((value) => (value == null ? undefined : value), z.string().optional());
10
3
  export const zPlaceLabelsProperties = z.object({
11
4
  /** @example "Kaitaia" */
12
5
  label: z.string(),
13
- /** @example 8 */
14
- zoom_level: z.number(),
15
- /** @example "TWN1" */
16
- style: z.string(),
17
- /** @example "cape" */
6
+ /** @example 7 */
7
+ admin_level: z.number(),
8
+ /** @example "peak" */
18
9
  natural: optionalString,
19
10
  /** @example "city" */
20
11
  place: optionalString,
21
- /** @example "bay" */
12
+ /** @example "sea" */
22
13
  water: optionalString,
23
14
  });
24
15
  //# sourceMappingURL=parser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/modify/parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EA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EAAE,cAAc;IAEvB,sBAAsB;IACtB,KAAK,EAAE,cAAc;IAErB,qBAAqB;IACrB,KAAK,EAAE,cAAc;CACtB,CAAC,CAAC"}
package/dist/index.cjs CHANGED
@@ -80746,9 +80746,9 @@ var ulid2 = __toESM(require_index_umd(), 1);
80746
80746
  var CliInfo = {
80747
80747
  // Detect unlinked packages looks for this string since its a package name, slightly work around it
80748
80748
  package: "@basemaps/cli",
80749
- version: "v8.5.0",
80750
- hash: "4f6f3929b9117c3e112f7d156ab185cb98821796",
80751
- buildId: "16305730095-1"
80749
+ version: "v8.7.0",
80750
+ hash: "3e06a16cf523dbbe0e7935afaae909d022425819",
80751
+ buildId: "16867275946-1"
80752
80752
  };
80753
80753
  var CliDate = (/* @__PURE__ */ new Date()).toISOString();
80754
80754
  var CliId = ulid2.ulid();
@@ -84966,9 +84966,14 @@ var ConfigBase = z.object({
84966
84966
  /**
84967
84967
  * Was this configuration object generated from another object
84968
84968
  *
84969
- * @default undefined / false
84969
+ * tileset-all: All tileset contains all raster layers
84970
+ * tileset-alias: Alias that points to another tileset
84971
+ * imagery-name: Tileset that is identified by its imagery name
84972
+ * imagery-id: Tileset that is identified by its imagery id
84973
+ *
84974
+ * @default undefined
84970
84975
  */
84971
- virtual: z.boolean().optional()
84976
+ virtual: z.enum(["tileset-all", "tileset-alias", "imagery-name", "imagery-id"]).optional()
84972
84977
  });
84973
84978
 
84974
84979
  // ../config/build/config/tile.set.js
@@ -91423,97 +91428,43 @@ function handleKindPeak(feature, logger) {
91423
91428
  }
91424
91429
 
91425
91430
  // src/modify/parser.ts
91426
- var optionalString = z.preprocess((value) => {
91427
- if (value === "0" || value === null) {
91428
- return void 0;
91429
- } else {
91430
- return value;
91431
- }
91432
- }, z.string().optional());
91431
+ var optionalString = z.preprocess((value) => value == null ? void 0 : value, z.string().optional());
91433
91432
  var zPlaceLabelsProperties = z.object({
91434
91433
  /** @example "Kaitaia" */
91435
91434
  label: z.string(),
91436
- /** @example 8 */
91437
- zoom_level: z.number(),
91438
- /** @example "TWN1" */
91439
- style: z.string(),
91440
- /** @example "cape" */
91435
+ /** @example 7 */
91436
+ admin_level: z.number(),
91437
+ /** @example "peak" */
91441
91438
  natural: optionalString,
91442
91439
  /** @example "city" */
91443
91440
  place: optionalString,
91444
- /** @example "bay" */
91441
+ /** @example "sea" */
91445
91442
  water: optionalString
91446
91443
  });
91447
91444
 
91448
91445
  // src/modify/layers/place_labels.ts
91449
- var PlaceLabelsFeatures = /* @__PURE__ */ new Map();
91450
91446
  function handleLayerPlaceLabels(feature, logger) {
91451
91447
  logger.trace({}, "HandlePlaceLabels:Start");
91452
- const newFeature = createNewFeature(feature, logger);
91453
- const name = newFeature.properties.name;
91454
- const storedFeature = PlaceLabelsFeatures.get(name);
91455
- if (storedFeature == null) {
91456
- PlaceLabelsFeatures.set(name, newFeature);
91457
- logger.trace({}, "HandlePlaceLabels:End");
91458
- return newFeature;
91459
- }
91460
- storedFeature.tippecanoe.minzoom = newFeature.tippecanoe.minzoom;
91461
- storedFeature.tippecanoe.maxzoom = newFeature.tippecanoe.minzoom;
91462
- logger.trace({}, "HandlePlaceLabels:End");
91463
- return structuredClone(storedFeature);
91464
- }
91465
- function createNewFeature(feature, logger) {
91466
91448
  try {
91449
+ feature = structuredClone(feature);
91467
91450
  const properties = zPlaceLabelsProperties.parse({
91468
91451
  label: feature.properties["label"],
91469
- zoom_level: feature.properties["zoom_level"],
91470
- style: feature.properties["style"],
91452
+ admin_level: feature.properties["adminlevel"],
91471
91453
  natural: feature.properties["natural"],
91472
91454
  place: feature.properties["place"],
91473
91455
  water: feature.properties["water"]
91474
91456
  });
91475
- const tippecanoe2 = {
91476
- layer: "place_labels",
91477
- minzoom: properties.zoom_level,
91478
- maxzoom: properties.zoom_level
91479
- };
91480
- const newFeature = {
91481
- type: feature.type,
91482
- properties: {
91483
- name: properties.label,
91484
- kind: convertStyleToKind(properties.style, tippecanoe2.minzoom),
91485
- natural: properties.natural,
91486
- place: properties.place,
91487
- water: properties.water
91488
- },
91489
- geometry: feature.geometry,
91490
- tippecanoe: tippecanoe2
91491
- };
91492
- return newFeature;
91457
+ feature.properties = properties;
91458
+ feature.tippecanoe.minzoom = properties.admin_level;
91459
+ logger.trace({}, "HandlePlaceLabels:End");
91460
+ return feature;
91493
91461
  } catch (e) {
91494
91462
  if (e instanceof z.ZodError) {
91495
- logger.trace({ properties: feature.properties }, "Failed to parse required properties.");
91463
+ logger.trace({ properties: feature.properties }, "Failed to parse required properties. Discarding feature.");
91496
91464
  }
91497
- throw e;
91465
+ return null;
91498
91466
  }
91499
91467
  }
91500
- function convertStyleToKind(style, minzoom) {
91501
- if (style.startsWith("ANT"))
91502
- return "ant";
91503
- if (style.startsWith("GEO"))
91504
- return "geo";
91505
- if (style.startsWith("TWN")) {
91506
- if (minzoom <= 8)
91507
- return "city";
91508
- if (style === "TWN1")
91509
- return "suburb";
91510
- if (style === "TWN2")
91511
- return "town";
91512
- if (style === "TWN3")
91513
- return "city";
91514
- }
91515
- return "";
91516
- }
91517
91468
 
91518
91469
  // src/modify/shared.ts
91519
91470
  var poly = __toESM(require_polylabel(), 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basemaps/cli-vector",
3
- "version": "8.5.0",
3
+ "version": "8.7.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -49,9 +49,9 @@
49
49
  "dist/"
50
50
  ],
51
51
  "dependencies": {
52
- "@basemaps/config": "^8.3.0",
52
+ "@basemaps/config": "^8.6.0",
53
53
  "@basemaps/geo": "^8.3.0",
54
- "@basemaps/shared": "^8.5.0",
54
+ "@basemaps/shared": "^8.6.0",
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": "4f6f3929b9117c3e112f7d156ab185cb98821796"
68
+ "gitHead": "3e06a16cf523dbbe0e7935afaae909d022425819"
69
69
  }
@@ -1,15 +0,0 @@
1
- import { VectorGeoFeature } from '../types/VectorGeoFeature.js';
2
- export interface VectorGeoPlaceLabelsFeature extends VectorGeoFeature {
3
- properties: {
4
- /** @example "Kaitaia" */
5
- name: string;
6
- /** @example "ant" */
7
- kind: string;
8
- /** @example "cape" */
9
- natural?: string;
10
- /** @example "city" */
11
- place?: string;
12
- /** @example "bay" */
13
- water?: string;
14
- };
15
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=schema.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/modify/schema.ts"],"names":[],"mappings":""}