From bf4b3c9cc768c1c10940575db54e83a66b21821d Mon Sep 17 00:00:00 2001 From: Blayne Chard Date: Wed, 6 Sep 2023 15:15:20 +1200 Subject: [PATCH] fix(config): ignore the argo folder "flat/" in guessing imagery names --- packages/cli/src/cli/config/action.imagery.config.ts | 6 +++--- packages/config/src/json/__tests__/config.loader.test.ts | 6 ++++++ packages/config/src/json/tiff.config.ts | 2 ++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/cli/src/cli/config/action.imagery.config.ts b/packages/cli/src/cli/config/action.imagery.config.ts index 9ceddbd38..dd8df006e 100644 --- a/packages/cli/src/cli/config/action.imagery.config.ts +++ b/packages/cli/src/cli/config/action.imagery.config.ts @@ -120,7 +120,7 @@ export class CommandImageryConfig extends CommandLineAction { layers: [{ 2193: im.id, name: im.name, title: im.title }], }; provider.put(aerialTileSet); - provider.imageryToTileSetByName(im); + const tileSet = provider.imageryToTileSetByName(im); const center = { x: bounds.x + bounds.width / 2, y: bounds.y + bounds.height / 2 }; const proj = Projection.get(Nztm2000QuadTms); @@ -135,8 +135,8 @@ export class CommandImageryConfig extends CommandLineAction { await fsa.writeJson(outputPath, configJson); const configPath = base58.encode(Buffer.from(outputPath)); - const url = `https://basemaps.linz.govt.nz/${locationHash}?i=${im.name}&tileMatrix=${im.tileMatrix}&debug&config=${configPath}`; - const urlPreview = `https://basemaps.linz.govt.nz/v1/preview/${im.name}/${im.tileMatrix}/${targetZoom}/${lon}/${lat}?config=${configPath}`; + const url = `https://basemaps.linz.govt.nz/${locationHash}?i=${tileSet.name}&tileMatrix=${im.tileMatrix}&debug&config=${configPath}`; + const urlPreview = `https://basemaps.linz.govt.nz/v1/preview/${tileSet.name}/${im.tileMatrix}/${targetZoom}/${lon}/${lat}?config=${configPath}`; logger.info( { diff --git a/packages/config/src/json/__tests__/config.loader.test.ts b/packages/config/src/json/__tests__/config.loader.test.ts index bdbfd024d..2f55048d2 100644 --- a/packages/config/src/json/__tests__/config.loader.test.ts +++ b/packages/config/src/json/__tests__/config.loader.test.ts @@ -119,4 +119,10 @@ o.spec('config import', () => { 'auckland_sn5600_1979_0.375m', ); }); + + o('should ignore argo folder names', () => { + o( + getImageryName(new URL('s3://linz-workflow-artifacts/2023-09/05-ecan-banks-peninsula-original-9mjdj/flat/')), + ).equals('05-ecan-banks-peninsula-original-9mjdj'); + }); }); diff --git a/packages/config/src/json/tiff.config.ts b/packages/config/src/json/tiff.config.ts index 3acecd606..fa33981aa 100644 --- a/packages/config/src/json/tiff.config.ts +++ b/packages/config/src/json/tiff.config.ts @@ -128,6 +128,8 @@ const IgnoredTitles = new Set([ // Elevation 'dem_1m', 'dsm_1m', + // Argo folders + 'flat', //Projections '2193', '3857',