Python library interface to the Tessera geofoundation model embeddings
Project description
GeoTessera
Python library interface to the Tessera geofoundation model embeddings.
Overview
GeoTessera provides access to geospatial embeddings from the Tessera foundation model, which processes Sentinel-1 and Sentinel-2 satellite imagery to generate 128-channel representation maps at 10m resolution. The embeddings compress a full year of temporal-spectral features into useful representations for geospatial analysis tasks.
Data Coverage
Features
- Download geospatial embeddings for specific coordinates
- List available embedding tiles
- Visualize embedding data as RGB composite images
- Built-in caching for efficient data management
- Command-line interface for easy access
- Registry management tools for data maintainers
Installation
pip install git+https://github.com/ucam-eo/geotessera
Configuration
GeoTessera automatically caches downloaded data to improve performance. By default, files are cached in the system's default cache directory (~/.cache/geotessera on Unix-like systems).
Custom Cache Directory
You can customize the cache location using the TESSERA_DATA_DIR environment variable:
# Set custom cache directory
export TESSERA_DATA_DIR=/path/to/your/cache/directory
# Or set for a single command
TESSERA_DATA_DIR=/tmp/tessera geotessera info
You can also specify the cache directory programmatically:
from geotessera import GeoTessera
# Use custom cache directory
tessera = GeoTessera(cache_dir="/path/to/your/cache")
Usage
Command Line Interface
Use uvx to run the CLI without installation:
# List available embeddings
uvx --from git+https://github.com/ucam-eo/geotessera@main geotessera list-embeddings --limit 10
# Show dataset information
uvx --from git+https://github.com/ucam-eo/geotessera@main geotessera info
# Generate a world map showing embedding coverage
uvx --from git+https://github.com/ucam-eo/geotessera@main geotessera map --output coverage_map.png
# Create a false-color visualization for a region
uvx --from git+https://github.com/ucam-eo/geotessera@main geotessera visualize --topojson example/CB.geojson --output cambridge_viz.tiff
# Serve an interactive web map with Leaflet.js
uvx --from git+https://github.com/ucam-eo/geotessera@main geotessera serve --geojson example/CB.geojson --open
# Serve with custom band selection (e.g., bands 30, 60, 90)
uvx --from git+https://github.com/ucam-eo/geotessera@main geotessera serve --geojson example/CB.geojson --bands 30 60 90 --open
If you have the repository checked out, then use --from . instead.
Python API
from geotessera import GeoTessera
# Initialize client
tessera = GeoTessera(version="v1")
# Download and get dequantized embedding for specific coordinates
embedding = tessera.get_embedding(lat=52.05, lon=0.15, year=2024)
print(f"Embedding shape: {embedding.shape}") # (height, width, 128)
Registry Management (Data Maintainers)
GeoTessera includes a separate tool for managing the registry files used by the package. This tool is intended for data maintainers who need to generate or update the Pooch registry files that track available embeddings.
Using geotessera-registry
# List existing registry files
uvx --from git+https://github.com/ucam-eo/geotessera@main geotessera-registry list /path/to/data
# Generate/update registry files for all years
uvx --from git+https://github.com/ucam-eo/geotessera@main geotessera-registry update /path/to/data
# Update incrementally (only process new files)
uvx --from git+https://github.com/ucam-eo/geotessera@main geotessera-registry update /path/to/data --incremental
# Generate with custom worker count and create master registry index
uvx --from git+https://github.com/ucam-eo/geotessera@main geotessera-registry update /path/to/data --workers 8 --generate-master
The --generate-master flag creates a registry.txt file that lists all available registry files without hashes, serving as a master index.
About Tessera
Tessera is a foundation model for Earth observation developed by the University of Cambridge. It learns temporal-spectral features from multi-source satellite data to enable advanced geospatial analysis including land classification and canopy height prediction.
For more information about the Tessera project, visit: https://github.com/ucam-eo/tessera
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file geotessera-0.1.0.tar.gz.
File metadata
- Download URL: geotessera-0.1.0.tar.gz
- Upload date:
- Size: 15.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ca65b4e067574969770d6bd72917fc4eeb7ba22120a1ba3e6949d9b2151d629
|
|
| MD5 |
67ea99e757c5ce8e79bfde30030f576c
|
|
| BLAKE2b-256 |
c8f5960a9bdd14ee68c74932d7865dac14c506aa7cf41c5027be32f79cc3c448
|
File details
Details for the file geotessera-0.1.0-py3-none-any.whl.
File metadata
- Download URL: geotessera-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.8 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9771dca165533b463573a5e7b372b5907855ee2c371b4030f19bc3cf378d048
|
|
| MD5 |
5be14bdb29e6594d868fc4d3f6b98b86
|
|
| BLAKE2b-256 |
2f745189818f22d68a9e228fb3c7755d164d21666f25a62cf3f30469b57ad11b
|