Skip to content

topozarr

topozarr topozarr

Create multiscale Zarr stores for web visualization.

Built for use with zarr-layer. Writes Zarr v3 stores that follow the GeoZarr conventions.

  • multiscales
    Which groups are levels and how each derives from the last.

  • proj
    Which coordinate reference system the data uses.

  • spatial
    How array indices map to coordinates.

Installation

uv add topozarr

# optional extras
uv add 'topozarr[tutorial]'  # deps for the Usage examples
uv add 'topozarr[zarrs]'     # faster local writes (Rust codec pipeline)
pip install topozarr

# optional extras
pip install 'topozarr[tutorial]'  # deps for the Usage examples
pip install 'topozarr[zarrs]'     # faster local writes (Rust codec pipeline)
pixi add --pypi topozarr

# optional extras
pixi add --pypi 'topozarr[tutorial]'  # deps for the Usage examples
pixi add --pypi 'topozarr[zarrs]'     # faster local writes (Rust codec pipeline)

Quick example

import xarray as xr
import xproj  # for CRS assignment
from topozarr import create_pyramid

ds = xr.tutorial.open_dataset("air_temperature").drop_encoding()
ds = ds.proj.assign_crs(spatial_ref="EPSG:4326")

pyramid = create_pyramid(ds, levels=2, x_dim="lon", y_dim="lat")
pyramid.write("pyramid.zarr")

Open the result in zarr-layer. See Usage for cloud stores and options, and Tips and caveats for performance settings and common problems.