Skip to content

Commit

Permalink
refactor: Rename CRS list for consistency
Browse files Browse the repository at this point in the history
It's actually for all products.
  • Loading branch information
l0b0 committed Dec 21, 2023
1 parent 9ee74c8 commit 7767050
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assert from 'node:assert';
import { describe, it } from 'node:test';

import { CollectionProps, imageryCrs, imageryProducts, regions } from '../get-odr-base-url.js';
import { CollectionProps, crses, imageryProducts, regions } from '../get-odr-base-url.js';

describe('getOdrBaseUrl', () => {
it('should throw if the bucket is unknown', () => {
Expand Down Expand Up @@ -67,5 +67,5 @@ function anyProduct(): string {
}

function anyCrs(): number {
return imageryCrs[Math.floor(Math.random() * imageryCrs.length)]!;
return crses[Math.floor(Math.random() * crses.length)]!;
}
2 changes: 1 addition & 1 deletion src/commands/get-odr-base-url/get-odr-base-url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const regions = [
];

export const imageryBucketNames = ['linz-imagery', 'nz-imagery'];
export const imageryCrs = [EpsgCode.Nztm2000];
export const crses = [EpsgCode.Nztm2000];
export const imageryProducts = ['rgb'];

export const elevationBucketNames = ['linz-elevation', 'linz-imagery', 'nz-imagery'];
Expand Down
4 changes: 2 additions & 2 deletions src/commands/lint/lint.s3.paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { command, positional, string } from 'cmd-ts';
import { CliInfo } from '../../cli.info.js';
import { logger } from '../../log.js';
import { config, registerCli, verbose } from '../common.js';
import { imageryBucketNames, imageryCrs, imageryProducts, regions } from '../get-odr-base-url/get-odr-base-url.js';
import { crses, imageryBucketNames, imageryProducts, regions } from '../get-odr-base-url/get-odr-base-url.js';

export const commandLintInputs = command({
name: 'lint-inputs',
Expand Down Expand Up @@ -61,7 +61,7 @@ export function lintImageryPath(pathName: string): void {
if (!imageryProducts.includes(product)) {
throw new Error(`product not in product list: ${product}`);
}
if (!imageryCrs.includes(Number(crs))) {
if (!crses.includes(Number(crs))) {
throw new Error(`crs not in crs list: ${crs}`);
}
const resolution = dataset.split('_').pop()?.replace('m', '');
Expand Down

0 comments on commit 7767050

Please sign in to comment.