Skip to main content

ZarrTileProvider

Provides Zarr dataset access and rendering capabilities for web-map layers.

Accessors​

cacheKey​

Get Signature​

get cacheKey(): string;

Stable selector-derived key that map adapters can use to invalidate tile caches.

Returns​

string


ready​

Get Signature​

get ready(): boolean;

Whether initialization completed successfully and the provider has not been destroyed.

Returns​

boolean


readyPromise​

Get Signature​

get readyPromise(): Promise<boolean>;

Promise that resolves with the result of asynchronous dataset initialization.

Returns​

Promise<boolean>


tileCacheStats​

Get Signature​

get tileCacheStats(): TileCacheStats;

Current decoded tile-cache usage and lifetime hit/eviction counters.

Returns​

TileCacheStats

Constructors​

Constructor​

new ZarrTileProvider(options): ZarrTileProvider;

Creates the framework-independent Zarr tile renderer.

Parameters​

ParameterTypeDescription
optionsZarrTileOptionsDataset, rendering, request, and selector configuration.

Returns​

ZarrTileProvider

Throws​

If neither options.url nor options.store is provided.

Remarks​

Initialization starts immediately. Await readyPromise before rendering or querying.

Methods​

abortTile()​

abortTile(key): void;

Aborts an in-flight tile request.

Parameters​

ParameterTypeDescription
keystringTile key originally passed to renderTile.

Returns​

void


clearTileCache()​

clearTileCache(): void;

Removes all decoded numeric tiles retained by this provider.

Returns​

void


destroy()​

destroy(): void;

Aborts outstanding tile requests and prevents further rendering work.

Returns​

void


getFullTransect()​

getFullTransect(
start,
end,
selectors?,
options?): Promise<FullTransectResult>;

Samples every vertical level along a line between two WGS84 positions.

Parameters​

ParameterTypeDescription
startQueryPositionStart [longitude, latitude] in degrees.
endQueryPositionEnd [longitude, latitude] in degrees.
selectors?ZarrSelectorsSelectors used for dimensions other than elevation.
options?TransectQueryOptionsSampling, concurrency, and cancellation options.

Returns​

Promise<FullTransectResult>


getTimeSeries()​

getTimeSeries(
position,
selectors?,
options?): Promise<QueryResult>;

Queries every time coordinate at a WGS84 position.

Parameters​

ParameterTypeDescription
positionQueryPosition[longitude, latitude] in degrees.
selectors?ZarrSelectorsOptional selectors for dimensions other than time.
options?QueryOptionsQuery level, coordinate, and cancellation options.

Returns​

Promise<QueryResult>

Values and their time coordinates.


getTransect()​

getTransect(
start,
end,
selectors?,
options?): Promise<TransectResult>;

Samples one selected level along a line between two WGS84 positions.

Parameters​

ParameterTypeDescription
startQueryPositionStart [longitude, latitude] in degrees.
endQueryPositionEnd [longitude, latitude] in degrees.
selectors?ZarrSelectorsSelectors used for non-spatial dimensions.
options?TransectQueryOptionsSampling, concurrency, and cancellation options.

Returns​

Promise<TransectResult>


getVerticalProfile()​

getVerticalProfile(
position,
selectors?,
options?): Promise<QueryResult>;

Queries every vertical coordinate at a WGS84 position.

Parameters​

ParameterTypeDescription
positionQueryPosition[longitude, latitude] in degrees.
selectors?ZarrSelectorsOptional selectors for dimensions other than elevation.
options?QueryOptionsQuery level, coordinate, and cancellation options.

Returns​

Promise<QueryResult>

Values and their vertical coordinates.


queryData()​

queryData(
geometry,
selectors?,
options?): Promise<QueryResult>;

Queries the nearest raster cell for a WGS84 GeoJSON point.

Parameters​

ParameterTypeDescription
geometryQueryGeometryQuery geometry. Point queries are currently supported.
selectors?ZarrSelectorsOptional per-query selectors merged over the provider selectors.
options?QueryOptionsResolution, coordinate output, and cancellation options.

Returns​

Promise<QueryResult>

Sampled values, dimension names, and coordinate arrays.

Throws​

If the geometry is unsupported, a selector is invalid, or initialization failed.

Remarks​

One ranged non-spatial selector produces a profile or time series.


queryPoints()​

queryPoints(
positions,
selectors?,
options?): Promise<QueryResult[]>;

Queries several WGS84 points using the same selectors and array level.

Parameters​

ParameterTypeDescription
positionsQueryPosition[]Positions as [longitude, latitude] pairs.
selectors?ZarrSelectorsSelectors shared by every point.
options?TransectQueryOptionsResolution, concurrency, coordinate, and cancellation options.

Returns​

Promise<QueryResult[]>

One query result per input position, preserving input order.

Remarks​

Source chunks are deduplicated so transects do not fetch and decode a chunk per sample.


renderTile()​

renderTile(
boundsDeg,
z,
key): Promise<HTMLCanvasElement | ImageBitmap>;

Fetches and renders a geographic tile into a canvas.

Parameters​

ParameterTypeDescription
boundsDegBoundsPropsWGS84 tile bounds in degrees.
znumberMap zoom used to choose a multiscale level.
keystringUnique request key used for cancellation.

Returns​

Promise<HTMLCanvasElement | ImageBitmap>

A canvas or transferable image bitmap containing the rendered tile.

Throws​

If initialization failed, the provider was destroyed, or rendering cannot complete.


updateSelectors()​

updateSelectors(selectors): boolean;

Merges new dimension selectors into the current selection.

Parameters​

ParameterTypeDescription
selectorsZarrSelectorsSelectors expressed as indices, values, or ranges.

Returns​

boolean

true when the effective selection changed and consumers should redraw.


updateStyle()​

updateStyle(opts): boolean;

Updates the data scale or colormap without reopening the dataset.

Parameters​

ParameterTypeDescription
opts{ colormap?: string; scale?: [number, number]; }Partial style update.
opts.colormap?string-
opts.scale?[number, number]-

Returns​

boolean

true when the effective style changed and consumers should redraw.

Properties​

coverageBoundsDeg​

coverageBoundsDeg:
| {
east: number;
north: number;
south: number;
west: number;
}
| null;

coverageBoundsMerc​

coverageBoundsMerc:
| {
xMax: number;
xMin: number;
yMax: number;
yMin: number;
}
| null;

crs​

crs: CRS | null;

Detected or configured coordinate reference system.


dimensionValues​

dimensionValues: DimensionValues;

Coordinate values keyed by canonical dimension name. Available after readyPromise resolves.


selectors​

selectors: ZarrSelectors;

Selectors currently used to slice non-spatial dimensions.