Skip to content

Commit 8b7a8ed

Browse files
avsmclaude
andcommitted
fix: use tessera:-prefixed attribute names from migrated stores
Read tessera:utm_zone and proj:code directly without fallbacks — stores have been migrated to the tessera: convention namespace. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6f2749b commit 8b7a8ed

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

apps/viewer/src/lib/stac.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ export async function loadCatalog(catalogUrl: string, signal?: AbortSignal): Pro
6868

6969
zones.push({
7070
id: item.id as string,
71-
utmZone: (props.utm_zone as number) ?? 0,
72-
epsg: props['proj:code'] ? parseInt((props['proj:code'] as string).split(':')[1], 10) : ((props.crs_epsg as number) ?? 0),
71+
utmZone: props['tessera:utm_zone'] as number,
72+
epsg: parseInt((props['proj:code'] as string).split(':')[1], 10),
7373
bbox: item.bbox as [number, number, number, number],
7474
geometry: (item.geometry as GeoJSON.Polygon),
7575
zarrUrl,

packages/tessera/src/zarr-reader.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ export async function openStore(url: string): Promise<ZarrStore> {
5353
const embArr = await zarr.open(rootLoc.resolve('embeddings'), { kind: 'array' });
5454
const scalesArr = await zarr.open(rootLoc.resolve('scales'), { kind: 'array' });
5555

56-
const utmZone = attrs.utm_zone as number;
57-
const projCode = attrs['proj:code'] as string | undefined;
58-
const epsg = projCode ? parseInt(projCode.split(':')[1], 10) : (attrs.crs_epsg as number);
59-
const transform = (attrs['spatial:transform'] ?? attrs.transform) as [number, number, number, number, number, number];
56+
const utmZone = attrs['tessera:utm_zone'] as number;
57+
const projCode = attrs['proj:code'] as string;
58+
const epsg = parseInt(projCode.split(':')[1], 10);
59+
const transform = attrs['spatial:transform'] as [number, number, number, number, number, number];
6060

6161
if (!utmZone || !transform || !embArr.shape) {
62-
throw new Error('Missing required store metadata (utm_zone, spatial:transform, shape)');
62+
throw new Error('Missing required store metadata (tessera:utm_zone, spatial:transform, shape)');
6363
}
6464

6565
// Try optional preview arrays

0 commit comments

Comments
 (0)