Read GeoTessera embeddings from the zarr store for an arbitrary lon/lat bounding box, returned as a single EPSG:4326 float32 mosaic — including bboxes that span more than one UTM zone.
A tiny, dependency-light utility (NumPy + rasterio + affine; geotessera imported
lazily) extracted from tessera-eval
so it can be used on its own — e.g. by the Tessera VQ bolt-on — without pulling in
a full ML/eval stack.
GeoTessera's GeoTesseraZarr.read_region routes a whole bbox to one UTM zone
(by the bbox centre) and clips anything outside that zone's grid; it doesn't merge
across zones. This package reads the region in 0.1° chunks (each in its own native
zone) and reprojects every chunk into one shared EPSG:4326 grid — no silent
clipping, no mis-placement — using nearest-neighbour resampling (never blend the
128-d embeddings) with NaN nodata carried through.
pip install "tessera-zarr-utils[geotessera]" # + geotessera (needed by get_zarr)
pip install tessera-zarr-utils # core only; bring your own zarr handleimport tessera_zarr_utils as zu
gtz = zu.get_zarr() # cached GeoTesseraZarr handle, or None if unavailable
if gtz and zu.probe_zarr_coverage(gtz, bounds, year): # bounds = (west, south, east, north)
mosaic, transform, crs = zu.read_region_chunked(gtz, bounds, year)
# mosaic: (H, W, 128) float32, EPSG:4326; crs == "EPSG:4326"
# transform: affine.Affine; NaN = nodata| Function | Purpose |
|---|---|
get_zarr() |
Cached GeoTesseraZarr instance (import attempted once; None if geotessera/zarr unavailable). |
probe_zarr_coverage(gtz, bounds, year) |
True if the store has non-NaN data at the centre of bounds. |
read_region_chunked(gtz, bounds, year) |
(mosaic, transform, "EPSG:4326") for bounds=(west,south,east,north); chunks + reprojects + merges across UTM zones. (None, None, None) if no data. |
pip install -e ".[geotessera,dev]"
ruff check . && ruff format --check . && pytestMIT.