Repository navigation
Description
Summary
Since #542, embeddings.search / embeddings.add open one AlphaEarth (Satellite Embedding V1, annual) tile for one year. Each year is a separate layer, and the time slider can't step through 2017–2025.
Almost everything needed for that is already in the code. A tile layer whose timeUrls lists one COG per date follows the slider. That is how stac.addCube (#559) builds a cube. I filled timeUrls by hand in a project file with the nine AlphaEarth COGs of one tile, and RustGIS 0.6.0 stepped through the years correctly (section 1b). The missing piece is a command that fills it from the AlphaEarth index.
I also tested the GeoZarr mosaic on Source Cooperative (tge-labs/aef-mosaic). It's a true (time, band, y, x) cube, but four reader limits stop it today (details below).
Proposal:
embeddings.addCube: AlphaEarth tiles over an area, one tile layer per footprint, one COG per year, on the time slider. Small: it reusesstac.addCube's machinery.embeddings.similarityandembeddings.change: the analyses that make sense for embeddings. The 64 bands have no physical meaning, so the useful outputs are cosine similarity and the change between years.- Optional, larger: let the Zarr reader open
aef-mosaic(window reads, byte ranges inside shards,spatial:/proj:conventions, integer years as a time axis).
Tested with rustgis-cli 0.6.0 (Windows) and code read at origin/main 32ea10d (34 commits after v0.6.0).
1. What I tested
1a. The GeoZarr mosaic (https://data.source.coop/tge-labs/aef-mosaic)
The store: Zarr v3, one group, embeddings int8 (time=9, band=64, y=1,859,584, x=4,009,984), EPSG:4326 at ~0.0000898° (≈10 m at the equator). Shards are (1, 64, 4096, 4096) with inner chunks (1, 64, 256, 256), compressed with zstd and a crc32c index, and the fill value is −128. The coordinate arrays are time (int32, values 2017…2025, no units attribute), band (vlen-utf8 A00…A63), x and y (float64). The group's attributes use the draft proj:, spatial: (spatial:transform, spatial:bbox) and geoemb: conventions, including the quantization (signed_square, nodata −128). The root zarr.json has no consolidated metadata.
| Command | Result |
|---|---|
raster.zarrInfo {"url": ".../aef-mosaic"} |
no Zarr arrays found: give a store with consolidated metadata … |
raster.zarrInfo {"url": ".../aef-mosaic/embeddings"} |
✅ the array is read: dims time 9, band 64, y, x, Int8, readable: true. The sharding codec is understood. |
layer.addZarr {"url": ".../embeddings", "index": {"time": 7, "band": 0}} |
is 4009984 × 1859584, more than the 1000000000 cells a raster holds |
layer.addZarr {... "time": true} |
has no time dimension (a coordinate with CF units, such as "days since 2001-01-01") |
stac.addCube {"url": ".../aef-mosaic", ...} |
http status: 404 (it's not a STAC API) |
stac.addCube {"url": ".../aef-mosaic/zarr.json", ...} |
isn't a STAC catalog or collection |
layer.addUrl {"url": ".../aef-mosaic"} |
not a data format RustGIS reads |
cube.catalog {"query": "alphaearth"} / "embedding" |
no entries |
Why it fails, in crates/data/src/raster/zarr.rs:
- No window.
plan()(L987) always reads the whole 2-D slice and refuses anything overmax_samples()(L1001).Selection(L915) only holds a variable and the indices of the other dimensions; there's no bbox. - Shards fetched whole.
plan()returns chunk keys, and as far as I can see each one is fetched as a whole file. At Viçosa (MG, Brazil) one shard (embeddings/c/7/0/283/372) is 686 MB stored. Only one 256×256 inner chunk (~4 MiB decoded) of it would be needed. The server answersAccept-Ranges: bytes, so you could read the shard index (the last 256×16+4 bytes) and then range-read only the needed inner chunks. - Time axis needs CF units.
time_axis()(L1379) skips a coordinate withoutunitscontaining" since "(L1389). Heretimeholds plain integer years. - Georeferencing. The reader doesn't read the
spatial:transform/proj:codeconventions. Thexcoordinate (4,009,984 values, 32 MB) is longer thanMAX_COORDS(L35, 4,000,000), so it isn't used either. - Store discovery. Without consolidated metadata, the root URL finds no arrays (L474). The member arrays
embeddings,time,xandycould be probed by name fromdimension_names.
1b. The per-year COGs (https://data.source.coop/tge-labs/aef/v1/annual/<year>/<zone>/<hash>-<row>-<col>.tiff)
embeddings.search {"dataset": "alphaearth", "year": Y, "bbox": [-42.89,-20.76,-42.87,-20.74]} for Y = 2017…2025 gives the same tile every year: identical bbox [-43.4264, -21.4762, -42.6283, -20.7273], UTM 23S, same -0000008192-0000000000 suffix. Only the file-name prefix changes, and it's a random hash per year (xdwdu82ch9yffuj03 in 2017, x1i7lpngfblt9wshv in 2024, …). So:
layer.addUrl's date template ({YYYY}) can't describe the series, because the file name isn't predictable from the year. The index has to be read.- The footprint (or zone + row/col suffix) is a stable key for "the same tile across years".
Proof of concept: the cube already works if timeUrls is filled. I ran embeddings.add once and saved the project. Then I edited the tile layer: I added "timeUrls": [[<ms of Jan 1 of each year>, "<that year's COG>#bands=2,17,10&range=-0.3,0.3&dequantize=aef&cube=1"], …] (nine entries) and appended &cube=1 to url. Then:
rustgis-cli run --project aef_cube.rgis \
--cmd 'map.zoomToExtent={"extent":[-42.91,-20.78,-42.85,-20.735]}' \
--cmd 'time.set={"dates":["2017-01-01",…,"2025-01-01"],"format":"YYYY"}' \
--cmd 'time.goTo={"step":0}' --cmd 'share.exportMap={"path":"cube_2017.png",…}' \
--cmd 'time.goTo={"step":4}' --cmd 'share.exportMap={"path":"cube_2021.png",…}' \
--cmd 'time.goTo={"step":8}' --cmd 'share.exportMap={"path":"cube_2025.png",…}'
The three exports differ, each showing that year's embeddings (13 s in total, read in place). The project reopens with its nine timeUrls. I can share the project and the three exports if useful.
Two things I noticed:
time.infolists"tiles": []even though a tile layer follows the slider. Maybe it only liststimeUrltemplates?- At the last step,
time.info'swindowreads["2025", "2025"]. The 2025 file still drew, so this is only how the window is shown.
2. Where the gap is in the code (origin/main 32ea10d)
AlphaEarth search: crates/tiles/src/embeddings.rs
- L225
AEF_INDEX=…/aef_index_stac_geoparquet.parquet(302,466 rows, one per tile and year). - L338
aef_request()reads the index in place by bbox, at mostMAX_INDEX_ROWS= 4000 rows (L233). The read already returns every year in the box. - L275
aef_tiles()then keeps one year (L289if y != year { return None; }), dedups by URL (L330) and keepsMAX_TILES= 60 (L235). - L343 / L360
search_aef/search_aef_blockingtake a singleyear.
AlphaEarth commands: crates/engine/src/cmd/embeddings.rs
- L96
search()→ L108emb::search_aef_blocking(area, year). - L127
add(): one URL. It builds the look (aef_look,cog::with_look), takes the year from the path (L144), and callslayer::add_cog(L159). There's nocubeflag and notime_urls.
The cube machinery to reuse: crates/engine/src/cmd/stac.rs
- L302
CubeFiles.tiles: BTreeMap<tile, BTreeMap<day, url>>, filled bycube_files()(L349) from a STAC API or a static collection. - L951
add_cube(). From L1057 (for (tile, by_day) in &tiles) it adds each tile throughlayer::add_url(…, "cube": true)(L1062), setst.time_urls = urls(L1077), and turns the slider on or widens it over the dates (L1101…). It also handles the layer-room check, URL checks and undo on failure. None of this is STAC-specific.
Where the slider picks the file: crates/map/src/tiles.rs L162 time_urls, L436 apply_time() (the last date in the window), L467–471 repair() (web addresses, sorted, capped at MAX_TIME_URLS = time::MAX_STEPS = 20,000).
The look: crates/tiles/src/cog.rs L67 Look (bands, range, aef, cube), L142 with_look().
So the gap is just this: no command builds a tile → year → COG map from the AlphaEarth index and hands it to the code add_cube already has.
3. Proposal
3.1 embeddings.addCube (small)
embeddings.addCube {"dataset": "alphaearth", "bbox"?: [w,s,e,n] | "view", "start"?: 2017, "end"?: 2025,
"bands"?: [r,g,b], "stretch"?: 0.3, "name"?: text}
→ one tile layer per footprint, each with a COG per year, following the time slider
- In
crates/tiles/src/embeddings.rs, addaef_cube(fields, batch, years, bbox) -> BTreeMap<String, BTreeMap<i32, Tile>>. It works likeaef_tiles()without they != yearfilter. Key: the EPSG code plus the-<row>-<col>stem suffix, or the footprint rounded to ~1e-6° (they match across years at Viçosa). Each year's URL is kept. Addsearch_aef_cube/search_aef_cube_blockingover the sameaef_request(), so it's still one ranged read of the index.- The index holds roughly 9× the rows of a single-year search.
MAX_INDEX_ROWS= 4000 should be checked against a typical view. If the read is incomplete, warn, assearch()already does.
- The index holds roughly 9× the rows of a single-year search.
- In
stac.rs, factor L1057–(end of slider setup) into something likepub(crate) fn add_cube_tiles(s, tiles: BTreeMap<String, BTreeMap<i64 /*ms*/, String /*url+look*/>>, base_name) -> CmdResult.add_cube()andembeddings.addCubewould both call it. The AlphaEarth look would beaef_look(bands, stretch)withcube: true, throughcog::with_look(), so the project reopens it as a cube (Look::cube). - Dates: 1 January of each year (UTC ms), slider
unit: "year",format: "YYYY". - The UI: a "Years as a time cube" option in the Satellite Embeddings dialog (
crates/ui-egui/src/embeddingsui.rs), next to the year picker. - Attribution on every layer (CC BY 4.0): "The AlphaEarth Foundations Satellite Embedding dataset is produced by Google and Google DeepMind."
Tests: grouping by footprint across years with a hash prefix that changes per year; a missing year (a tile absent from one year's export) leaves a gap, not an error; the cube survives save and reopen (timeUrls, cube=1).
3.2 Similarity and change: what the 64 values are for
The 64 bands (A00…A63) are coordinates of a learned embedding, not reflectances or indices. An RGB of three of them is just a picture. A per-band trend, mean or range (cube.trend, cube.reduce) has no meaning for them. Google documents the embeddings as unit-length vectors on the 64-D sphere, which means:
- Similarity between two pixels, or between a pixel and a reference, is the cosine = dot product of their 64-D vectors (after
sign(v)·(v/127.5)²dequantization; renormalise to absorb quantization error). - Change between years at a pixel is the distance between its vector in year A and in year B:
1 − cos(v_A, v_B), or the angleacos(cos). A cube makes this a natural slider product: change relative to the first year, or year over year.
Suggested commands, both reading 64-band windows the way layer.addUrl {"bbox": …} already does (limit: 64 Mi values → ~1000×1000 px ≈ 10×10 km at 10 m):
embeddings.similarity {"dataset": "alphaearth", "year": 2024, "point": [lon, lat] | "points": layer,
"bbox"?: …} → Float32 raster of cosine similarity to the reference vector (or the mean of several)
embeddings.change {"dataset": "alphaearth", "from": 2017, "to": 2025, "bbox"?: …}
→ Float32 raster of 1 − cos(v_from, v_to)
change could also return one layer per year, as a slider series, if cube.reduce-style outputs are preferred. Nothing like this exists yet. I found no cosine or dot-product tool over raster bands, and writing a 64-term expression in the raster calculator isn't practical.
3.3 Optional: the GeoZarr mosaic
This would allow arbitrary areas without UTM tile edges, and one store for all years. It needs, in crates/data/src/raster/zarr.rs:
- A window on
Selection(bbox → row/col ranges), withplan()listing only the chunks it touches. - Byte-range reads inside
sharding_indexedshards: read the index at the end, then only the inner chunks the window needs (otherwise each read fetches a whole shard of hundreds of MB). - Georeferencing from
spatial:transform+proj:code(zarr-conventions), with no 1-Dx/yread.xhere is longer thanMAX_COORDS. - A time axis from a coordinate of integer years (1000–9999) with no
units, or fromtimeplus the group's metadata. - A root without consolidated metadata: find the arrays named in
dimension_namesby probing<name>/zarr.json.
With those, layer.addZarr {"url": ".../aef-mosaic", "variable": "embeddings", "index": {"band": …}, "time": true, "bbox": …} and zarr.series at a point (64 × 9 values) would work. The mosaic's README says it's "not officially supported by Google", and its conventions are still drafts, so 3.1 looks like the better first step.
Data and licence
- Per-year COGs (Source Cooperative mirror):
https://data.source.coop/tge-labs/aef/v1/annual/<year>/<zone>/…tiff. Index:…/annual/aef_index_stac_geoparquet.parquet. Google's own copy:storage.googleapis.com/alphaearth_foundations/satellite_embedding/v1/annual/…(requester-pays off). - Mosaic:
https://source.coop/tge-labs/aef-mosaic(Zarr v3, EPSG:4326,(9, 64, 1859584, 4009984)). - Licence: CC BY 4.0. "The AlphaEarth Foundations Satellite Embedding dataset is produced by Google and Google DeepMind."
Activity
fix(embeddings): first review of addCube (opengeos#1720)
fix(embeddings): say the handed-over files outside the years asked for (
fix(embeddings): addCube's names, doc and place match after review (o…
fix(embeddings): refuse addCube's bad years and a year named twice (o…
fix(embeddings): refuse a stretch that isn't a number; say a search's…
docs(embeddings): addCube's doc says the app's assistant waits on the…
fix(cubes): refuse a widened slider past its steps; say a part read h…
fix(cubes): refuse a slider step that never shows some of a cube's da…
docs(cubes): say when a cube is refused for the time slider's steps (o…
docs(cubes): a longer step for the step limit, a shorter one for unse…
test(embeddings): series_notes both ways (opengeos#1720)
feat(embeddings): AlphaEarth's years on the time slider (embeddings.a…
feat(embeddings): AlphaEarth similarity and change between years (ope…
fix(embeddings): review round 1 for similarity and change (opengeos#1720
fix(embeddings): say a window's header losses and the search's gaps (o…
15 remaining items
feat(data): place Zarr grids by spatial:transform and proj:code (#1720,…
fix(data): review round 1 for Zarr discovery by name (opengeos#1720)
fix(engine): a store found from one variable is cached for that varia…
fix(engine): say a missing variable in a store whose root lists no ar…
docs: a Zarr series reads a sharded array's cell chunk by range (open…
feat(data): find Zarr arrays without consolidated metadata, and whole…
fix(data): bound a series' shard geometry before reading it (opengeos…
fix(data): count a shard's index toward the read limit; document the …
docs: a sharded series also reads one index per shard (opengeos#1720)
feat(data): a Zarr series reads only the cell's chunk of each shard (#…
fix(engine, map): refuse a time window a read can't take, and require…
feat(data, engine): a Zarr window follows the time slider; a geograph…
feat(embeddings): a point layer as the reference of embeddings.simila…
elpidioassinaturas commentedon Nov 27, 2026
Closing: the core list is merged — the time cube (
embeddings.addCube, #1749, #2807), similarity and change (#1876, #2797), and the Zarr items 1–5 (#1885, #1951, #2117, #2227), plus range reads (#2268) and a window that follows the slider (#2298). Remaining extras (a change series over every year, a Similarity/Change section in the pane, reads across a tile edge) can get their own issues.