Download yearly AlphaEarth embeddings for arbitrary regions.
Project description
aef-download
aef-download is a Python package and CLI for downloading yearly
AlphaEarth Foundations embeddings for arbitrary regions from the public
AlphaEarth mosaic hosted on Source Cooperative.
It is designed for workflows where you want to:
- download one or more years for a custom region
- use a boundary file or a direct bbox
- write local yearly
Zarrstores - optionally mask pixels outside the requested polygon
- resume interrupted downloads safely
Features
- boundary files readable by
geopandas(GeoJSON,GPKG,SHP, and more) - direct bbox input in
EPSG:4326 - yearly downloads for
2017-2025 - local yearly
Zarroutputs - optional boundary mask
- optional dequantized
float32output - resumable downloads via
.progress.json - both CLI and Python API
Install
From PyPI
Once published:
pip install aef-download
From GitHub
pip install git+https://github.com/Caojun-whu/aef-download.git
From a local clone
pip install -e .
Data source
The package reads from the public AlphaEarth mosaic:
This package downloads regional subsets from that public mosaic. It does not download the full global dataset.
By default, downloaded embeddings are stored as quantized int8. Use
dequantize=True or --dequantize if you want float32 outputs instead.
CLI quickstart
Download one year using a boundary file:
aef-download download-year \
--boundary region.geojson \
--year 2022 \
--output-dir ./out \
--mask-boundary
Download multiple years:
aef-download download-years \
--boundary region.geojson \
--year-start 2017 \
--year-end 2025 \
--output-dir ./out \
--mask-boundary
Download using a bbox:
aef-download download-year \
--bbox 112.95 22.56 114.05 23.93 \
--year 2022 \
--output-dir ./out
Estimate storage without downloading:
aef-download estimate-years \
--boundary region.geojson \
--year-start 2017 \
--year-end 2025
Python API quickstart
from aef_download import download_year, estimate_year
estimate = estimate_year(
boundary_path="region.geojson",
year=2022,
)
print(estimate["estimated_storage"])
output = download_year(
boundary_path="region.geojson",
year=2022,
output_dir="./out",
mask_boundary=True,
)
print(output)
Using a bbox:
from aef_download import download_year
output = download_year(
bbox=(112.95, 22.56, 114.05, 23.93),
year=2022,
output_dir="./out",
)
print(output)
Output format
Each year is written as:
{prefix}_{year}.zarr{prefix}_{year}.zarr.progress.json
The Zarr store contains:
embeddingsxymaskwhenmask_boundary=True
Typical Zarr attributes include:
yearbboxboundary_sourcemask_boundarydequantized- source mosaic settings
Resume behavior
Downloads are written chunk by chunk. If interrupted, rerun the same command
without --overwrite; completed chunks will be skipped and the download will
resume from the progress file.
Notes
- Supported years are
2017-2025. - Bboxes are interpreted as
(xmin, ymin, xmax, ymax)inEPSG:4326. - Boundary files are normalized to
EPSG:4326before slicing the AlphaEarth mosaic.
Development
Run tests:
python -m pytest tests -q
Check the CLI:
aef-download --help
Build a release:
python -m build
python -m twine check dist/*
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 aef_download-0.1.0.tar.gz.
File metadata
- Download URL: aef_download-0.1.0.tar.gz
- Upload date:
- Size: 15.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
321e7f1231c552276098588ebc0197d7a1b0c3cf44fa1fff5f14af9928afe456
|
|
| MD5 |
71e2bfd9b261448bcf1e4c60e33532d8
|
|
| BLAKE2b-256 |
a2d1697cfd07799d44ec3babed30ee34ab91443391f6ecb76825a25b46f17a49
|
File details
Details for the file aef_download-0.1.0-py3-none-any.whl.
File metadata
- Download URL: aef_download-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4de85522fb4e790f2198f337bb7e13c1a1a8bf9191c70c232e01f46c53a03741
|
|
| MD5 |
4f74dfadee2095d2f226201318893ae4
|
|
| BLAKE2b-256 |
422fbe1271b076947c6b61299a6908f98690022144e74371bc790bbddf1fc0fb
|