diff --git a/packages/geo/src/stac/stac.attribution.ts b/packages/geo/src/stac/stac.attribution.ts index 5d2e61808..434296bcc 100644 --- a/packages/geo/src/stac/stac.attribution.ts +++ b/packages/geo/src/stac/stac.attribution.ts @@ -4,8 +4,25 @@ import { StacCatalog, StacCollection, StacItem } from './index.js'; * A Single File STAC compliant collection with zoom and priority for calculating attribution of an extent */ export type AttributionCollection = StacCollection<{ + /** + * Category of the layer + * + * @example "Urban Aerial Photos" + */ 'linz:category'?: string; + + /** + * Zoom levels that the layer is visit + */ 'linz:zoom': { min: number; max: number }; + + /** + * Priority order for the layer + * + * The higher the number the higher the priority + * + * @example [1077] + */ 'linz:priority': [number]; }>; @@ -13,10 +30,33 @@ export type AttributionCollection = StacCollection<{ * A Single File STAC compliant feature for calculating attribution of an extent */ export type AttributionItem = StacItem<{ + /** + * Human friendly title of the layer + * + * @example "Whanganui 0.075m Urban Aerial Photos (2017)" + */ title: string; + + /** + * Category of the layer + * + * @example "Urban Aerial Photos" + */ category?: string; + + /** + * datetime is null as per STAC requirement when {@link start_datetime} and {@link end_datetime} are set + */ datetime?: null; + + /** + * datetime of when the layer started being captured + */ start_datetime?: string; + + /** + * datetime of when the layer stopped being captured + */ end_datetime?: string; }>; diff --git a/packages/lambda-tiler/src/routes/attribution.ts b/packages/lambda-tiler/src/routes/attribution.ts index 3aa2f3219..cd866bcd9 100644 --- a/packages/lambda-tiler/src/routes/attribution.ts +++ b/packages/lambda-tiler/src/routes/attribution.ts @@ -99,10 +99,13 @@ async function tileSetAttribution( for (const layer of tileSet.layers) { const imgId = layer[proj.epsg.code]; if (imgId == null) continue; + const im = imagery.get(imgId); if (im == null) continue; + const title = im.title; const years = extractYearRangeFromTitle(im.title) ?? extractYearRangeFromName(im.name); + if (years == null) continue; const interval = yearRangeToInterval(years);