deriveRectangleAndScheme()
function deriveRectangleAndScheme(
crs,
xyLimits,
levelMetadata,
zarrArray,
dimIndices): object;
Computes a Cesium Rectangle and TilingScheme for a Zarr dataset.
Parameters
| Parameter | Type | Description |
|---|---|---|
crs | CRS | CRS code (EPSG:4326 or EPSG:3857). See CRS. |
xyLimits | XYLimitsProps | Min/max X/Y values in the dataset's CRS. See XYLimitsProps. |
levelMetadata | Map<number, ZarrLevelMetadata> | Per-resolution metadata (width/height). |
zarrArray | Array<any> | The Zarr array containing the data. |
dimIndices | DimIndicesProps | Mapping 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. - For EPSG:3857, the function interprets
xyLimitsas Web Mercator meters and usesWebMercatorProjection.unprojectto obtain geographic radians. - If any computation fails, the function falls back to a full-world tiling scheme (WebMercator or Geographic).
- If latitude limits are reversed, they are swapped automatically.