Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions packages/deck.gl-geotiff/src/cog-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type {
} from "@developmentseed/deck.gl-raster";
import { RasterLayer, RasterTileset2D } from "@developmentseed/deck.gl-raster";
import type { ReprojectionFns } from "@developmentseed/raster-reproject";
import type { TextureProps } from "@luma.gl/core";
import type { Device, Texture } from "@luma.gl/core";
import type { GeoTIFF, GeoTIFFImage, Pool } from "geotiff";
import proj4 from "proj4";
import { parseCOGTileMatrixSet } from "./cog-tile-matrix-set.js";
Expand Down Expand Up @@ -62,18 +62,19 @@ export interface COGLayerProps extends CompositeLayerProps {
* The default implementation loads an RGBA image using geotiff.js's readRGB
* method, returning an ImageData object.
*
* For more customizability, you can also return a TextureProps object from
* For more customizability, you can also return a Texture object from
* luma.gl, along with optional custom shaders for the RasterLayer.
*/
loadTexture?: (
image: GeoTIFFImage,
options: {
device: Device;
window: [number, number, number, number];
signal?: AbortSignal;
pool: Pool;
},
) => Promise<{
texture: ImageData | TextureProps;
texture: ImageData | Texture;
shaders?: RasterLayerProps["shaders"];
height: number;
width: number;
Expand Down Expand Up @@ -184,7 +185,7 @@ export class COGLayer extends CompositeLayer<COGLayerProps> {
getTileData: async (
tile,
): Promise<{
texture: ImageData | TextureProps;
texture: ImageData | Texture;
shaders?: RasterLayerProps["shaders"];
height: number;
width: number;
Expand Down Expand Up @@ -215,6 +216,7 @@ export class COGLayer extends CompositeLayer<COGLayerProps> {

const { texture, height, width, shaders } = await this.props
.loadTexture!(geotiffImage, {
device: this.context.device,
window,
signal,
pool: this.props.pool || defaultPool(),
Expand Down Expand Up @@ -243,7 +245,7 @@ export class COGLayer extends CompositeLayer<COGLayerProps> {
pixelToInputCRS,
inputCRSToPixel,
}: {
texture: ImageData | TextureProps;
texture: ImageData | Texture;
shaders?: RasterLayerProps["shaders"];
height: number;
width: number;
Expand Down