Skip to main content

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 Zarr stores
  • 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 Zarr outputs
  • optional boundary mask
  • optional dequantized float32 output
  • 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:

  • embeddings
  • x
  • y
  • mask when mask_boundary=True

Typical Zarr attributes include:

  • year
  • bbox
  • boundary_source
  • mask_boundary
  • dequantized
  • 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) in EPSG:4326.
  • Boundary files are normalized to EPSG:4326 before 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aef_download-0.1.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aef_download-0.1.0-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

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

Hashes for aef_download-0.1.0.tar.gz
Algorithm Hash digest
SHA256 321e7f1231c552276098588ebc0197d7a1b0c3cf44fa1fff5f14af9928afe456
MD5 71e2bfd9b261448bcf1e4c60e33532d8
BLAKE2b-256 a2d1697cfd07799d44ec3babed30ee34ab91443391f6ecb76825a25b46f17a49

See more details on using hashes here.

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

Hashes for aef_download-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4de85522fb4e790f2198f337bb7e13c1a1a8bf9191c70c232e01f46c53a03741
MD5 4f74dfadee2095d2f226201318893ae4
BLAKE2b-256 422fbe1271b076947c6b61299a6908f98690022144e74371bc790bbddf1fc0fb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page