Skip to content

Commit b6afd57

Browse files
authored
fix(cogify): correct ordering of lat lon (#2846)
Makes the URL handler similar to how the parser works https://github.com/linz/basemaps/blob/master/packages/landing/src/url.ts#L53
1 parent eb3f0fe commit b6afd57

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/cogify/src/cogify/cli/cli.config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ export const BasemapsCogifyConfigCommand = command({
1616
description: 'Create a Basemaps configuration from a path to imagery',
1717
args: {
1818
...logArguments,
19-
output: option({
19+
target: option({
2020
type: optional(Url),
21-
long: 'output',
21+
long: 'target',
2222
description: 'Where to write the config json, Defaults to imagery path',
2323
}),
2424
path: positional({ type: Url, displayName: 'path', description: 'Path to imagery' }),
@@ -35,7 +35,7 @@ export const BasemapsCogifyConfigCommand = command({
3535
logger.info({ imagery: cfg.imagery.length, titles: cfg.imagery.map((f) => f.title) }, 'ImageryConfig:Loaded');
3636

3737
const config = mem.toJson();
38-
const outputPath = urlToString(new URL(`basemaps-config-${config.hash}.json.gz`, args.output ?? args.path));
38+
const outputPath = urlToString(new URL(`basemaps-config-${config.hash}.json.gz`, args.target ?? args.path));
3939

4040
logger.info({ output: outputPath, hash: config.hash }, 'ImageryConfig:Write');
4141
await fsa.writeJson(outputPath, config);
@@ -44,7 +44,7 @@ export const BasemapsCogifyConfigCommand = command({
4444
const outputUrls: string[] = [];
4545
for (const im of cfg.imagery) {
4646
const location = getImageryCenterZoom(im);
47-
const locationHash = `#@${location.lon.toFixed(6)},${location.lat.toFixed(6)},z${location.zoom}`;
47+
const locationHash = `#@${location.lat.toFixed(7)},${location.lon.toFixed(7)},z${location.zoom}`;
4848
const url = `https://basemaps.linz.govt.nz/?config=${configPath}&i=${im.name}&tileMatrix=${im.tileMatrix}&debug${locationHash}`;
4949
outputUrls.push(url);
5050
logger.info(

0 commit comments

Comments
 (0)