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
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
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>
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
Implementation of
ImageryProvider.tilingScheme
Constructors
Constructor
new ZarrLayerProvider(options): ZarrLayerProvider;
Creates a Cesium imagery provider backed by a URL or custom Zarrita store.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | LayerOptions | Dataset, tiling, selection, style, and request options. |
Returns
ZarrLayerProvider
Remarks
Prefer createLayer when adding the result to a viewer.
Methods
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
| Parameter | Type | Description |
|---|---|---|
start | QueryPosition | Starting [longitude, latitude] coordinate in degrees. |
end | QueryPosition | Ending [longitude, latitude] coordinate in degrees. |
selectors? | ZarrSelectors | Fixed selectors for dimensions other than elevation. |
options? | TransectQueryOptions | Sample 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
| Parameter | Type | Description |
|---|---|---|
position | QueryPosition | [longitude, latitude] in degrees. |
selectors? | ZarrSelectors | Fixed selectors for dimensions other than time. |
options? | QueryOptions | Query 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
| Parameter | Type | Description |
|---|---|---|
start | QueryPosition | Starting [longitude, latitude] coordinate in degrees. |
end | QueryPosition | Ending [longitude, latitude] coordinate in degrees. |
selectors? | ZarrSelectors | Dimension selectors applied to every sample. |
options? | TransectQueryOptions | Sample 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
| Parameter | Type | Description |
|---|---|---|
position | QueryPosition | [longitude, latitude] in degrees. |
selectors? | ZarrSelectors | Fixed selectors for dimensions other than elevation. |
options? | QueryOptions | Query 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
| Parameter | Type | Description |
|---|---|---|
_x | number | Tile column; the point query uses the supplied longitude instead. |
_y | number | Tile row; the point query uses the supplied latitude instead. |
level | number | Resolution level used by the query. |
longitude | number | Longitude in radians. |
latitude | number | Latitude 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
| Parameter | Type | Description |
|---|---|---|
geometry | QueryGeometry | Point geometry in [longitude, latitude] degrees. |
selectors? | Record<string, ZarrSelectorsProps> | Optional selector overrides for this query only. |
options? | QueryOptions | Abort, 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
| Parameter | Type | Description |
|---|---|---|
x | number | Tile column. |
y | number | Tile row. |
level | number | Cesium imagery level. |
_request? | Request | Cesium 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
| Parameter | Type | Description |
|---|---|---|
selectors | Record<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
| Parameter | Type | Description |
|---|---|---|
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
| Parameter | Type | Description |
|---|---|---|
viewer | CesiumHost | Viewer or widget that will host the layer. |
options | LayerOptions | Zarr 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