Repository navigation
feat: add STAC Item/Collection generator for TerraMind embeddings - #330
Conversation
Catalogs the Embed2Scale TerraMind embedding GeoTIFFs served from the CloudFerro Swift container as STAC, following the CNG Geo-Embeddings community recommendation (catalog_guide.ipynb sections 3.2 and 3.3). The container listing is paged via the Swift marker parameter, and each GeoTIFF is opened over GDAL /vsicurl/ to read only its TIFF header -- CRS, geotransform, band count and data type -- so cataloging costs about 32 KB of range requests per 4.5 MB file rather than a full download. Inputs are exposed as both CLI flags and environment variables (output_dir, page_size, max_pages, workers) so c3_create_operator can surface them as component inputs. The Collection omits the projection extension because the Items span many UTM zones, leaving no single collection-level proj:code. Generated Items are reproducible output and are gitignored. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Generated components fail before cataloging because the strict parser rejects CLAIMED’s name=value inputs and the default image lacks the required GDAL bindings and native library.
3 open issues
What changed in this PR
Adds a STAC catalog generator for TerraMind embedding GeoTIFFs to CLAIMED’s geospatial components.
Changes:
- Pages through the CloudFerro Swift listing and reads GeoTIFF headers concurrently without decoding raster pixels.
- Writes STAC Items and a parent Collection with aggregated extents and shared embedding metadata.
- Adds CLI and environment-variable controls, and ignores generated catalogs and local artifacts.
| File | Description |
|---|---|
src/claimed/components/geo/stac/create_stac_items.py |
Implements listing pagination, header extraction, and STAC Item/Collection generation. |
.gitignore |
Excludes generated STAC output, external demo data, and macOS archive artifacts. |
Review effort: Balanced
|
@romeokienzler See review from copilot above, not sure if these are actually needed. branch also out of date, so you need to update it before merging. Let me know once I should review. |
- Declare the GDAL wheel via a `pip install` line so c3_create_operator puts it in the generated image. - Accept CLAIMED name=value inputs in the argument parser. - Only promote an Item property to the Collection if every Item has it. Signed-off-by: Romeo Kienzler <romeo.kienzler1@ibm.com>
|
@blumenstiel the branch is updated with
Ready for your review. |
| src/claimed/components/geo/Demo/ | ||
|
|
||
| # Generated STAC Items and Collection (reproducible via create_stac_items.py) | ||
| src/claimed/components/geo/stac/out/ |
There was a problem hiding this comment.
needed? Looks more like local files.
I, Romeo Kienzler <romeo.kienzler1@ibm.com>, hereby add my Signed-off-by to this commit: 33b2930 Signed-off-by: Romeo Kienzler <romeo.kienzler1@ibm.com>


What
Adds a reusable CLAIMED component at
src/claimed/components/geo/stac/create_stac_items.pythat catalogs the Embed2Scale TerraMind embedding GeoTIFFs as STAC.The GeoTIFFs are served from the CloudFerro Swift container at
https://s3.waw4-1.cloudferro.com/swift/v1/embed2scale-terramind/. The component pagesthrough that listing and writes one STAC Item per GeoTIFF, plus the parent Collection
grouping them.
Item and Collection structure follow the 1st CNG Geo-Embeddings sprint community
recommendation, sections 3.2 and 3.3 of
catalog_guide.ipynb.
How
NextMarker, so themarkerfor the nextpage is taken from the last entry of the current one.
--max-pagesbounds the walk./vsicurl/and only its TIFFheader is read — CRS, geotransform, band count, data type. No raster blocks are
decoded. Measured cost is ~32 KB of range requests (first and last 16 KB) against each
4.5 MB file, so cataloging thousands of embeddings never downloads the rasters.
output_dir,page_size,max_pagesandworkersare acceptedas CLI flags and as environment variables, the convention the other CLAIMED Python
operators use, so
c3_create_operatorcan surface them as component inputs.Notes for review
zones (
EPSG:32613,EPSG:32614, …), so there is no single collection-levelproj:codeto state. The notebook's single-tile example can useEPSG:4326; thatwould be misleading across a multi-zone collection.
data_typeand theemb:*properties are promoted to the Collection only when every Item agrees on them.
committed (~13 MB for three pages).
.gitignorehunk also carries entries for macOS archive cruft and the externallycloned
geo/Demo/data, which were already present uncommitted in the working tree.Verification
Ran against the live container for the first 3 listing pages:
pystac.validate()against theSTAC 1.1.0 schemas plus
embeddings/v1.0.0andprojection/v2.1.0.[-105.0003, 35.1046, -79.6617, 49.6527],2017-01-02T17:57:32Z → 2017-03-20T17:40:21Z, with 3000
rel="item"links that resolve.data_type: float32,emb:type: chip,emb:dimensions: [768],emb:chip_size: [256, 256],emb:stride: [256, 256].🤖 Generated with Claude Code