What does every geoscience pipeline do, in order?
GeoStack · background · question → product → question
Abstract¶
Pictures first. Whatever the science, the job has the same outline: find the scenes, read only what you need, cut it into pieces, compute, stitch, and keep the result so that someone can find it again. This page names ten stages for that outline, says what each hands to the next, and runs all ten on one small example. It starts from the eight-stage diagram in geotoolz and adds the two stages that versioned storage and a product catalog bring.
The running example¶
Ten stages, three acts¶
Find no pixel is decoded
1 Search a question file names an archive’s index STAC · CMR · a folder 24 files
2 Catalog file names rows; a request hits headers only geocatalog 24 rows 6
3 Save hits hits near the compute bytes, undecoded geocatalog · geocloud 6 files,
Compute split apply combine, on a lazy field
4 Stream hits one lazy field pixels, on demand geocatalog · geopatcher
5 Split field patches pixels geopatcher
6 Apply patch patch pixels geoops
7 Combine patches one array pixels geopatcher
Keep a file, a version, a record
8 Write array file or store a product geoops.io · geocloud 1 COG,
9 Commit store snapshot id a version new Icechunk 1 snapshot
10 Publish snapshot + recipe record a row new product catalog 1 row
The eight stages of the geotoolz diagram, with two added at the end. Each row says what goes in and what comes out, what the stage actually touches, which package owns it, and the running example’s numbers.
The shape every pipeline has: many candidates narrow to a few, the few become one field, the field fans out into patches and folds back into one result, and the result is kept three ways.
Act 1 · Find: from a question to a few files¶
Search asks an archive what it has. Catalog turns the answer into a table of footprints, times and paths, so the next question is a query on that table and not another crawl. Save brings only the matching files close to where the computing runs. The request itself is an object, a GeoSlice: bounds × time × resolution × CRS.
# Shapes: T = 2 bands; H × W = 400 × 500 px (the site); h × w = 128 × 128 px
# --- search ---
# the archive: here a folder; in production a STAC, CMR or GEE search
files = sorted(glob.glob(str(ARCHIVE / "*.tif"))) # → 24 paths
# --- catalog ---
# today (geocatalog)
# index once: footprint, CRS, resolution and time per file; no pixels read
catalog = build_raster_catalog( # 24 paths → 24 rows
files, filename_regex=r"_(?P<date>\d{8})", date_format="%Y%m%d"
)
# today (geocatalog)
# the request: bounds × time × resolution × CRS
site = gc.GeoSlice(
bounds=(723000.0, 4375000.0, 728000.0, 4379000.0),
interval=pd.Interval(
pd.Timestamp("2026-06-01"), pd.Timestamp("2026-06-30"), closed="both"
),
resolution=(PIXEL_M, PIXEL_M),
crs=CRS,
)
# today (geocatalog)
hits = catalog.query(site) # 24 rows → 6 rows
# --- save ---
# today (geocatalog)
# fetch only the hits next to the compute; local files stay where they are
staged = gc.staging.stage(hits, dest=str(WORK / "cache")) # 6 rows → 6 rowsAct 2 · Compute: split, apply, combine¶
The field Split Apply Combine
patch
patch
patch
overlapping windows, read on demand weights fade each patch out towards its edges
xarray’s split → apply → combine, on space. Measured on the running example: 20 patches of 128 px with 32 px of overlap give the same NDVI as computing the whole site at once, to 2e-16.
Stream presents the saved files as one field: an array on the request’s grid that reads pixels only when a window is asked for. Split cuts the field into overlapping patches. Apply runs one operator on each patch. Combine merges the results, weighting each patch so that the seams disappear.
# --- stream ---
# today (geocatalog)
# a Field: the six files as one lazy mosaic on the site's grid
field = gc.patch.field_for(staged, site) # 6 rows → (T, H, W)
# --- split ---
# today (geopatcher)
patcher = gp.SpatialPatcher(
geometry=gp.spatial.geometry.Rectangular(size=(128, 128), boundary="pad"),
sampler=gp.spatial.sampler.RegularStride(step=(96, 96)),
window=gp.spatial.window.Hann(),
aggregation=gp.spatial.aggregation.OverlapAdd(),
)
# today (geoops)
patches = GridSampler(patcher=patcher)(field) # (T, H, W) → 20 × (T, h, w)
# --- apply ---
# today (geoops)
# NDVI = (ρ_nir − ρ_red) / (ρ_nir + ρ_red)
ndvi = gz.DNToReflectance(scale=1e-4) | gz.NDVI(red=0, nir=1)
# today (geoops)
results = ApplyToChips(operator=ndvi)(patches) # 20 × (T, h, w) → 20 × (h, w)
# --- combine ---
# today (geoops)
# window-weighted merge of the overlaps, back on the site's grid
merge = MergePatches(
aggregation=gp.spatial.aggregation.OverlapAdd(), domain=field.domain
)
product = merge(results) # 20 × (h, w) → (H, W)Why the merge has no seams (overlap-add)
Let patch give a result at pixel , with a window weight that is largest at the patch’s centre and falls towards its edge (zero where the patch does not cover ). The merged value is the weighted mean over the patches that cover the pixel:
For an operator that acts pixel by pixel, such as NDVI, every patch gives the same value at a shared pixel, so exactly; the measured difference is 2.2e-16. For an operator that looks at a neighbourhood (a convolution, a neural network), values near a patch edge are less reliable, and the weights are what keep them from showing.
Act 3 · Keep: a file, a version, a record¶
Write puts the result somewhere with its georeference intact. That is where the original eight stages end, and where two problems begin: a half-written result looks like a result, and nobody else knows it exists. Commit makes the write a version that appears all at once and can be named for ever. Publish adds one row to a product catalog saying what the product is, where it is, which version, and what made it.
# --- write ---
# today (geoops)
gz.WriteCOG(path=str(WORK / "ndvi_june.tif"))(product) # (H, W) → 1 file
# --- commit ---
# today (icechunk)
# the same product into a versioned store: visible all at once, or not at all
repo = icechunk.Repository.create(
icechunk.local_filesystem_storage(str(WORK / "products.icechunk"))
)
session = repo.writable_session("main")
values = np.asarray(product) # (H, W)
array = zarr.create_array(
session.store, name="ndvi", shape=values.shape, chunks=(256, 256), dtype="f4"
)
array[:] = values
array.attrs["transform"] = [float(v) for v in product.transform]
array.attrs["crs"] = "EPSG:32630"
snapshot_id = session.commit("NDVI, site, June 2026") # → snapshot id
# --- publish ---
# today (pipekit)
# h = SHA-256(stable_json(state) ‖ 0x00 ‖ weights): the recipe's id
recipe_hash = pipekit_ops.pipeline_hash(ndvi, b"")
# one row in the product table: what, where, when, from what, by what
record = {
"id": "ndvi_site_2026-06",
"start_time": "2026-06-01",
"end_time": "2026-06-30",
"bbox": list(site.bounds),
"crs": "EPSG:32630",
"href": "products.icechunk",
"snapshot_id": snapshot_id,
"recipe_hash": recipe_hash,
"sources": [pathlib.Path(path).name for path in hits.gdf["filepath"]],
}
pq.write_table(pa.Table.from_pylist([record]), WORK / "products.parquet")
# --- loop ---
# the next pipeline's search is a query on the product table
found = pq.read_table(WORK / "products.parquet").to_pylist()[0]
reopened = repo.readonly_session(snapshot_id=found["snapshot_id"])
again = zarr.open_array(reopened.store, path="ndvi")[:] # → (H, W)The record is the whole of what the next user needs:
{
"id": "ndvi_site_2026-06",
"start_time": "2026-06-01",
"end_time": "2026-06-30",
"bbox": [
723000.0,
4375000.0,
728000.0,
4379000.0
],
"crs": "EPSG:32630",
"href": "products.icechunk",
"snapshot_id": "VA8A4RKN3DPMS833N72G",
"recipe_hash": "4b8c154a8762594f\u2026",
"sources": [
"S2_A_20260605.tif",
"S2_A_20260612.tif",
"S2_A_20260621.tif",
"S2_B_20260605.tif",
"S2_B_20260612.tif",
"S2_B_20260621.tif"
]
}The loop¶
Publish feeds the next search
L2 reflectance scenes
search publish
the same ten stages
NDVI, June, per site
L3
NDVI, per month
search publish
the same ten stages
anomaly vs 5-year mean
L4
anomalies, per site
search publish
the same ten stages
drought alerts
indicator
Each lap searches what the lap before published, and raises the processing level.
Without publish, the chain ends in a file somebody has to know about. With it, the product catalog is an archive like any other, and a pipeline’s output is the next pipeline’s input.
What crosses each seam¶
| Between | What is handed over | In the running example |
|---|---|---|
| search → catalog | file names or URIs | 24 paths |
| catalog → save | a GeoCatalog: rows of footprint, time, path | 6 rows |
| save → stream | the same catalog, pointing at nearby copies | 6 rows |
| stream → split | a RasterField: a lazy array with a grid | (2, 400, 500) uint16 |
| split → apply → combine | a list of Patch, each a small GeoArray with its place | 20 patches |
| combine → write | one GeoArray on the request’s grid | (400, 500) float64 |
| write → commit | a store with uncommitted changes | 1 array, 4 chunks |
| commit → publish | a snapshot id | VA8A4RKN3DPMS833N72G |
| publish → the next search | a record: id, footprint, time, where, snapshot, recipe | 1 row |
Because each seam is an object with a known shape, a stage can be replaced without touching its neighbours: a different archive behind search, a different operator in apply, a different store behind write.
The pipeline and the role ladder¶
How this page meets the role ladder. The ladder describes what is inside a library; the pipeline describes what a job does from start to finish. They meet at rung ⑤: every stage is a step, and the science sits under one of them.
What Icechunk and the product catalog change¶
The two new stages are the visible part. The same two ideas also change four of the original eight. Rows marked proposed are the workstreams of the storage design pages.
| Stage | Today | With Icechunk and a product catalog | Status |
|---|---|---|---|
| Catalog | rows in a GeoParquet file beside the data | rows stored in the repository with the chunks; a snapshot id pins both | proposed · geotoolz#664 |
| Save | download the hits | record references to the original COGs; copy nothing | proposed · geotoolz#668 |
| Stream | one mosaic on the request’s grid | also: one tree node per scene, each on its own grid | proposed · geotoolz#666 |
| Write | a COG or a Zarr store | the same, with standard CRS metadata in Zarr | proposed · geotoolz#667 |
| Commit | — | append in one transaction; the snapshot id is the version | runs here with Icechunk directly; API proposed · geotoolz#665 |
| Publish | — | one record to a product catalog (GeoParquet, PostGIS, pgstac or a STAC API) | runs here as a Parquet row; API proposed · geotoolz#671 |
| Stamp (rides along) | the recipe’s hash can be computed | written onto every product with the snapshot it read | proposed · pipekit#235 |
Where the time went¶
| Stage | Time | What it did here |
|---|---|---|
| search | 0.3 ms | listed a folder |
| catalog | 55.6 ms | read 24 headers, answered one request |
| save | 7.5 ms | nothing to copy: the files are local |
| stream | 91.7 ms | opened six files as one mosaic |
| split | 3.7 ms | cut 20 windows |
| apply | 10.9 ms | NDVI on 20 patches |
| combine | 3.9 ms | weighted merge |
| write | 41.1 ms | one COG with overviews |
| commit | 21.4 ms | one Icechunk commit |
| publish | 14.7 ms | one Parquet row |
These are local-disk timings on a tiny archive and say little about a real run, where search, save and stream wait on the network and dominate. They are here to show that every stage ran, and that the two new ones are cheap.
Where this goes next¶
| Stage | Background page | Design page |
|---|---|---|
| Search, catalog | Databases and catalogs | Level 2 collections |
| Save, stream | Object storage, storage formats | Level 2 collections |
| Split, apply, combine | Parallelism, the role ladder | Kinds and roles |
| Write, commit | Versions and identity | Level 2 collections |
| Publish, stamp | Databases and catalogs, versions and identity | Product catalog, recipe registries |
Sources and status
Source: the “search · catalog · save · stream · split · apply · combine · write” diagram and README of geotoolz at 640670c, extended here with commit and publish. The code is one file of 253 lines, run as shown with geotoolz at 640670c, pipekit at 9e86a56, icechunk 2.3.1 and zarr 3.4.2 on a synthetic archive. Search is a folder listing and save copies nothing because the archive is local; commit and publish use Icechunk and pyarrow directly and are stand-ins for APIs that are proposed, not shipped. The processing-level labels in the loop figure are illustrative. Every number and listing on the page comes from notebooks/background/geo_pipeline.py; its recorded output is docs/images/background_geo_pipeline/ (results.json).