Skip to main content

ZarrCubeProvider

Provides rendering of volumetric (3D) Zarr datasets as Cesium primitives.

Remarks

This class handles loading Zarr cubes, slicing them along latitude, longitude, and elevation axes, and rendering those slices as textured Cesium primitives (both horizontal and vertical).

It supports configurable color scales, opacity, vertical exaggeration, and multiple visualization modes.

Example

const cubeProvider = new ZarrCubeProvider(viewer, {
url: 'https://example.com/mycube.zarr',
variable: 'temperature',
bounds: { west: -20, south: 30, east: 10, north: 60 },
showHorizontalSlices: true,
showVerticalSlices: true,
colormap: 'viridis'
});

await cubeProvider.load();

Constructors

Constructor

new ZarrCubeProvider(viewer, options): ZarrCubeProvider;

Creates a new instance of ZarrCubeProvider.

Parameters

ParameterTypeDescription
viewerViewerCesium viewer instance to which primitives will be added.
optionsCubeOptionsConfiguration for the cube visualization (see CubeOptions).

Returns

ZarrCubeProvider

Methods

clear()

clear(): void;

Removes all currently rendered slice primitives from the scene.

Returns

void


destroy()

destroy(): void;

Destroys all allocated Cesium primitives and clears resources.

Returns

void


load()

load(force): Promise<void>;

Loads the Zarr dataset and initializes the cube data and metadata.

Parameters

ParameterTypeDefault valueDescription
forcebooleanfalseIf true, forces reloading of the dataset even if already loaded.

Returns

Promise<void>

A promise that resolves when the cube data is fully loaded.


updateSelectors()

updateSelectors(options:): void;

Updates the dimension selectors, multiscale level, and bounds.

Parameters

ParameterTypeDescription
options:{ bounds?: BoundsProps; multiscaleLevel?: number; selectors?: { [key: string]: ZarrSelectorsProps; }; }selectors - New selectors mapping. See ZarrSelectorsProps. - multiscaleLevel - Multiscale level to switch to. - bounds - Updated geographic bounds. See BoundsProps.
options:.bounds?BoundsProps-
options:.multiscaleLevel?number-
options:.selectors?{ [key: string]: ZarrSelectorsProps; }-

Returns

void


updateSlices()

updateSlices(options:): void;

Updates the rendered slices based on the provided indices.

Parameters

ParameterTypeDescription
options:{ belowSeaLevel?: boolean; elevationIndex?: number; force?: boolean; latIndex?: number; lonIndex?: number; }latIndex: Latitude slice index. - lonIndex: Longitude slice index. - elevationIndex: Elevation slice index. - force: Force re-render. - belowSeaLevel: Toggle below-sea-level height model.
options:.belowSeaLevel?boolean-
options:.elevationIndex?number-
options:.force?boolean-
options:.latIndex?number-
options:.lonIndex?number-

Returns

void


updateStyle()

updateStyle(options:): void;

Updates style parameters.

Parameters

ParameterTypeDescription
options:{ colormap?: string; opacity?: number; scale?: [number, number]; verticalExaggeration?: number; }verticalExaggeration - Vertical exaggeration factor. - opacity - Opacity. - scale - [min,max] data scaling range. - colormap - Colormap name. See ColorMapName.
options:.colormap?string-
options:.opacity?number-
options:.scale?[number, number]-
options:.verticalExaggeration?number-

Returns

void

Properties

bounds

bounds: BoundsProps;

Configuration defining the geographic bounds of the cube.


cubeDimensions

cubeDimensions: [number, number, number] | null = null;

Size of the cube in [longitude, latitude, elevation].


dimensionValues

dimensionValues: DimensionValues = {};

Values of the cube’s coordinate dimensions (latitude, longitude, elevation, etc.).


elevationShape

elevationShape: number = 0;

Shape (size) of the elevation dimension.


elevationSliceIndex

elevationSliceIndex: number = -1;

Current index of the elevation slice being visualized.


id

id: string = '';

Unique identifier for the cube provider instance.


latSliceIndex

latSliceIndex: number = -1;

Current index of the latitude slice being visualized.


levelInfos

levelInfos: string[] = [];

Information about multiscale levels in the Zarr dataset.


lonSliceIndex

lonSliceIndex: number = -1;

Current index of the longitude slice being visualized.


multiscaleLevel

multiscaleLevel: number = 0;

Current multiscale level to load.


selectors

selectors: object;

User-defined selectors for slicing dimensions.

Index Signature

[key: string]: ZarrSelectorsProps