Skip to main content

ZarrLayerProvider

Thin Cesium adapter around the framework-independent Zarr tile renderer. Dataset loading, slicing, styling, caching, and WebGL rendering live in zarr-maps-tiling. This class only translates Cesium tile requests.

Implements​

Accessors​

credit​

Get Signature​

get credit(): Credit;

Dataset attribution exposed to Cesium.

Returns​

Credit

Implementation of​

ImageryProvider.credit

dimensionValues​

Get Signature​

get dimensionValues(): DimensionValues;

Coordinate values keyed by normalized dimension name.

Returns​

DimensionValues


errorEvent​

Get Signature​

get errorEvent(): Event;

Cesium imagery-provider error event.

Returns​

Event

Implementation of​

ImageryProvider.errorEvent

hasAlphaChannel​

Get Signature​

get hasAlphaChannel(): boolean;

Whether rendered tiles contain alpha values. Always true.

Returns​

boolean

Implementation of​

ImageryProvider.hasAlphaChannel

maximumLevel​

Get Signature​

get maximumLevel(): number;

Maximum imagery level requested by Cesium.

Returns​

number

Implementation of​

ImageryProvider.maximumLevel

minimumLevel​

Get Signature​

get minimumLevel(): number;

Minimum imagery level requested by Cesium.

Returns​

number

Implementation of​

ImageryProvider.minimumLevel

ready​

Get Signature​

get ready(): boolean;

Whether metadata initialization completed and the provider is usable.

Returns​

boolean


readyPromise​

Get Signature​

get readyPromise(): Promise<boolean>;

Promise resolving to the provider readiness state.

Returns​

Promise<boolean>


rectangle​

Get Signature​

get rectangle(): Rectangle;

Geographic coverage of the dataset.

Returns​

Rectangle

Implementation of​

ImageryProvider.rectangle

selectors​

Get Signature​

get selectors(): Record<string, ZarrSelectorsProps>;

Current index-based selectors used for tile rendering and queries.

Returns​

Record<string, ZarrSelectorsProps>


tileCacheStats​

Get Signature​

get tileCacheStats(): TileCacheStats;

Current decoded tile-cache usage and lifetime counters.

Returns​

TileCacheStats


tileHeight​

Get Signature​

get tileHeight(): number;

Height of rendered imagery tiles in pixels.

Returns​

number

Implementation of​

ImageryProvider.tileHeight

tileWidth​

Get Signature​

get tileWidth(): number;

Width of rendered imagery tiles in pixels.

Returns​

number

Implementation of​

ImageryProvider.tileWidth

tilingScheme​

Get Signature​

get tilingScheme(): TilingScheme;

Cesium tiling scheme selected from the detected dataset CRS.

Returns​

TilingScheme

Implementation of​

ImageryProvider.tilingScheme

Constructors​

Constructor​

new ZarrLayerProvider(options): ZarrLayerProvider;

Creates a Cesium imagery provider backed by a URL or custom Zarrita store.

Parameters​

ParameterTypeDescription
optionsLayerOptionsDataset, tiling, selection, style, and request options.

Returns​

ZarrLayerProvider

Remarks​

Prefer createLayer when adding the result to a viewer.

Methods​

clearTileCache()​

clearTileCache(): void;

Removes decoded numeric tiles retained by this imagery provider.

Returns​

void


destroy()​

destroy(): void;

Aborts pending reads and releases tile-renderer resources.

Returns​

void


getFullTransect()​

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

Samples all elevation levels along a line between two WGS84 positions.

Parameters​

ParameterTypeDescription
startQueryPositionStarting [longitude, latitude] coordinate in degrees.
endQueryPositionEnding [longitude, latitude] coordinate in degrees.
selectors?ZarrSelectorsFixed selectors for dimensions other than elevation.
options?TransectQueryOptionsSample count, concurrency, cancellation, and resolution controls.

Returns​

Promise<FullTransectResult>

A distance-by-elevation value matrix.


getTileCredits()​

getTileCredits(): Credit[];

Returns​

Credit[]

Credit entries associated with every rendered tile.

Implementation of​

ImageryProvider.getTileCredits

getTimeSeries()​

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

Reads every time value at one WGS84 position.

Parameters​

ParameterTypeDescription
positionQueryPosition[longitude, latitude] in degrees.
selectors?ZarrSelectorsFixed selectors for dimensions other than time.
options?QueryOptionsQuery controls, including cancellation and resolution.

Returns​

Promise<QueryResult>

A query result ordered by the time coordinate.


getTransect()​

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

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

Parameters​

ParameterTypeDescription
startQueryPositionStarting [longitude, latitude] coordinate in degrees.
endQueryPositionEnding [longitude, latitude] coordinate in degrees.
selectors?ZarrSelectorsDimension selectors applied to every sample.
options?TransectQueryOptionsSample count, concurrency, cancellation, and resolution controls.

Returns​

Promise<TransectResult>

Distances, positions, and scalar values along the transect.


getVerticalProfile()​

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

Reads every elevation value at one WGS84 position.

Parameters​

ParameterTypeDescription
positionQueryPosition[longitude, latitude] in degrees.
selectors?ZarrSelectorsFixed selectors for dimensions other than elevation.
options?QueryOptionsQuery controls, including cancellation and resolution.

Returns​

Promise<QueryResult>

A query result ordered by the elevation coordinate.


pickFeatures()​

pickFeatures(
_x,
_y,
level,
longitude,
latitude): Promise<ImageryLayerFeatureInfo[]>;

Queries the feature underneath a Cesium imagery pick position.

Parameters​

ParameterTypeDescription
_xnumberTile column; the point query uses the supplied longitude instead.
_ynumberTile row; the point query uses the supplied latitude instead.
levelnumberResolution level used by the query.
longitudenumberLongitude in radians.
latitudenumberLatitude in radians.

Returns​

Promise<ImageryLayerFeatureInfo[]>

Zero or one feature containing the queried value and coordinates.

Implementation of​

ImageryProvider.pickFeatures

queryData()​

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

Queries the nearest raster cell for a WGS84 GeoJSON point.

Parameters​

ParameterTypeDescription
geometryQueryGeometryPoint geometry in [longitude, latitude] degrees.
selectors?Record<string, ZarrSelectorsProps>Optional selector overrides for this query only.
options?QueryOptionsAbort, resolution-level, and coordinate-output controls.

Returns​

Promise<QueryResult>

Values and coordinate labels for the selected cell or profile.

Throws​

For unsupported geometries, invalid selectors, or failed reads.


requestImage()​

requestImage(
x,
y,
level,
_request?): Promise<HTMLCanvasElement | ImageBitmap>;

Renders one Cesium imagery tile.

Parameters​

ParameterTypeDescription
xnumberTile column.
ynumberTile row.
levelnumberCesium imagery level.
_request?RequestCesium request metadata; currently unused.

Returns​

Promise<HTMLCanvasElement | ImageBitmap>

A vertically oriented canvas or image bitmap suitable for Cesium.

Implementation of​

ImageryProvider.requestImage

updateSelectors()​

updateSelectors(selectors): boolean;

Updates dimension selectors used for subsequent renders and queries.

Parameters​

ParameterTypeDescription
selectorsRecord<string, ZarrSelectorsProps>Selectors keyed by normalized dimension name.

Returns​

boolean

true when at least one selector changed.


updateStyle()​

updateStyle(options): boolean;

Updates tile color mapping without recreating the provider.

Parameters​

ParameterTypeDescription
options{ colormap?: string; scale?: [number, number]; }New scale and/or colormap.
options.colormap?string-
options.scale?[number, number]-

Returns​

boolean

true when the rendered tile output changed.


createLayer()​

static createLayer(viewer, options): Promise<ZarrImageryLayer>;

Creates and initializes a ZarrImageryLayer ready to add to Cesium.

Parameters​

ParameterTypeDescription
viewerCesiumHostViewer or widget that will host the layer.
optionsLayerOptionsZarr dataset and visualization options.

Returns​

Promise<ZarrImageryLayer>

A fully initialized imagery layer. Its provider is available as layer.imageryProvider.

Throws​

If metadata, dimensions, CRS, or coverage cannot be initialized.

Example​

const layer = await ZarrLayerProvider.createLayer(viewer, {
url: 'https://example.com/data.zarr',
variable: 'temperature',
scale: [0, 30]
});
viewer.imageryLayers.add(layer);

Properties​

proxy​

readonly proxy: DefaultProxy;

Gets the proxy used by this provider.

Implementation of​

ImageryProvider.proxy

tileDiscardPolicy​

readonly tileDiscardPolicy: NeverTileDiscardPolicy;

Gets the tile discard policy. If not undefined, the discard policy is responsible for filtering out "missing" tiles via its shouldDiscardImage function. If this function returns undefined, no tiles are filtered.

Implementation of​

ImageryProvider.tileDiscardPolicy