@basemaps/cli-raster 8.5.0 → 8.6.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.
Files changed (2) hide show
  1. package/dist/index.cjs +34 -12
  2. package/package.json +5 -5
package/dist/index.cjs CHANGED
@@ -73132,9 +73132,9 @@ var ulid2 = __toESM(require_index_umd(), 1);
73132
73132
  var CliInfo = {
73133
73133
  // Detect unlinked packages looks for this string since its a package name, slightly work around it
73134
73134
  package: "@basemaps/cli",
73135
- version: "v8.5.0",
73136
- hash: "4f6f3929b9117c3e112f7d156ab185cb98821796",
73137
- buildId: "16305730095-1"
73135
+ version: "v8.6.0",
73136
+ hash: "bd34894f26d1c7827503e0cb9d48d0773ecd6775",
73137
+ buildId: "16790799626-1"
73138
73138
  };
73139
73139
  var CliDate = (/* @__PURE__ */ new Date()).toISOString();
73140
73140
  var CliId = ulid2.ulid();
@@ -77378,9 +77378,14 @@ var ConfigBase = z.object({
77378
77378
  /**
77379
77379
  * Was this configuration object generated from another object
77380
77380
  *
77381
- * @default undefined / false
77381
+ * tileset-all: All tileset contains all raster layers
77382
+ * tileset-alias: Alias that points to another tileset
77383
+ * imagery-name: Tileset that is identified by its imagery name
77384
+ * imagery-id: Tileset that is identified by its imagery id
77385
+ *
77386
+ * @default undefined
77382
77387
  */
77383
- virtual: z.boolean().optional()
77388
+ virtual: z.enum(["tileset-all", "tileset-alias", "imagery-name", "imagery-id"]).optional()
77384
77389
  });
77385
77390
 
77386
77391
  // ../config/build/config/tile.set.js
@@ -77660,14 +77665,25 @@ var ConfigProviderMemory = class _ConfigProviderMemory extends BasemapsConfigPro
77660
77665
  return cfg;
77661
77666
  }
77662
77667
  /** Find all imagery inside this configuration and create a virtual tile set for it */
77663
- createVirtualTileSets() {
77668
+ createVirtualTileSets(createById = true) {
77664
77669
  const allLayers = [];
77665
77670
  for (const obj of this.objects.values()) {
77666
77671
  if (isConfigImagery(obj)) {
77667
- this.put(_ConfigProviderMemory.imageryToTileSet(obj));
77672
+ if (createById)
77673
+ this.put(_ConfigProviderMemory.imageryToTileSet(obj));
77668
77674
  const tileSet = this.imageryToTileSetByName(obj);
77669
77675
  allLayers.push(tileSet.layers[0]);
77670
77676
  }
77677
+ if (this.TileSet.is(obj)) {
77678
+ if (obj.aliases) {
77679
+ for (const alias of obj.aliases) {
77680
+ const aliasTs = structuredClone(obj);
77681
+ aliasTs.id = ConfigId.prefix(ConfigPrefix.TileSet, alias);
77682
+ aliasTs.virtual = "tileset-alias";
77683
+ this.put(aliasTs);
77684
+ }
77685
+ }
77686
+ }
77671
77687
  }
77672
77688
  if (allLayers.length)
77673
77689
  this.createVirtualAllTileSet(allLayers);
@@ -77684,7 +77700,7 @@ var ConfigProviderMemory = class _ConfigProviderMemory extends BasemapsConfigPro
77684
77700
  }
77685
77701
  const allTileset = {
77686
77702
  type: TileSetType.Raster,
77687
- virtual: true,
77703
+ virtual: "tileset-all",
77688
77704
  id: "ts_all",
77689
77705
  name: "all",
77690
77706
  title: "All Imagery",
@@ -77701,7 +77717,7 @@ var ConfigProviderMemory = class _ConfigProviderMemory extends BasemapsConfigPro
77701
77717
  if (existing == null) {
77702
77718
  existing = {
77703
77719
  type: TileSetType.Raster,
77704
- virtual: true,
77720
+ virtual: "imagery-name",
77705
77721
  id: targetId,
77706
77722
  title: i.title,
77707
77723
  category: i.category,
@@ -77732,7 +77748,7 @@ var ConfigProviderMemory = class _ConfigProviderMemory extends BasemapsConfigPro
77732
77748
  static imageryToTileSet(i) {
77733
77749
  const ts = {
77734
77750
  type: TileSetType.Raster,
77735
- virtual: true,
77751
+ virtual: "imagery-id",
77736
77752
  id: ConfigId.prefix(ConfigPrefix.TileSet, ConfigId.unprefix(ConfigPrefix.Imagery, i.id)),
77737
77753
  name: i.name,
77738
77754
  title: i.title,
@@ -83752,7 +83768,8 @@ var zTileSetConfig = z.object({
83752
83768
  minZoom: zZoom.optional(),
83753
83769
  maxZoom: zZoom.optional(),
83754
83770
  format: z.string().optional(),
83755
- outputs: z.array(ConfigTileSetOutputParser).optional()
83771
+ outputs: z.array(ConfigTileSetOutputParser).optional(),
83772
+ aliases: z.array(z.string()).optional()
83756
83773
  });
83757
83774
 
83758
83775
  // ../../node_modules/yocto-queue/index.js
@@ -84419,6 +84436,7 @@ var ConfigJson = class _ConfigJson {
84419
84436
  } else {
84420
84437
  tileSet.format = ts.type === TileSetType.Vector ? "pbf" : "webp";
84421
84438
  }
84439
+ tileSet.aliases = ts.aliases;
84422
84440
  return tileSet;
84423
84441
  }
84424
84442
  loadImagery(url, name, title) {
@@ -84429,11 +84447,15 @@ var ConfigJson = class _ConfigJson {
84429
84447
  }
84430
84448
  return existing;
84431
84449
  }
84450
+ /** Exposed for testing */
84451
+ initImageryFromTiffUrl(url) {
84452
+ return initImageryFromTiffUrl(url, this.Q, this.imageryConfigCache, this.logger);
84453
+ }
84432
84454
  async _loadImagery(url, name, title) {
84433
84455
  const imageId = guessIdFromUri(url.href) ?? sha256base58(url.href);
84434
84456
  const id = ConfigId.prefix(ConfigPrefix.Imagery, imageId);
84435
84457
  this.logger.trace({ url: url.href, imageId: id }, "Imagery:Fetch");
84436
- const img = await initImageryFromTiffUrl(url, this.Q, this.imageryConfigCache, this.logger);
84458
+ const img = await this.initImageryFromTiffUrl(url);
84437
84459
  img.id = id;
84438
84460
  img.name = name;
84439
84461
  img.title = title;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basemaps/cli-raster",
3
- "version": "8.5.0",
3
+ "version": "8.6.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -40,10 +40,10 @@
40
40
  "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@basemaps/config": "^8.3.0",
44
- "@basemaps/config-loader": "^8.5.0",
43
+ "@basemaps/config": "^8.6.0",
44
+ "@basemaps/config-loader": "^8.6.0",
45
45
  "@basemaps/geo": "^8.3.0",
46
- "@basemaps/shared": "^8.5.0",
46
+ "@basemaps/shared": "^8.6.0",
47
47
  "@linzjs/geojson": "^8.0.0",
48
48
  "@linzjs/metrics": "^8.0.0",
49
49
  "cmd-ts": "^0.12.1",
@@ -57,5 +57,5 @@
57
57
  "build/",
58
58
  "dist/"
59
59
  ],
60
- "gitHead": "4f6f3929b9117c3e112f7d156ab185cb98821796"
60
+ "gitHead": "bd34894f26d1c7827503e0cb9d48d0773ecd6775"
61
61
  }