From Days to Minutes: A Just-in-Time Pipeline for Plot-Level Supply-Chain Analytics

Jake Wilkins

Mapping & quantifying the first mile

Supply chains remain obscure

Brand Manufacturer Trader Mill Farm

TRACE: from the brand down to the facility

Tier 1Manufacturers Tier 2Traders & refiners Tier 3, 4, 5 …up to 6–7 tiers deep Tier NMills & facilities CPG brand Aggregated from web sources media proprietary sources

Addresses in, plot-level risk out

Customer facility points across Sumatra1
Locations & addressesCustomer-supplied points
Satellite view of a palm oil mill
AlphaEarth embedding around the millAlphaEarth
2
Geocode & verifyReal location, real commodity area
Probabilistic supply shed around a mill3
Supply shedsDrive-time sourcing regions, one per mill
Delineated commodity plots4
Commodity plotsDelineated growing areas
Environmental metric raster over a concession5
Environmental metricsDeforestation · emissions · biodiversity · water

Ninety minutes by road from the mill

Strait of Malacca Indian Ocean SUMATRA Binabaru mill, Riau 0 min 10 min 20 min 30 min 40 min 50 min 60 min 70 min 80 min 90 min Supply shed · 90 min · 6,560 km² input layers (schematic) Roads Overture Slope Copernicus DEM Land cover ESA WorldCover Water JRC surface water Friction seconds per metre pale = fast · dark = slow

One global array, filled as we go

Strait of Malacca Indian Ocean SUMATRA new supply shed 3 present6 missing 1Earlier sheds already stored some chunks 2Which of its chunks exist already? 3Fill only the missing ones 4Write data and metaarray in one commit data written metaarray processed one commit data written processed, no data not processed missing

Computed on demand, per supply shed

Prefect jobs · Kubernetes Customersupply shed export toicechunk zonalstats normalise toPostgres Served tocustomer Icechunk BigQuery Postgres GEE

Earth Engine: 500 requests, 4 facilities

Prefect jobs · Kubernetes Customersupply shed export to icechunk zonal stats normalise to Postgres Served tocustomer Icechunk BigQuery Postgres GEE
4 at a timewaiting… EarthEngine HVE500 concurrent requests … … … …
  • unexplained costs
  • unstable costs
  • no visibility into processing
  • not enough throughput

The solution: VirtualiZarr

Animation: what is Zarr, a data cube split into chunks
Prefect jobs · Kubernetes Customersupply shed export toicechunk zonalstats normalise toPostgres Served tocustomer Icechunk BigQuery Postgres GEE virtual icechunkrefs in GCS before after references live with us;bytes stay with the provider

TIFFs, though

32N33N34N
UTM zones
every zone its own CRS
ForTy
10°
Ragged 10° tiles
last block row and column short
JRC TMFGFC
tile.tifv1v2v3refstale ref
Overwritten in place
alerts: same path, new bytes daily
GLAD-LGLAD-S2

Ragged tiles ≠ one array

regular(5, 5)5555 rectilinear[[6,4], [3,3,3,1]]333164 Grids adapted from Earthmover’s blog on variable-length chunks two 10° tiles, stitched: chunk sizes along x442442irregular chunk mid-array

VirtualiZarr issue 1078, Dangling pixel concatenation (variable-length chunks), opened by jakenotjay, with Tom Nicholas's comment that it is blocked in practice by issue 1111

#1111 Concatenate arrays with padded final chunks

Three families

AStatic global manifest
one stitched manifestopen as one arraycrop + reproject
HansenJRC GFC
BTiled static manifests
discover tilesopen persistedmanifestsmosaic + reproject
JRC TMF
CDynamic virtual stores
STAC / listing querybuild byte-rangerefs on the flymosaic + reproject
GLADOPERA DISTForTy
reprojected onto the target geobox

One protocol: open(geobox, dates) → xarray

class VirtualDatasetSource(Protocol):
    async def open(
        self,
        *,
        target_geobox: GeoBox,
        start_date: datetime | None = None,
        end_date: datetime | None = None,
    ) -> xr.Dataset:
        """Raw bands, lazily reprojected
        onto target_geobox."""
implemented by every source HansenJRC GFCJRC TMFGLADOPERA DISTForTy
GeoBoxtarget_geobox
Dimensions11,776 × 12,800
EPSG4326
Resolution0.0000836°
Cell512 px

23 × 25 chunks of one global grid
4,305,610 × 1,674,406

palm supply shed, Riau 372 chunks

A skill, not a script

.claude/skills/virtual-icechunk/
SKILL.md117classify, lifecycle, rules
families/a b c210how to build each family
reference/216protocol, auth, register
troubleshooting.md85symptom → cause → fix
UPDATE.md49version pins
9 files · 677 lines of hard-won judgement
Step 0: classify, before any code
1Bytes range-readable?no → mirror
2Requester-pays or auth?yes → C
3Overwritten in place?yes → C
4Splices into one grid?yes A no B
then one module, one open(), one registry entry

One prompt to a registered source

>Add a virtual icechunk store for GPW soil organic carbon
1Classify
Family A · 8 global COGs
2Probe one tile
528,004 × 1,440,004 uint16
3Write the source
gpw_soc.py
4Build & verify
1.45 M refs, sharded · 78 s
5Register
"gpw_soc": gpw_soc_source,
6Parity with Earth Engine
area means within 0.013%
1.5 TB of source COGs → 47 MB of references 0 bytes copied

Pixel-perfect against Earth Engine

Earth Engine
JRC TMF deforestation year from the Earth Engine composite
−
Virtual cube
The same band from the virtual sources, computed in xarray
=
Difference
Difference map: no pixel differs
0 pixels differ
20192025year of deforestation
JRC TMF in our EUDR composite · Pará, Brazil · 8 years × 512 × 512 px
also pixel-exact at source HansenJRC GFCJRC GFTGLAD GLCLUFDP

Some data won’t play

forobs.jrc.ec.europa.eu/TMF/data
JRC Tropical Moist Forest download page: a world map of 10 by 10 degree tiles; clicking tile N10_E90 lists one download link per file
one tile at a time
86tiles of 10° × 10°
× 41layers each
3,526files, one click each
served by download.py no range requests

Epoch open data on Source Coop

JRC GFC 2020forest cover · 10 m38.4 GiB 1 COG
JRC GFT 2020forest types · 10 m73.8 GiB 1 COG
JRC GSWsurface water · monthly 2017–21416 GiB 30,240 tiles
JRC TMFtropical moist forest · 1990–2025117 GiB 3,526 COGs
ForTy 2020forest typology · 10 m310 GiB 135,542 COGs
WRI forest-loss driversdominant driver · 1 km · 2001–20250.28 GiB 1 COG
Xiao natural & planted forests30 m · about 20208.2 GiB 1,010 COGs
with TMF on Source Coop Computed deforestation in every Indonesian palm oil concession in 60 s on a laptop
source.coop/epoch
COGs + geoparquet index

Earth Engine spend, month by month

Dec Jan Feb Mar Apr May Jun Jul Aug Sep thumbnails + isochrones, since moved off EE xarray lane ↓ 97% Aug–Sep vs Dec–Feb monthly average, prod Cloud Billing

What we gained

2× quicker per job, same compute

64 concurrent jobs up from 4

Stable under load

A small dog riding a chairlift on its own, high above pine trees and mountains
me on CNG

Come and chat

Jake Wilkins

GitHub jakenotjay

Web epoch.blue

Epoch open data source.coop/epoch