Skip to main content

deriveRectangleAndScheme()

function deriveRectangleAndScheme(
crs,
xyLimits,
levelMetadata,
zarrArray,
dimIndices
): object;

Computes a Cesium Rectangle and TilingScheme for a Zarr dataset.

Parameters​

ParameterTypeDescription
crsstringA CRS identifier registered with proj4. See CRS.
xyLimitsXYLimitsPropsMin/max X/Y values in the dataset's CRS. See XYLimitsProps.
levelMetadataMap<number, ZarrLevelMetadata>Per-resolution metadata (width/height).
zarrArrayArray<any>The Zarr array containing the data.
dimIndicesDimIndicesPropsMapping of dimension keys to their array indices. See DimIndicesProps.

Returns​

object

{ rectangle, tilingScheme }

rectangle​

rectangle: Rectangle;

tilingScheme​

tilingScheme: TilingScheme;

Remarks​

Behavior notes:

  • The rectangle is expanded by half a pixel in all directions to avoid edge clipping.
  • Pixel resolution is estimated from either levelMetadata.get(0) or the Zarr array shape.
  • Source bounds are densified and transformed through the shared proj4 resolver.
  • If any computation fails, the function falls back to a full-world geographic scheme.
  • If latitude limits are reversed, they are swapped automatically.