Skip to main content

Type Alias: ZarrLayerProps<Store, Dtype, DataT>

ZarrLayerProps<Store, Dtype, DataT> = Omit<RasterTileLayerProps<DataT>, "tilesetDescriptor" | "getTileData" | "renderTile"> & object

Defined in: packages/deck.gl-zarr/src/zarr-layer.ts:67

Props for the ZarrLayer.

Type Declaration

epsgResolver?

optional epsgResolver?: EpsgResolver

Resolver for authority:code CRS strings (e.g. "EPSG:4326"). Defaults to fetching from epsg.io.

getTileData

getTileData: (arr, options) => Promise<DataT>

Fetch and return the tile data for a given tile coordinate.

The layer opens the appropriate zarr array for the requested zoom level and passes it along with a pre-built sliceSpec (one entry per array dim). Call zarr.get(arr, sliceSpec) and convert the result to whatever format your renderTile callback expects.

Parameters

arr

zarr.Array<Dtype, Store>

options

GetTileDataOptions

Returns

Promise<DataT>

metadata?

optional metadata?: unknown

Optional raw group attrs to use in place of group.attrs when parsing GeoZarr metadata.

Use this to hard-code GeoZarr metadata when the Zarr data source does not include it.

node

node: zarr.Array<Dtype, Store> | zarr.Group<Store>

A pre-opened zarrita zarr.Array or zarr.Group. Callers must build and configure the underlying store themselves (for example, a user may want to wrap a zarr.FetchStore with withConsolidatedMetadata, withRangeCoalescing.

Pass an Array to render it directly as a single-level source; pass a Group to let the layer resolve a variable path and use the GeoZarr multiscale layout from its attrs.

renderTile

renderTile: (data) => RenderTileResult

Convert a loaded DataT tile into a RenderTileResult that the layer can pass to RasterLayer. Return { image } for a simple ImageData / texture, or { renderPipeline } for a GPU shader pipeline.

Parameters

data

DataT

Returns

RenderTileResult

selection

selection: Record<string, SliceInput>

Selection for non-spatial dimensions. Must include exactly one entry per non-spatial dim in the array. Use a number to pin to a single index, null to use zarr's default slice, or a zarr.Slice for a range.

For datasets with only spatial dimensions (e.g. a plain [H, W] or [bands, H, W] array whose non-spatial dims are already accounted for), pass an empty object {}.

variable?

optional variable?: string

Optional path within the store to the variable group. Only applies when node is a zarr.Group; ignored when an Array is passed directly. If omitted, the group itself is used.

Type Parameters

Store

Store extends zarr.Readable = zarr.Readable

Dtype

Dtype extends zarr.DataType = zarr.DataType

DataT

DataT extends MinimalTileData = MinimalTileData