Skip to content

Commit eb3f0fe

Browse files
authored
fix(cogify): use a URL in the cogify STAC documents (#2843)
1 parent 9b859c8 commit eb3f0fe

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/cogify/src/tile.cover.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export async function createTileCover(ctx: TileCoverContext): Promise<TileCoverR
158158
// Add the source imagery as a STAC Link
159159
for (const src of source) {
160160
const srcLink: CogifyLinkSource = {
161-
href: src.name,
161+
href: new URL(src.name, ctx.imagery.url).href,
162162
rel: 'linz_basemaps:source',
163163
type: 'image/tiff; application=geotiff;',
164164
};

packages/config/src/json/tiff.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ interface TiffSummary {
3636
projection: number;
3737
/** Ground sample distance, number of meters per pixel */
3838
gsd: number;
39-
/** STAC collection if it was found with the imagery */
39+
/** STAC collection if it was found with the imagery */
4040
collection?: StacCollection;
41+
/** URL to the base of the imagery */
42+
url: string;
4143
}
4244

4345
export type ConfigImageryTiff = ConfigImagery & TiffSummary;
@@ -150,6 +152,7 @@ export async function imageryFromTiffUrl(target: URL, Q: LimitFunction, log?: Lo
150152
tileMatrix: tileMatrix?.identifier ?? 'none',
151153
gsd: params.gsd,
152154
uri: targetPath,
155+
url: target.href,
153156
bounds: params.bounds,
154157
files: params.files,
155158
collection: stac ?? undefined,

0 commit comments

Comments
 (0)