Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

How does a 100 × 100 window come out of a 60 MB band?

GeoStack · storage background · bytes → array

Abstract

Pictures first, maths folded away. Every cloud-native format answers the same question: given the pixels you want, which bytes do you fetch? COG, GeoParquet and Zarr each answer it with an index. kerchunk, VirtualiZarr and Icechunk separate that index from the files, so one set of bytes can be read as Zarr, combined with others and versioned.

The running example

The four read paths as operators, the kinds of object and the symbols

Each read path below is written as an operator: what you pass in, what the format already stores (the constants), what the reader works out on the way (the estimated quantities), and what comes back (the output). Each symbol in the equations takes the colour of its role. None of them has parameters to fit.

1 · COG window read

Read a window from a COG. The tile size gives the tiles the window touches, the offsets in the TIFF header give their byte ranges, and the reader fetches exactly those, decodes and crops.

I={⌊r0/P⌋,…,⌊r1/P⌋}\rEst{\mathcal{I}} = \{ \lfloor r_0 / \rCon{P} \rfloor, \ldots, \lfloor r_1 / \rCon{P} \rfloor \}
J={⌊c0/P⌋,…,⌊c1/P⌋}\rEst{\mathcal{J}} = \{ \lfloor c_0 / \rCon{P} \rfloor, \ldots, \lfloor c_1 / \rCon{P} \rfloor \}
k=iNside+j, (i,j)∈I×J\rEst{k} = i \rCon{N_\text{side}} + j, \ (i, j) \in \rEst{\mathcal{I}} \times \rEst{\mathcal{J}}
xw=cropw(decode(GET(url,[ok,ok+ℓk))))\rOut{\vect{x}_{\vect{w}}} = \mathrm{crop}_{\vect{w}}(\mathrm{decode}(\mathrm{GET}(\mathrm{url}, [\rCon{o_k}, \rCon{o_k} + \rCon{\ell_k}))))
RoleSymbolNameShapeUnitNote
Inputurlfile address()—
w\rIn{\vect{w}}pixel window(4,)px
Parameternonenothing to fit
ConstantP\rCon{P}tile size()pxfrom the TIFF header
Nside\rCon{N_\text{side}}tiles per row()—from the TIFF header
o\rCon{\vect{o}}tile byte offsets(tile,)Bthe TileOffsets tag; entry kk is oko_k
ℓ\rCon{\vect{\ell}}tile byte lengths(tile,)Bthe TileByteCounts tag; entry kk is ℓk\ell_k
EstimatedI\rEst{\mathcal{I}}tile rows(tile,)—eq. 1
J\rEst{\mathcal{J}}tile columns(tile,)—eq. 2
k\rEst{k}tile index(tile,)—eq. 3
Outputxw\rOut{\vect{x}_{\vect{w}}}window pixels(row, col)DNeq. 4

2 · GeoParquet query

The same scenes, found by a table query instead of a file name. Row-group statistics rule out whole groups first, and the bbox and time columns then filter the rows that remain.

keepg  ⟺  bg∩bquery≠∅∧Tg∩Tquery≠∅\rEst{\mathrm{keep}_g} \iff \rCon{\vect{b}_g} \cap \rIn{\vect{b}_\text{query}} \neq \varnothing \wedge \rCon{\mathcal{T}_g} \cap \rIn{\mathcal{T}_\text{query}} \neq \varnothing
keepn  ⟺  keepg(n)∧bn∩bquery≠∅∧Tn∩Tquery≠∅\rOut{\mathrm{keep}_n} \iff \rEst{\mathrm{keep}_{g(n)}} \wedge \rCon{\vect{b}_n} \cap \rIn{\vect{b}_\text{query}} \neq \varnothing \wedge \rCon{\mathcal{T}_n} \cap \rIn{\mathcal{T}_\text{query}} \neq \varnothing
RoleSymbolNameShapeUnitNote
Inputbquery\rIn{\vect{b}_\text{query}}bounding box(4,)m
Tquery\rIn{\mathcal{T}_\text{query}}time range(2,)time
Parameternonenothing to fit
Constantbg\rCon{\vect{b}_g}row-group bounding box(group, 4)mfrom the row-group statistics
Tg\rCon{\mathcal{T}_g}row-group time range(group, 2)timefrom the row-group statistics
bn\rCon{\vect{b}_n}row bounding box(row, 4)mthe bbox column
Tn\rCon{\mathcal{T}_n}row time range(row, 2)timethe time column
Estimatedkeepg\rEst{\mathrm{keep}_g}row-group filter(group,)booleq. 1
Outputkeepn\rOut{\mathrm{keep}_n}row filter(row,)booleq. 2

3 · Zarr chunk read

The same tiles, addressed by a key instead of an offset. The chunk indices I×J\mathcal{I} \times \mathcal{J} are those of step 1, with chunk shape (P,P)(P, P), and each pair becomes a key in the store.

κij=B12/c/i/j\rEst{\kappa_{ij}} = \texttt{B12/c/}i\texttt{/}j
xw=cropw(decode(GET(κij)))\rOut{\vect{x}_{\vect{w}}} = \mathrm{crop}_{\vect{w}}(\mathrm{decode}(\mathrm{GET}(\rEst{\kappa_{ij}})))
RoleSymbolNameShapeUnitNote
InputstoreZarr store()—
w\rIn{\vect{w}}pixel window(4,)px
Parameternonenothing to fit
ConstantP\rCon{P}chunk size()pxfrom zarr.json
codecscompression codecs—from zarr.json
Estimatedκij\rEst{\kappa_{ij}}chunk keys(chunk,)keyeq. 2
Outputxw\rOut{\vect{x}_{\vect{w}}}window pixels(row, col)DNeq. 3

4 · Icechunk virtual read

The same keys, resolved to the original COG’s bytes. The keys κij\kappa_{ij} are those of step 3; the snapshot’s manifest maps each one to a URL, an offset and a length, so the read fetches from the COG itself.

(urlk,ok,ℓk)=refσ(κij)(\rEst{\mathrm{url}_k}, \rEst{o_k}, \rEst{\ell_k}) = \rCon{\mathrm{ref}_\sigma}(\rEst{\kappa_{ij}})
xw=cropw(decode(GET(urlk,[ok,ok+ℓk))))\rOut{\vect{x}_{\vect{w}}} = \mathrm{crop}_{\vect{w}}(\mathrm{decode}(\mathrm{GET}(\rEst{\mathrm{url}_k}, [\rEst{o_k}, \rEst{o_k} + \rEst{\ell_k}))))
RoleSymbolNameShapeUnitNote
Inputrepo@σ\rIn{\sigma}repository snapshot()—
w\rIn{\vect{w}}pixel window(4,)px
Parameternonenothing to fit
Constantrefσ\rCon{\mathrm{ref}_\sigma}snapshot manifest(chunk,)refs
Estimatedκij\rEst{\kappa_{ij}}chunk keys(chunk,)keyeq. 1
(urlk,ok,ℓk)\rEst{(\mathrm{url}_k, o_k, \ell_k)}chunk references(chunk,)Beq. 2
Outputxw\rOut{\vect{x}_{\vect{w}}}window pixels(row, col)DNeq. 3

The kinds of object on this page

KindDimensionsExample here
field(row, col)the band B12, the window xw\vect{x}_{\vect{w}}
vector(tile,)tile offsets o\vect{o}, lengths ℓ\vect{\ell}
mask(tile,), (row,)which tiles, row groups, rows to read
dataset(row, column), (chunk,)a catalog table, a chunk manifest

rr indexes pixel rows and cc pixel columns, from 0; ii and jj index tile rows and tile columns; kk numbers tiles in file order; gg indexes Parquet row groups and nn table rows.

SymbolRoleShapeUnit
w=(r0,r1,c0,c1)\vect{w} = (r_0, r_1, c_0, c_1)in · the window, inclusive boundsZ4\mathbb{Z}^4 (4,)px
PPconst · tile or chunk sideZ>0\mathbb{Z}_{>0}px
Nside=⌈Nc/P⌉N_\text{side} = \lceil N_c / P \rceilconst · tiles per row of tilesZ>0\mathbb{Z}_{>0}—
o,ℓ\vect{o}, \vect{\ell}const · byte offsets and byte lengths of the tiles; entry kk is oko_k, ℓk\ell_kZNside2\mathbb{Z}^{N_\text{side}^2} (tile,)B
I,J\mathcal{I}, \mathcal{J}est · tile rows and columns the window touchesindex sets—
κij\kappa_{ij}est · the Zarr key of chunk (i,j)(i, j)stringkey
refσ\mathrm{ref}_\sigmaconst · manifest of snapshot σ\sigma: key to referencemap (chunk,)refs
bquery\vect{b}_\text{query}, Tquery\mathcal{T}_\text{query}in · query box and time intervalR4\mathbb{R}^4, intervalm time
bg,Tg\vect{b}_g, \mathcal{T}_gconst · bounding box and time range of row group gg(group, 4), (group, 2)m time
xw\vect{x}_{\vect{w}}out · the pixels of the windowZ100×100\mathbb{Z}^{100 \times 100} (row, col)DN

Part 1 · Three formats, three indexes

COG: a GeoTIFF you can read in pieces

Our band is one file of 60.3 MB. A plain GeoTIFF stored in strips, or with its header at the end, forces a reader to fetch most of it to find anything. A Cloud-Optimized GeoTIFF puts the header first, stores the image in square tiles, and adds downsampled overviews, so the header alone says exactly which bytes hold which pixels.

The band B12: 11×1111 \times 11 tiles of 512 px512\ \mathrm{px}

Zoom: the 4 tiles the site touches

tile 38tile 39tile 49tile 50

the site: 100×100 px100 \times 100\ \mathrm{px}

headeroverviewsfull-res tiles 0…1200 \ldots 120

The file, in byte order (60 MB). The header lists where each tile starts and how long it is. The reader fetches: the header, then 4 byte ranges ≈\approx 2 MB.

A COG answers “which bytes hold these pixels?” from its header alone. Our 100 × 100 site straddles a corner shared by four tiles, so four ranges are fetched.

  1. Read the header, a few kilobytes at the start of the file.

  2. Work out which tiles the window touches, by dividing pixel positions by the tile size.

  3. Fetch only those tiles, one byte range each, and decode them.

# Shapes: C bands; window of H × W pixels; T tiles touched
# Units:  [DN] = Sentinel-2 L2A digital number; [B] = bytes
import geoarray
import geocloud.cog

# today (geocloud)
source = geocloud.cog.CogSource.open(b12_url)                   # header only  ≈ kB
# today (geoarray)
window = geoarray.PixelWindow(                                  # → (4,)  px
    col_off=3050, row_off=2000, width=100, height=100
)
# k = i N_side + j for (i, j) ∈ 𝓘 × 𝓙; x_w = crop(decode(GET(url, [o_k, o_k + ℓ_k))))
# today (geocloud)
site = source.read_window(window)                       # → (1, 100, 100)  [DN]

The tile index in symbols, as an operator, with the byte count

Concept

A COG is a tile index in front of compressed tiles

The header (the TIFF IFD) records the tile side and, for every tile in file order, where it starts and how many bytes it takes. A window maps to tile indices by integer division, and each tile to one byte range:

kij=iNside+jk_{ij} = i N_\text{side} + j
bytes(k)=[ok,ok+ℓk)\mathrm{bytes}(k) = [o_k, o_k + \ell_k)

Overviews repeat the same layout at half, quarter, … resolution, so a zoomed-out view reads small tiles from a small image.

Where

SymbolMeaningShapeUnit
i,ji, jtile row and tile columnZ≥0\mathbb{Z}_{\ge 0}—
NsideN_\text{side}tiles per row of tiles, ⌈Nc/P⌉\lceil N_c / P \rceilZ>0\mathbb{Z}_{>0}—
ok,ℓko_k, \ell_kTileOffsets and TileByteCounts of tile kkZ≥0\mathbb{Z}_{\ge 0}B

Use · CogSource.read_window

Works at any level, one call per window. It works out the tiles the window touches from the header, fetches their byte ranges, and returns the pixels as a GeoArray with the window’s transform.

I={⌊r0/P⌋,…,⌊r1/P⌋}\rEst{\mathcal{I}} = \{ \lfloor r_0 / \rCon{P} \rfloor, \ldots, \lfloor r_1 / \rCon{P} \rfloor \}
J={⌊c0/P⌋,…,⌊c1/P⌋}\rEst{\mathcal{J}} = \{ \lfloor c_0 / \rCon{P} \rfloor, \ldots, \lfloor c_1 / \rCon{P} \rfloor \}
k=iNside+j\rEst{k} = i \rCon{N_\text{side}} + j
xw=cropw(decode(GET(url,[ok,ok+ℓk))))\rOut{\vect{x}_{\vect{w}}} = \mathrm{crop}_{\vect{w}}(\mathrm{decode}(\mathrm{GET}(\mathrm{url}, [\rCon{o_k}, \rCon{o_k} + \rCon{\ell_k}))))

Nothing is trained. The tile size is the file’s choice, and it sets how many bytes a small window costs.

GroupNameNoteShapeUnit
Inurlthe COG, on object storage or over HTTP()—
w\rIn{\vect{w}} windowa PixelWindow: row and column offset, height, width(4,)px
Parameters \gvect{\theta}nonea read has nothing to fit—
Constants · in the file headerP\rCon{P}, Nside\rCon{N_\text{side}}TileWidth, and the tile grid it implies(), ()px
o,ℓ\rCon{\vect{o}, \vect{\ell}}TileOffsets, TileByteCounts(tile,)B
Estimated in each callI,J,k\rEst{\mathcal{I}, \mathcal{J}, k} tiles touchedeq. 1–3(tile,)—
Outxw\rOut{\vect{x}_{\vect{w}}} windoweq. 4; a GeoArray with the window’s transform(band, row, col)DN

GeoParquet: a table you can read by column and by place

Before reading any pixel you need the six June scenes that cover the site. That is a table question: which rows have a footprint over bquery\vect{b}_\text{query} and a time inside Tquery\mathcal{T}_\text{query}? GeoParquet is Parquet with a standard geometry column, and it answers that question without reading the whole table.

A catalog table, stored by column and by row group
idfilepathstart_timegeometrybboxcloudrow group 02025 · skippedrow group 1Jan–May 2026 · skippedrow group 2Jun 2026 · readrow group 3Jul–Dec 2026 · skipped
footer: min / max of every column, per row group
A June query over the site reads 1 row group and 3 columns, and returns 6 rows.

The reader starts at the footer, keeps only row groups whose time range and bounding box can match, and fetches only the columns it asks for. Row-group sizes and dates are illustrative.

Sorting decides how much a query skips. geocatalog’s build_raster_catalog sorts rows by start_time, then by a Hilbert key of the geometry, by default, so rows close in time and space land in the same row groups.

# Shapes: R rows in the catalog; G row groups; S rows kept
# Units:  bounds in the catalog CRS [m]; times naive UTC
import geocatalog

# today (geocatalog)
catalog = geocatalog.open_catalog("s3://bkt/s2_l2a.parquet")    # footer only → R rows
# keep_g ⇔ b_g ∩ b_query ≠ ∅ ∧ 𝒯_g ∩ 𝒯_query ≠ ∅, then the same test per row
# today (geocatalog)
june = catalog.query(site_june)                                 # R → S = 6 rows

Row-group skipping in symbols

Concept

Parquet stores a table by column and by row group

Rows are cut into row groups; inside a group each column is stored on its own, and the file footer keeps each column’s minimum and maximum per group. A reader fetches only the columns it needs, and skips any group whose statistics cannot match. GeoParquet adds the geometry column (WKB) and, in version 1.1, a bounding-box column whose statistics make spatial skipping work:

keepg  ⟺  bg∩bquery≠∅∧Tg∩Tquery≠∅\mathrm{keep}_g \iff \vect{b}_g \cap \vect{b}_\text{query} \neq \varnothing \wedge \mathcal{T}_g \cap \mathcal{T}_\text{query} \neq \varnothing

Where

SymbolMeaningShapeUnit
gga row group, a few thousand to a million rowsZ≥0\mathbb{Z}_{\ge 0}—
bg\vect{b}_gsmallest box holding every footprint in group ggR4\mathbb{R}^4m
Tg\mathcal{T}_gearliest start and latest end time in group ggintervaltime

Zarr: an array split into keyed chunks

A COG is one file with an internal index. Zarr turns the index inside out: each chunk is its own object, its name is computed from its position, and a small JSON file describes the array. Nothing has to be read to find a chunk; the key says where it is.

The same band as Zarr: one object per chunk
zarr.json: shape, chunk shape, data type, codecsThe key is computed from the position: nothing to look up.
s3://bkt/b12.zarr/zarr.jsonB12/zarr.jsonB12/c/0/0B12/c/0/1…B12/c/3/5B12/c/3/6…B12/c/4/5B12/c/4/6…B12/c/10/10

Where a COG keeps an index of offsets, Zarr names each chunk by its position. The site window still needs the same four chunks.

Version 3 adds sharding: many chunks packed into one object with a small index at its end, so a store need not hold millions of tiny objects.

FormatUnit of accessWhere the index livesBest for
COGa tile, by byte rangethe TIFF header, at the start of the fileone scene, one grid; any GIS reads it
GeoParqueta column of a row groupthe footer’s per-group statisticstables: catalogs, points, polygons
Zarra chunk, by keythe key itself; shapes in zarr.jsonN-dimensional cubes, many variables, appends
# Shapes: H × W window; chunks of P × P
# Units:  [DN]
import xarray as xr

# not pinned (xarray)
band = xr.open_zarr("s3://bkt/b12.zarr")["B12"]                # zarr.json only
# κ_ij = B12/c/i/j for (i, j) ∈ 𝓘 × 𝓙
# not pinned (xarray)
site = band.isel(y=slice(2000, 2100), x=slice(3050, 3150))  # → (100, 100)  [DN]
# not pinned (xarray)
pixels = site.values                                            # reads 4 chunks  [DN]

Chunk keys in symbols

Concept

A Zarr array is metadata plus one object per chunk

zarr.json stores the array’s shape, chunk shape, data type and codec chain. Chunk (i,j)(i, j) of array B12 lives under a key built from its indices (Zarr v3’s default encoding), and groups nest arrays like folders:

κij=B12/c/i/j\kappa_{ij} = \texttt{B12/c/}i\texttt{/}j

Version 3 adds sharding: many chunks packed into one object, with an index at its end, so a store need not hold millions of tiny objects.

Where

SymbolMeaningShapeUnit
κij\kappa_{ij}the object key of chunk (i,j)(i, j)stringkey
PPchunk side, as for COG tilesZ>0\mathbb{Z}_{>0}px

COG and Zarr: what maps to what

A COG and a Zarr array store the same thing in the same way: a grid cut into compressed blocks, plus a small description. They differ in where the index lives (inside one file, or in the keys), in how many dimensions they allow, and in how georeferencing is written down.

COGZarr

header (IFD)metadatazarr.json

tiles, in byte ordersame byteschunks, one object per key

TileOffsets, TileByteCountsthe indexthe key (or a shard index)

DEFLATE / ZSTD (+ predictor)same, if the codec existscodec chain

nodata tagdirectfill_value

GeoKeys, geotransformneeds a conventionattributes: CF spatial_ref, GeoZarr

overviewsneeds a conventionmultiscales: one array per level

2-D image (+ bands)Zarr is more generalany dims: time, band, y, x

maps directly maps only through an agreed convention

The pixels and their compressed tiles map one-to-one. What a GIS needs to place them on the Earth does not, unless both sides agree on a convention.

Is it a one-to-one translation?

Can Zarr read a COG directly?

Not by itself. zarr-python reads stores laid out as Zarr keys, and a COG is one file with its own index. Three bridges give a COG a Zarr face without converting it:

In the other direction, GDAL’s Zarr driver reads Zarr, so gdal_translate can write a Zarr array out as a COG.

Converting, with the stack

# Shapes: C bands; (y, x) = (5490, 5490); chunks and tiles of 512 × 512
# Units:  [DN]
import geoarray
import geocloud.cog
import geoops.io
import xarray as xr

# --- COG → Zarr, as a copy ---
# today (geocloud)
scene = geocloud.cog.CogSource.open(b12_url).load()            # → (1, 5490, 5490)  [DN]
# today* (geoops)
write = geoops.io.WriteZarr(store="s3://bkt/b12.zarr", chunks={"y": 512, "x": 512})
write(scene)

# --- Zarr → COG ---
# not pinned (xarray)
band = xr.open_zarr("s3://bkt/b12.zarr")["B12"]
# today (geoarray)
grid = geoarray.from_xarray(band)                              # → (1, 5490, 5490)  [DN]
# today (geocloud)
geocloud.cog.write_cog(grid, "s3://bkt/b12_copy.tif")

The third route needs no copy at all: open the COG with VirtualiZarr’s TIFF parser, and its tiles become Zarr chunks by reference. That is Part 2.

Part 2 · Pointers instead of copies

Look at boxes 1 and 3 again. A COG tile and a Zarr chunk are the same thing: a compressed block of pixels at a known place. A Zarr reader does not care whether the bytes of B12/c/3/5 sit in their own object or inside a COG, as long as it can find them. That observation is all three tools below are built on.

Zarr asks for keyB12/c/3/5

referenceurl: …/B12.tifoffset: o38o_{38}length: ℓ38\ell_{38}

A Zarr reader only needs the bytes. Where they live is the reference’s job.

the original COG, untouched: bytes [o38,o38+ℓ38)[o_{38}, o_{38} + \ell_{38})

One reference per chunk turns existing files into a Zarr store without copying a byte.

The reference in symbols

Concept

A chunk reference is where the bytes are, not the bytes

For every Zarr key, store a reference to bytes that already exist, and give the reader the codec chain to decode them:

ref(κij)=(urlk,ok,ℓk)\mathrm{ref}(\kappa_{ij}) = (\mathrm{url}_k, o_k, \ell_k)

A set of references plus the array metadata is a virtual Zarr store: Zarr’s interface over the original files, with nothing copied.

Where

SymbolMeaningShapeUnit
urlk\mathrm{url}_kthe original file holding tile kkstring—
ok,ℓko_k, \ell_kthe tile’s offset and length in that file, from its headerZ≥0\mathbb{Z}_{\ge 0}B

kerchunk: references written to a file

kerchunk scans an archival file (HDF5, NetCDF, GRIB, TIFF) and writes its references to a JSON or Parquet file. fsspec’s reference filesystem then serves the keys, so xarray opens the archive as if it were Zarr. kerchunk predates Zarr v3, so its keys use v2’s dotted form.

# a kerchunk reference file, abbreviated: Zarr v2 keys → [url, offset, length]
{
  "version": 1,
  "refs": {
    "B12/.zarray": "{\"shape\": [5490, 5490], \"chunks\": [512, 512], ...}",
    "B12/3.5": ["s3://bkt/T30SYJ_20260601_B12.tif", o_38, ℓ_38],
    "B12/3.6": ["s3://bkt/T30SYJ_20260601_B12.tif", o_39, ℓ_39]
  }
}

VirtualiZarr: references as xarray objects

VirtualiZarr opens an archival file with a parser for its format and returns an xarray.Dataset whose variables are ManifestArrays: arrays of chunk references, not of values. You can concatenate, merge and rename them with ordinary xarray calls, then write the result to kerchunk JSON or Parquet, or into an Icechunk repo. It has parsers for HDF5/NetCDF4, NetCDF3, TIFF, GRIB, FITS, DMR++ and existing kerchunk and Zarr stores.

# Shapes: N_scene scenes; per scene one (y, x) band in N_side² chunks
# Units:  references only; no pixel values are read
import virtualizarr
import xarray as xr

# not pinned (virtualizarr)
scene = virtualizarr.open_virtual_dataset(                      # → 121 refs
    url=b12_url, parser=tiff_parser, registry=registry
)
# the six June scenes along a new time axis: only manifests are joined
# not pinned (virtualizarr)
june = xr.concat(scenes, dim="time")                            # → 726 refs

Icechunk: a versioned store for real and virtual chunks

Icechunk is a storage engine for Zarr v3. A repository holds array metadata, chunks written into it, and references to chunks elsewhere, and every change goes through a transaction that ends in a commit. Each commit is a snapshot with an id; branches and tags name snapshots. Readers open a snapshot and see a consistent store, whatever writers are doing.

Three ways to hold references to the same six files

kerchunk refs.json B12/3.5 → […] B12/3.6 → […] … a file of references
no versions, no commits

writewriteVirtualiZarr Dataset time: 6 y, x: 5490 ManifestArray references in memory,
combined with xarray

Icechunk repo

tag: jun-2026σ1\sigma_1σ2\sigma_2σ3\sigma_3main

real chunks + references to files
each commit a snapshot

Jun 1 .tifJun 6 .tifJun 11 .tifJun 16 .tifJun 21 .tifJun 26 .tif

the original COGs stay where they are; all three point into them

kerchunk is a format for references, VirtualiZarr builds references as xarray objects, and Icechunk stores them (and real chunks) in versioned commits.

kerchunkVirtualiZarrIcechunk
What it isa reference file format and scannersa library that builds references with xarraya transactional Zarr v3 store
Holds real chunksnono (in-memory references)yes, beside virtual ones
Versionsnonosnapshots, branches, tags
Atomic updatesno—yes, one commit
Writes toJSON, Parquetkerchunk or Icechunkobject storage
Read withfsspec reference filesystem(writes for others to read)any Zarr v3 reader on the session’s store

A snapshot’s manifest in symbols

Concept

A snapshot is a manifest from keys to chunks

For snapshot σ\sigma, the manifest maps every chunk key either to a chunk the repo stores itself or to a reference into another file. A commit writes new manifests and metadata and then moves the branch to the new snapshot in one step, so readers see all of a change or none of it.

refσ(κ)∈{chunk in the repo,(url,o,ℓ)}\mathrm{ref}_\sigma(\kappa) \in \{ \text{chunk in the repo}, (\mathrm{url}, o, \ell) \}

Where

SymbolMeaningShapeUnit
σ\sigmaa snapshot id, immutable; branches and tags point at onestring—
refσ\mathrm{ref}_\sigmathe snapshot’s chunk manifestmap (chunk,)refs

How a raster is read in chunks through Icechunk

This is the step the Level 2 collections design takes for granted. Write the six June B12 COGs into a repo as virtual references, then read the site window through Zarr. Five steps, and only one of them is new.

1You slice the cubeisel(time=0, y=2000:2100, x=3050:3150)you

2Zarr turns the window into keysB12/c/3/5 · c/3/6 · c/4/5 · c/4/6zarr

3Icechunk looks each key up in snapshot σ\sigma’s manifestkey → (url, offset, length)icechunk

4The object store makes 4 ranged GETs on the original COG≈\approx 2 MB of compressed tilesobstore

5The codec decodes, the window is croppedarray (100, 100) of DNcodec

Every step except the third is what any Zarr read does. Icechunk’s only job on a read is to say, for snapshot σ, where each key’s bytes are.

# Shapes: N_scene = 6 scenes; per scene (y, x) = (5490, 5490) in 121 chunks; window 100 × 100
# Units:  [DN]; references in bytes
import icechunk
import xarray as xr

# --- write once: references, not pixels ---
# config names s3://bkt/ as a virtual chunk container
# not pinned (icechunk)
repo = icechunk.Repository.create(storage, config)
# not pinned (icechunk)
session = repo.writable_session("main")
# not pinned (virtualizarr)
june.vz.to_icechunk(session.store)                              # → 726 refs  refs
# not pinned (icechunk)
snapshot_id = session.commit("B12, June 2026, six scenes")     # → σ

# --- read any time later: Zarr keys → manifest → ranged GETs ---
# not pinned (icechunk)
reader = repo.readonly_session(snapshot_id=snapshot_id)
# not pinned (xarray)
cube = xr.open_zarr(reader.store, consolidated=False)["B12"]   # (time, y, x) lazy
# κ_ij → ref_σ(κ_ij) = (url_k, o_k, ℓ_k) → GET → decode
# not pinned (xarray)
site = cube.isel(time=0, y=slice(2000, 2100), x=slice(3050, 3150))  # lazy
# not pinned (xarray)
pixels = site.values                                            # → (100, 100)  [DN]

The read path as an operator, with the byte count

Use · xr.open_zarr(session.store)

Works at any level, one call per window. Zarr turns the window into chunk keys, Icechunk resolves each key to a byte range in the original COG, and the read returns the same pixels as the COG read.

κij=B12/c/i/j, (i,j)∈I×J\rEst{\kappa_{ij}} = \texttt{B12/c/}i\texttt{/}j, \ (i, j) \in \mathcal{I} \times \mathcal{J}
(urlk,ok,ℓk)=refσ(κij)(\rEst{\mathrm{url}_k}, \rEst{o_k}, \rEst{\ell_k}) = \rCon{\mathrm{ref}_\sigma}(\rEst{\kappa_{ij}})
xw=cropw(decode(GET(urlk,[ok,ok+ℓk))))\rOut{\vect{x}_{\vect{w}}} = \mathrm{crop}_{\vect{w}}(\mathrm{decode}(\mathrm{GET}(\rEst{\mathrm{url}_k}, [\rEst{o_k}, \rEst{o_k} + \rEst{\ell_k}))))

Zarr does eq. 1, Icechunk eq. 2, the object store and the codec eq. 3. Swappable: the snapshot σ\sigma, which pins exactly which files and bytes a read means.

GroupNameNoteShapeUnit
Inrepo@σ\rIn{\sigma}a read-only session on a branch, tag or snapshot id()—
w\rIn{\vect{w}} windowan isel on the opened array(4,)px
Parameters \gvect{\theta}nonea read has nothing to fit—
Constants · in the snapshotrefσ\rCon{\mathrm{ref}_\sigma} manifestkey → reference for every chunk; read once per session(chunk,)refs
array metadatashape, chunk shape PP, the COG’s codecs, written by VirtualiZarr——
Estimated in each callκij\rEst{\kappa_{ij}} keyseq. 1, by Zarr(chunk,)key
(urlk,ok,ℓk)\rEst{(\mathrm{url}_k, o_k, \ell_k)} referenceseq. 2, by Icechunk(chunk,)B
Outxw\rOut{\vect{x}_{\vect{w}}} windoweq. 3; the same pixels as the COG read(row, col)DN

Compatibility: who can read what

The formats in Part 1 are open standards with many readers. The tools in Part 2 are newer, and each needs its own client, so the choice is also a choice of who can open your data.

Is it a table: a catalog, points, polygons?yesGeoParquetone row per thing
no
One image on one grid, for GIS and web tools?yesCOGper-scene products
no
Many images on one grid, N-D, or appended over time?yesZarrreal chunks, can append
no
Files you don't own, too big to copy?yesvirtual referencesversioned in Icechunk

Ask the questions top to bottom and stop at the first yes. The answers are not exclusive: the Level 2 collections design keeps COGs where they are, catalogs them in GeoParquet, and reads them as Zarr through Icechunk.

Readers grouped by what they open. Two of them are already in your stack: geocloud.cog reads COGs with Development Seed’s async-geotiff (the [cog] extra), and geocatalog reads GeoParquet with DuckDB.

ReaderFromOpensGives youGDAL
GDAL, QGISOSGeoCOG, GeoParquet, Zarr (v3 in recent releases)rasters and layers in any GISis GDAL
rasterio, rioxarraycommunityCOG, and anything GDAL readsNumPy; xarray through engine="rasterio"yes
odc-stac, stackstaccommunityCOGs listed in STAC itemsa lazy xarray cube (time, band, y, x)yes, through rasterio
async-geotiffDevelopment SeedCOG and GeoTIFF windows and overviews, async, over obstoreNumPy arrays with transform and CRS; no reprojectionno (Rust async-tiff)
lazycogsDevelopment Seedmany COGs found through STAC, cached as stac-geoparqueta lazy (band, time, y, x) xarray DataArray on a target gridno (async-geotiff, obstore)
tifffileChristoph GohlkeTIFF and COG as a Zarr store (return_as="zarr"); writes fsspec reference JSONa Zarr array over the TIFF’s tilesno
virtual-tiffVirtualiZarr ecosystemTIFF and COG, as a VirtualiZarr parser (VirtualTIFF)virtual Zarr v3 references, committed to Icechunkno
xarray + zarr-pythoncommunityZarr v2 and v3 storeslazy Dataset / DataTreeno
kerchunk + fsspeccommunityreference JSON or Parqueta Zarr store over the original filesno
icechunkEarthmoverIcechunk repositories (Python and Rust clients)a Zarr v3 store for xarray at a snapshotno
DuckDB, geopandascommunityGeoParquettables, SQL, GeoDataFramesno
BrowsersvariousCOG (geotiff.js, tilers), Zarr (zarrita), GeoParquet (DuckDB-Wasm)maps and tables in a web pageno

Reader support moves fast; this table reflects the projects’ docs as of November 2026. Check the versions you pin.

So should you write Zarr, or keep TIFFs and COGs?

The numbers, path by path

Download the band60.28 MB
COG / Zarr / Icechunk window2.10 MB
Pixels you wanted0.02 MB
bytes fetched before compression, linear scale

All three chunked paths fetch the same four tiles. The gap between the middle and bottom bars is the price of a tile size much larger than the window.

PathWhat is readRequestsBytes, before compression
Download the bandthe whole file160 280 200
COG window (box 1)header, tiles 38, 39, 49, 501 + 42 097 152
GeoParquet query (box 2)footer, June row groups, three columnsa fewsmall, table-dependent
Zarr window (box 3)zarr.json, four chunks1 + 42 097 152
Icechunk virtual window (box 4)manifest, four ranges of the COG1 + 42 097 152
Pixels actually wanted100×100100 \times 100 of uint16—20 000

Where this goes next

Idea hereBecomes, in the design docs
GeoParquet row-group skippinggeocatalog’s working catalog today; the GeoParquet product-catalog adapter (product catalog, F)
A Zarr group per scenescenes/<id>/ in the repo, read by load_scenes (Level 2 collections, C)
VirtualiZarr referencesvirtual ingest of archives, no copy (Level 2 collections, E)
Snapshots and commitsmeta/ rows committed with their data, IcechunkGeoCatalog (Level 2 collections, A, B)
A table stored as columnsthe meta/ group: catalog columns as aligned 1-D Zarr arrays (Level 2 collections, A)