Windowed raster access
Read the window that answers the question.
Raster sources use metadata before pixels: discover the layout, choose the useful window, and decode only the ranges or chunks that cover it.
01 · discover
Zarr / GeoZarr / OME-Zarr
Arrays, dimensions, scales, and conventions describe independently addressable chunks.
02 · select
Select a named window
Choose variables, channels, levels, time, or spatial slices before reading chunks.
03 · application result
Typed array result
Values return with dimension metadata and coordinate meaning intact. ↗
A local file may use direct offsets; a cloud source may use HTTP ranges or object-store chunks. The application-facing selection remains the same.
The chunked-array path
Discover the array, then select a window.
Zarr stores large arrays as independently addressable chunks. Source metadata identifies dimensions, scales, variables, and coordinate meaning before a request reads the selected region.
Datasets
GeoZarr, OME-Zarr, and generic Zarr arrays
Selection
Spatial windows, bands, channels, time, and levels
Access
Chunk reads from local files or object storage
Output
Typed raster data with source metadata
See Coordinate Reference Systems for GeoZarr CRS discovery, current native-CRS behavior, and the raster-warping roadmap.
The @loaders.gl/scientific module reads chunked, multidimensional Zarr
arrays. It supports the existing pixel-pyramid API, an OME-Zarr source API for bioimaging, and a
GeoZarr/CF source API for georeferenced Earth-science rasters.
Detailed guide
Zarr source and array details
The sections below cover installation, source APIs, metadata discovery, chunk selection, and the supported Zarr conventions.
Installation
npm install @loaders.gl/core @loaders.gl/scientific
APIs
OMEZarrLoaderopens OME-Zarr v2 and v3 image groups throughcreateDataSource()orload().GeoZarrLoaderopens one georeferenced Zarr data variable and reads native spatial windows with named time, vertical, or band selections.SpatialDataLoaderdiscovers named images, labels, points, shapes, and tables from a SpatialData root. It opens Zarr-backed raster and AnnData array elements directly and reports interoperable Parquet-dataset and GeoParquet URLs for points and shapes.loadZarrConsolidatedMetadata()probes.zmetadata,zmetadata, andzarr.jsondocuments and reports top-level arrays and groups.loadZarr()andZarrPixelSourceprovide the legacy Zarr v2 pixel-pyramid API.
Example
import {createDataSourceSync} from '@loaders.gl/core';
import {OMEZarrLoader} from '@loaders.gl/scientific/zarr';
const source = createDataSourceSync('https://example.com/spatialdata.zarr', [OMEZarrLoader], {
zarr: {path: 'images/example-image'}
});
const metadata = await source.getMetadata();
const raster = await source.getRaster({level: 0, channels: [0, 1, 2]});
The OME-Zarr example demonstrates browsing a SpatialData-style root and selecting an image pyramid.
For climate, weather, ocean, satellite, and other Earth-science stores, use
GeoZarrLoader. It recognizes the current GeoZarr proj: and spatial: conventions as
well as the regular one-dimensional coordinate arrays commonly written by xarray/CF workflows.
The GeoZarr deck.gl example reads a public NASA POWER climatology
store directly from S3 and renders monthly solar irradiance on an interactive map.
Feature matrix
| Capability | Zarr v2 | Zarr v3 | OME-Zarr | GeoZarr / CF | Status |
|---|---|---|---|---|---|
| Browser and Node.js reads | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Available |
| HTTP range/chunked access | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Available |
| Consolidated metadata discovery | .zmetadata, zmetadata | zarr.json | ✅ Yes | ✅ Yes | ✅ Available |
| Multidimensional arrays and named dimensions | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Available |
| Chunk-aware raster reads | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Available |
| OME image channels, time, and z planes | — | — | ✅ Yes | — | ✅ Available |
| OME multiscale pyramids | — | — | ✅ Yes | — | ✅ Available |
| Automatic display-level selection | — | — | ✅ Yes | — | ✅ Available |
| Scan metadata and source discovery | — | — | ✅ Yes | ✅ Yes | ✅ Available through both raster sources |
GeoZarr proj: and spatial: metadata | — | — | — | ✅ Yes | ✅ Available |
| CF/xarray coordinates, time, vertical, and band selection | — | — | — | ✅ Yes | ✅ Available |
| Viewport-driven geospatial windows | — | — | — | ✅ Yes | ✅ Available |
| Typed planar or interleaved channel output | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Available |
| Zarrita-backed v2/v3 implementation | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Available |
| SpatialData images, labels, points, shapes, and tables | — | — | ✅ Yes | — | ⚠️ Discovery and typed storage references available |
| Codec expansion and broader multiscale layouts | ⚠️ Partial | ⚠️ Partial | ❌ Planned | ❌ Planned | ❌ Planned |
| Common raster query execution | — | — | Levels, channels, and slices | Native spatial windows and named selections | ✅ Available |
Scan support
Zarr participates through two raster sources. Both read only the selected chunks and preserve typed array output, but their query vocabulary reflects the kind of array being opened.
| Capability | OME-Zarr | GeoZarr / CF |
|---|---|---|
| Entry point | getRaster() | getRaster() |
| Metadata discovery | Channels, dimensions, multiscale levels | Variable, dtype, dimensions, bounds, CRS |
| Spatial window | Image window | Native-CRS viewport bounds |
| Resolution | Multiscale level pushdown | Native resolution; explicit level unsupported |
| Non-spatial selection | Channels, time, and z slices | Named time, vertical, band, or other dimension indices |
| Physical access | Selected Zarr chunks and codecs | Selected Zarr chunks and codecs |
| Output | Typed planar or interleaved pixels | Typed raster data |
| Reprojection | Not applicable to ordinary OME image coordinates | ❌ Not performed |
Query metadata is suitable for populating source-neutral controls before pixel data is requested. GeoZarr bounds must use the source CRS; callers should reproject the viewport before requesting a window when necessary.
SpatialData containers
SpatialDataLoader normalizes the five standard SpatialData namespaces without loading
element payloads. Each element retains its axes, coordinate transformations, format version, and
original attributes. Image and label descriptors use ome-zarr; point descriptors use
parquet-dataset; shape descriptors use geoparquet; and table descriptors use anndata-zarr.
import {createDataSourceSync} from '@loaders.gl/core';
import {SpatialDataLoader} from '@loaders.gl/scientific/zarr';
const source = createDataSourceSync(rootUrl, [SpatialDataLoader]);
const metadata = await source.getMetadata();
const image = await source.createRasterSource('image', metadata.images[0].name);
const expression = await source.createTableArraySource('annotations', 'X');
SpatialData points are Dask-style Parquet datasets and shapes are GeoParquet files. Their normalized
descriptors expose the canonical points.parquet and shapes.parquet URLs so applications can
hand them to the corresponding loaders.gl Parquet sources without coupling the lightweight Zarr
module to the complete Parquet runtime.
Attributions
The OME-Zarr source uses zarrita.js under the MIT license. The legacy Zarr v2 API wraps zarr.js under the MIT license.