Level 2 collections in GeoStack
The CNG Forum 2026 talk by Tom Nicholas (Earthmover) and Sean Harkins (Development Seed) keeps a STAC-like catalog inside the same Zarr store as the scenes it indexes, so Icechunk can commit data and metadata together. This page checks what GeoStack already does against the code, then shows the smallest change that brings that idea in.
Summary
The carriers and lanes stay as they are. geocatalog already holds a table catalog, and geoarray and xrops already speak DataTree. The change is in where the catalog table lives and how products get written into it.
- A.An Icechunk catalog backend. Today the table is a GeoParquet file sitting beside the files it points at. A third
GeoCatalogbackend keeps the table as columns in ameta/group inside the repo, at a pinned snapshot. - B.A write half for the protocol.
GeoCatalogis read-only, and registering a product is a second step after writing it. A transaction writes the product group and its row, then commits both or neither. - C.A scene-per-node raster loader.
load_rasteralways mosaics onto the query grid.load_scenesreturns oneDataTreenode per scene, each on its own grid, through the existingto_datatree. - D.One Zarr georeferencing convention.
WriteZarrwritescrsandtransformattributes, whileto_xarraywrites a CFspatial_ref. Products in a shared repo should use one. - E.Virtual ingest of archives. Rows now name whole files. VirtualiZarr references would make a scene a group of virtual chunks, read like any Zarr array, with no copy.
- F.A product catalog. Where products are recorded for others to find, in which database, and how pgstac fits: its own design doc, GeoStack product catalog.
End state. geocatalog owns the catalog on any of three backends and the write path; geoarray keeps its carriers and converters; geoops, xrops and pipekit do not change; the repo holds scenes, products and their index, versioned together, and is the truth that the product catalog is built from.
How a scene moves through the stack today
Two layers. The top one is the work you do: find, load, compute, write. The bottom one is what persists between tasks: the catalogs you search and the storage you read and write. Every arrow between the layers is a separate I/O call, and nothing ties one call to another.
The components, and where each one lives
| Component | Repo | What it does | Read in |
|---|---|---|---|
geocatalog.sources | geotoolz-catalog | Discovers items from STAC, CMR, earthaccess and GEE. These feed a catalog; they are not the catalog. | geocatalog/__init__.py |
geocatalog.build | geotoolz-catalog | build_raster_catalog and its xarray, vector and state siblings index files into rows; append_files adds files to an existing GeoParquet catalog. | geocatalog/build/__init__.py |
GeoCatalog | geotoolz-catalog | The protocol: query, intersect, union, iter_rows, iter_slices, extents. A query returns a new catalog; there is no append or commit. | _src/base.py:204 |
CatalogRow | geotoolz-catalog | One row: filepath, footprint, time interval, CRS and extras (state rows add run, member and producer). | _src/base.py:88 |
InMemoryGeoCatalog, DuckDBGeoCatalog | geotoolz-catalog | The two backends. open_catalog picks DuckDB when the extra is installed, else memory. | _src/factory.py |
geocatalog.storage | geotoolz-catalog | GeoParquet in and out, STAC export, CatalogBundle, StreamingParquetWriter. | geocatalog/storage/__init__.py |
load_raster | geotoolz-catalog | Reads every overlapping row and mosaics it onto the slice grid: the result's grid equals slice_.grid. | _src/formats/raster.py:494 |
load_xarray, load_states | geotoolz-catalog | Cubes from many files. load_states(group_by=…) already returns a DataTree, one leaf per grid. | _src/formats/states.py:424 |
geoarray | geotoolz-array | GeoArray, GeoSwath, GeoPoints, RasterSource, and the converters to_xarray, to_dataset and to_datatree with their inverses (LL-F3: one node per grid). | geoarray/_src/xarray.py:695 |
geocloud | geotoolz-cloud | The obstore client pool, sync and async COG reads (CogSource, AsyncCogReader), write_cog, a local cache. | geocloud/cog.py |
geoops | geotoolz-ops | Per-item operators on carriers, including matched_filter and the io sinks such as WriteZarr. | geoops/io/_src/operators.py:1181 |
xrops.Operator | xrtoolz-ops | Maps any operator over every DataTree node with xr.map_over_datasets; lift(op, dim) runs a geoops operator per item of a cube. | xrops/_src/operator.py:1 |
pipekit-ops, pipekit-array | pipekit | The Operator base every geoops and xrops operator subclasses; DimArray, KernelOp and the dim-level functions. | packages/pipekit-array |
Five verified gaps
- 1
The table and the data are separate artifacts.
catalog.parquetand the scene files are written by different calls. A crash between them leaves a file with no row, or a row with no file, and nothing records which version of the table matched which files. - 2
Rows point at whole files.
CatalogRow.filepathnames a COG or NetCDF file, so each read opens a file through rasterio or obstore. A row cannot point at a group of chunks. - 3
No raster loader keeps scenes apart.
load_rasteralways mosaics onto the query grid. Keeping each row on its own grid exists only for model states, throughload_states(group_by=). - 4
Two Zarr georeferencing conventions.
WriteZarrstorescrsas a string andtransformas six numbers in group attributes;geoarray.to_xarraywrites a CFspatial_refwithcrs_wktandGeoTransform. A reader of a shared repo would need both. - 5
The protocol has no write half.
GeoCatalogreads and combines catalogs; writing happens inbuildandstoragefunctions outside it, so no backend can make a write atomic.
One doc lag found on the way: labeled_lane.md still lists LL-F3 as open, while to_datatree ships in geoarray 0.4.1.
The same flow with the catalog inside the repo
Every box and every line of text from the current diagram is still here, in the same place. Blue text marks what each box gains, with the letter of the workstream that adds it. Compute is faded because it does not change. One box in the persist layer is new: Icechunk repos, beside object storage, which stays.
What each workstream adds
| Symbol | Destination | Reason | Closes |
|---|---|---|---|
IcechunkGeoCatalog | geocatalog.backends, extra [icechunk] | A third backend with the same protocol; its table lives in meta/ at one snapshot. | A · gaps 1, 2 |
GeoCatalogWriter, CatalogTransaction | geocatalog root | The write half of the protocol. DuckDB implements append by wrapping append_files; Icechunk implements both. | B · gaps 1, 5 |
load_scenes | geocatalog.load | One node per row on its own grid, built with geoarray.to_datatree. Works on all three backends. | C · gap 3 |
WriteZarr attributes | geoops.io | Write the CF spatial_ref that geoarray.to_xarray writes, so one reader opens every product. | D · gap 4 |
ingest_virtual | geocatalog.build, extra [virtual] | VirtualiZarr references for COG and NetCDF/HDF5 scenes, written as scenes/<id>/ plus a meta/ row. | E · gap 2 |
The product catalog: ProductCatalog, publish, the record and pgstac sync, in GeoStack product catalog. | F, K, L | ||
Under the hood
The sketches follow the code-sketch standard. Each opens with a shapes header; a status marker sits on its own line above every call into the stack; a unicode equation sits above every mathematical line; bare assignments end with their shape in one column.
today (pkg)ships at the pinned commit, name and arguments checked in the repo
today* (pkg)ships, but some arguments are sketched
proposed (X)not shipped; X is the workstream that adds it
usera function the reader writes, not a stack name
The today names were checked against the pinned commits. The blocks were not run: they need a catalog of real scenes, which this session does not have.
Repository layout
One repository per collection. Every array in meta/ has shape (R,) for R rows and shares one chunking, so a chunk index acts like a Parquet row group.
s2-l2a-site.icechunk/ ├── meta/ # the catalog table, R rows │ ├── id # str │ ├── start_time # datetime64[ms] │ ├── end_time # datetime64[ms] │ ├── geometry # bytes, WKB in EPSG:4326 │ ├── crs # str, the scene's native CRS │ ├── key # str, the group path, e.g. scenes/S2A_20260601_T30SYJ │ └── cloud_cover # float32, any extra column ├── indexes/geometry # optional R-tree over meta/geometry ├── scenes/<id>/ # bands (C, H, W) + CF spatial_ref; virtual or real chunks ├── products/<algo>/<id>/ # outputs, same convention, each with a meta/ row └── cubes/<name>/ # aligned L3/L4 Datasets
How meta/ maps onto CatalogRow
| meta/ column | Zarr dtype | CatalogRow field |
|---|---|---|
key | variable-length str | filepath = "icechunk://<repo>@<snapshot>/<key>" |
geometry | variable-length bytes (WKB) | geometry, decoded with shapely |
start_time, end_time | datetime64[ms] | interval, closed on both ends |
crs | variable-length str | crs |
| everything else | any fixed or string dtype | extras |
The backend
The catalog is host-side and never traced, so it is a frozen dataclass rather than an Equinox module. A query keeps a row when its footprint meets the slice bounds B and its interval [t₀, t₁] meets the slice interval T.
# geocatalog/_src/backends/icechunk.py
"""A GeoCatalog whose table is the meta/ group of an Icechunk repository."""
import dataclasses
from collections.abc import Iterator
from typing import Any
import icechunk
import numpy as np
import pandas as pd
from jaxtyping import Bool
from geocatalog._src.base import CatalogRow
from geocatalog._src.geoslice import GeoSlice
# Shapes: R rows in meta/; K ≤ R rows kept by queries
@dataclasses.dataclass(frozen=True)
class IcechunkGeoCatalog:
"""Catalog rows read from meta/ at one snapshot.
Args:
repo: The repository holding meta/, the scenes and the products.
uri: Where the repository lives, used to build each row's filepath.
snapshot: The snapshot every read of this catalog names.
keep: Rows kept by earlier queries; None keeps all R rows.
"""
repo: icechunk.Repository
uri: str
snapshot: str
keep: Bool[np.ndarray, "row"] | None = None
def query(
self,
slice_: GeoSlice | None = None,
*,
bounds: tuple[float, float, float, float] | None = None,
crs: Any | None = None,
time: tuple[Any, Any] | pd.Interval | None = None,
) -> "IcechunkGeoCatalog":
# proposed (A)
meta_table = read_meta(self.repo, self.snapshot) # → (R,) table
# keep ⇔ footprint ∩ B ≠ ∅ ∧ [t₀, t₁] ∩ T ≠ ∅
# proposed (A)
overlaps = filter_rows(meta_table, slice_, bounds, crs, time) # (R,) → (R,)
# keep ← keep ∧ overlaps
kept = overlaps if self.keep is None else self.keep & overlaps # (R,) → (R,)
return dataclasses.replace(self, keep=kept)
def iter_rows(self, *, batch_size: int = 1024) -> Iterator[CatalogRow]:
# proposed (A)
records = kept_records(self, batch_size=batch_size) # → (K,)
for record in records:
filepath = f"icechunk://{self.uri}@{self.snapshot}/{record.key}"
# today (geocatalog)
yield CatalogRow(
filepath=filepath,
geometry=record.geometry,
interval=record.interval,
crs=record.crs,
extras=record.extras,
)
The write half
Two protocols, kept small. DuckDB satisfies the first by wrapping append_files; only Icechunk satisfies the second.
# geocatalog/_src/base.py
"""The write half of the catalog protocol."""
from collections.abc import Mapping, Sequence
from typing import Any, Protocol
from geoarray import GeoArray
class GeoCatalogWriter(Protocol):
"""A catalog that can take new rows."""
def append(self, rows: Sequence[CatalogRow]) -> None: ...
class CatalogTransaction(Protocol):
"""Writes carriers and their rows, visible only after commit.
Raises:
CatalogTransactionError: If the commit conflicts with another writer.
"""
def put(
self,
key: str,
carrier: GeoArray["band y x"],
row: Mapping[str, Any],
) -> CatalogRow: ...
def commit(self, message: str) -> str: ...
# proposed (B)
class CatalogTransactionError(GeoCatalogError, RuntimeError):
"""A commit lost a race with another writer on the same branch."""
The scene loader
# geocatalog/_src/formats/raster.py
import geoarray
import xarray as xr
from geoarray import GeoArray
from geocatalog._src.base import GeoCatalog
from geocatalog._src.geoslice import GeoSlice
# Shapes: K rows kept; per scene C bands on its own H × W grid
def load_scenes(
catalog: GeoCatalog,
slice_: GeoSlice,
*,
group_by: str = "id",
) -> xr.DataTree:
"""One DataTree node per row, each on the row's own grid.
Algorithm:
1. Open each kept row as a RasterSource: a file or an icechunk:// group.
2. Read the slice's bounds on the row's native grid, with no reprojection.
3. Put each carrier on its own node with geoarray.to_datatree.
Args:
catalog: The rows to load, usually the result of a query.
slice_: The bounds to read from each scene.
group_by: The row column whose value names each node.
"""
scenes: dict[str, GeoArray] = {}
# today (geocatalog)
for row in catalog.iter_rows(): # (K,)
# proposed (C)
source = open_source(row.filepath) # → RasterSource
# proposed (C)
scene = read_bounds(source, slice_) # → (C, H, W)
scenes[row.extras[group_by]] = scene
# today (geoarray)
tree = geoarray.to_datatree(scenes) # K → K nodes
return tree
In action: matched filter over a month of scenes
The task: run the matched filter on every Sentinel-2 scene over a site in June 2026, keep the outputs, and make them findable. For each pixel, y ∈ ℝᶜ is its spectrum over C bands, μ ∈ ℝᶜ the background mean, Σ ∈ ℝᶜˣᶜ the background covariance, t ∈ ℝᶜ the methane target signature, and α̂ the enhancement. With fit_on_call=True, geoops fits μ and Σ on each scene. site_june is a GeoSlice over the site for June, and extract_row is the reader's own function that turns a file into a row.
from pathlib import Path
import geocatalog
import geocloud.cog
import geoops.matched_filter
# Shapes: R rows in the catalog; S scenes kept; C bands; H × W pixels per scene
# today (geocatalog)
catalog = geocatalog.open_catalog("s3://bkt/s2_site.parquet") # → R rows
# today (geocatalog)
june = catalog.query(site_june) # R → S rows
# today (geoops)
matched_filter = geoops.matched_filter.MatchedFilter(
target=methane_target,
fit_on_call=True,
)
product_paths: list[str] = []
# today (geocatalog)
for row in june.iter_rows(): # (S,)
# today (geocloud)
source = geocloud.cog.CogSource.open(row.filepath)
# today (geocloud)
scene = source.load() # → (C, H, W)
# α̂ = tᵀ Σ⁻¹ (y − μ) / (tᵀ Σ⁻¹ t)
# today (geoops)
enhancement = matched_filter(scene) # → (1, H, W)
scene_id = Path(row.filepath).stem
product_path = f"s3://bkt/products/mf/{scene_id}.tif"
# today (geocloud)
geocloud.cog.write_cog(enhancement, product_path)
product_paths.append(product_path)
# second write: a crash before this line leaves COGs that no row points at
# today* (geocatalog)
geocatalog.build.append_files(
"s3://bkt/mf_catalog/",
product_paths,
extract_row,
crs="EPSG:4326",
kind="raster",
partition_by=[],
)
import geoarray
import geocatalog
import geoops.matched_filter
# Shapes: R rows in meta/; S scenes kept; C bands; H × W pixels per scene
# proposed (A)
catalog = geocatalog.open_catalog("icechunk://s3://bkt/s2_site") # → R rows
# proposed (A)
june = catalog.query(site_june) # R → S rows
# proposed (C)
scene_tree = geocatalog.load.load_scenes(june, site_june) # → S nodes
# today (geoarray)
scenes_by_node = geoarray.from_datatree(scene_tree) # S nodes → S
# today (geoops)
matched_filter = geoops.matched_filter.MatchedFilter(
target=methane_target,
fit_on_call=True,
)
# proposed (B)
with catalog.transaction(branch="mf-v0.3") as transaction:
for node_path, carriers in scenes_by_node.items(): # (S,)
scene_id = node_path.strip("/")
scene = carriers[scene_id] # (C, H, W)
# α̂ = tᵀ Σ⁻¹ (y − μ) / (tᵀ Σ⁻¹ t)
# today (geoops)
enhancement = matched_filter(scene) # → (1, H, W)
# the row also takes a recipe stamp (G, pipekit Recipe Registries)
# proposed (B)
transaction.put( # → 1 row
f"products/mf/{scene_id}",
enhancement,
row={"algo": "mf", "parent": node_path},
)
# proposed (B)
snapshot_id = transaction.commit("MF v0.3 on the site, June 2026")
# proposed (B)
catalog.tag("mf-v0.3-2026-06", snapshot_id)
# next: publish the tag to the product catalog (F, product catalog doc)
The diff
Only the lines that change, current code first. The matched filter call does not change.
# Today:
# today (geocatalog)
catalog = geocatalog.open_catalog("s3://bkt/s2_site.parquet") # → R rows
# today (geocloud)
geocloud.cog.write_cog(enhancement, product_path)
# today* (geocatalog)
geocatalog.build.append_files(archive, product_paths, extract_row, ...)
# After:
# proposed (A)
catalog = geocatalog.open_catalog("icechunk://s3://bkt/s2_site") # → R rows
# proposed (B)
transaction.put(f"products/mf/{scene_id}", enhancement, row=row) # → 1 row
# proposed (B)
snapshot_id = transaction.commit(message)
What the difference is
| Concern | Today | Target |
|---|---|---|
| Where the index lives | A GeoParquet file beside the data | meta/ inside the repo |
| Registering a product | write_cog, then append_files: two steps | put, then one commit |
| A crash halfway | Files with no rows, or rows with no files | Nothing visible; the branch is unchanged |
| Pinning a training set | Copy the Parquet file and hope the files stay | Keep the snapshot id |
| Reading a scene | Open a file per row (rasterio, obstore) | Read Zarr chunks, real or virtual |
| Many scenes in xarray | Mosaic onto one grid, or load_states for states only | load_scenes → DataTree for any raster rows |
| A new algorithm version | A new folder by convention | A branch; merge it or drop it |
| Carriers, geoops, xrops, pipekit | Unchanged. | |
Testing gates
Each workstream merges only when its gate passes.
| Gate | Workstream | Passes when |
|---|---|---|
| A1 Query parity | A | On the same rows, IcechunkGeoCatalog.query and DuckDBGeoCatalog.query return identical ids for 100 random GeoSlices, including slices in another CRS. |
| B1 Atomicity | B | A transaction that raises before commit leaves main at the same snapshot id, with no new group and no new row. |
| B2 Reproducibility | B | After 10 later commits, opening the first snapshot returns the same rows and bit-identical arrays. |
| C1 Scene parity | C | Each load_scenes node equals the direct CogSource read of its file bit for bit, and from_datatree returns a Grid equal to the source's. |
| D1 One convention | D | WriteZarr output opens through geoarray.from_xarray with the transform equal to 1e-9 and an equal CRS. |
| E1 Virtual parity | E | A virtual scene group reads bit-identical to its source COG or NetCDF on every band. |
Sequencing and risks
Products first, because that is where the two-step write hurts today and where the scale is small. Source collections and virtual ingest follow once the backend has proven itself.
D one Zarr convention B write half (DuckDB append) │ │ ◆ D1 ◆ B1 └──────────────┬───────────────┘ │ A IcechunkGeoCatalog ┃ C load_scenes (parallel) │ ◆ A1 · B2 · C1 │ E virtual ingest of source scenes │ ◆ E1
- !
Node count at mission scale. A year of HLS came to about 318 M nodes, and Icechunk's commit memory grows with the total node count (icechunk#2449). Fallback: one repo per collection and year, or keep GeoParquet as the index for source scenes and use Icechunk for products only.
- !
The query engine is a prototype. zarr-datafusion-search is early. Fallback: read
meta/into Arrow and filter with DuckDB, which geocatalog already depends on. - !
Some formats do not virtualize well. Sentinel-2 JP2 tiles and EMIT's GLT geolocation are poor fits. Fallback: write those scenes as real Zarr chunks.
- !
Two indexes drift during migration. Fallback: the GeoParquet export of an Icechunk catalog is derived on demand and never edited by hand.
Sources
- Level 2 Data Collections in Zarr, CNG Forum 2026 (abstract; the slides need a browser)
- zarr-datafusion-search and its Zarr structure page
- icechunk#2449: commit memory grows with node count
- STAC Zarr convention
- GeoStack code at the commits pinned above; geostack
docs/design/labeled_lane.mdandpackage_layout.md - GeoStack product catalog and pipekit recipe registries, the companion pages