geoextract_gee
Google Earth Engine backend extension for geoprepare (geoextract).
This package provides an optional Google Earth Engine (GEE) execution path for Earth Observation (EO) data extraction. It orchestrates task combinations, processes them using GEE, polls the tasks, and downloads the resulting CSVs from Google Cloud Storage (GCS).
Prerequisites
- Google Earth Engine Account: Ensure you have access and a project set up.
- Google Cloud Storage: A GCS bucket is required to export the results before downloading.
- Environment: It is recommended to refer to installer for setting up the environment required for
geocifandgeoprepare.
Installation
pip install geoextract-gee
This also installs geoprepare, which it extends. geoprepare switches to this backend when use_gee = True (see Configuration).
Authentication
Set key in [GEE] to a service account JSON key, as a path relative to geoprepare's metadata folder. Without it (or with key = none), the standard Earth Engine sign-in (ee.Authenticate()) runs the first time; follow its instructions.
Configuration
Turn the backend on in [DEFAULT] of your geoprepare config, and put its settings in a [GEE] section:
[DEFAULT]
use_gee = True
redo = False
[GEE]
project = your-gcp-project-name
bucket = your-gcs-bucket-name
# Optional
# Service account key, relative to the metadata folder. Default: interactive sign-in.
key = gee_key.json
# Compute extra counts and sums per region, for checking results. Costs more EECU. Default False.
audit_stats = False
# One GEE task per country instead of one per region (see Architecture). Default False.
parallel_regions = True
# Price of one EECU-hour, in dollars, for the cost shown while polling. Default 0.4.
eecu_h_pricing = 0.4
# Extract variables that have no GEE handler with the local tiles backend
# (see "Variables not in Earth Engine" below). Default False.
fallback_local = False
# Write GEE outputs to dir_output/gee/ instead of dir_output/, for comparing the
# two backends. A debugging aid; geomerge reads dir_output. Default False.
use_subdir = False
# Label for every Earth Engine task, so its compute shows per label in Cloud billing
# and monitoring. 1-63 characters. Default: geoprepare's [DEFAULT] project_name.
workload_tag = my-project
Exports go to gs://<bucket>/gee_extract/<project_name>/, where project_name is geoprepare's [DEFAULT] project_name. Give each setup that shares a bucket its own project_name: two setups with the same name and bucket write to the same folder and reuse each other's Earth Engine tasks.
Configs from before version 0.2.0 have these settings in [DEFAULT] with a gee_ prefix (gee_project, gee_bucket, gee_key, gee_audit_stats, gee_parallel_regions, gee_eecu_h_pricing, gee_fallback_local) and use_gee_subdir. They still work, with a warning naming the new setting.
Supported Datasets
The GEE backend currently supports extraction for the following geoprepare datasets:
| Dataset | Description | Notes |
|---|---|---|
AEF (aef) |
AlphaEarth Foundations satellite embeddings | Extracted as a multi-year static average. The GEE dataset has different scaling and quantization compared to the raw files from Source Cooperative. |
AgERA5 (agera5_*) |
Agrometeorological indicators | Extracted from the Climate Engine Community Catalog. Supports agera5_snow_thickness_lwe and agera5_dewpoint (converted from Kelvin to °C, as in the tiles backend). Only variables the tiles backend also extracts are added, so both backends give the same columns. |
CHIRPS (chirps) |
Precipitation data | CHIRPS v3, IMERG-based daily (UCSB-CHC/CHIRPS/V3/DAILY_SAT). Arrives in Earth Engine weeks after the CHC server: on 2026-10-11 the last image was 2026-08-31. |
CPC (cpc_*) |
Temperature and precipitation | Supports cpc_tmax, cpc_tmin and cpc_precip. Earth Engine stores precipitation in 0.1 mm; it is divided by 10 to give mm. Its current version starts in 2006, so earlier years are empty. |
ESI (esi) |
Evaporative Stress Index | ESI data in GEE often has a processing lag. The pipeline extracts the last available data for the given period. Supports esi_4wk and esi_12wk. |
NDVI (ndvi) |
Vegetation index (MODIS) | Because the GEE pipeline pulls daily observations rather than the 8-day composite blocks used by the legacy tiles backend, the timing and number of missing observations at the start or end of a time-series will differ. geomerge naturally handles linear interpolation of these gaps across year boundaries. |
NSIDC (nsidc) |
SMAP L4 soil moisture (NASA/SMAP/SPL4SMGP/008) |
Supports nsidc_surface and nsidc_rootzone. |
SoilGrids (soilgrids) |
Soil properties | Extracted as a multi-year static dataset. |
VIIRS (viirs) |
High-res VIIRS NDVI data |
Variables not in Earth Engine
Some geoprepare variables have no copy in Earth Engine or its community catalog, so this backend cannot extract them:
| Variable | Why |
|---|---|
chirts_era5_tmax, chirts_era5_tmin |
Earth Engine has only CHIRTS-daily v1, which ends in 2016. |
chirps_gefs |
CHIRPS-GEFS is not in Earth Engine. |
etref |
NCEP RefET is not in Earth Engine. AgERA5's FAO-56 reference ET is, but it is a different product and geoprepare has no variable for it, so it is not offered as a replacement. |
Other variables without a handler (for example lst, fpar, ndvi_cdr) are treated the same way.
By default (fallback_local = False) the run stops with an error listing these variables, before any GEE task is submitted. With fallback_local = True, each one is logged with a warning and extracted by geoprepare's local tiles backend while the GEE tasks run. The local backend reads files that geodownload has already written to dir_intermed; geoextract does not download them. If they are missing, the run stops before submitting any task and names the geodownload dataset to run (for example CHIRTS-ERA5). Fallback variables are written to dir_output, not to dir_output/gee/, even with use_subdir = True. They are extracted one combination at a time.
Architecture
- Task Submission: The pipeline extracts data using one of two modes, controlled by
parallel_regionsin[GEE]:- Sequential Mode (
parallel_regions = False): For each region and variable combination, a separate GEE task is created. - Parallel Batch Mode (
parallel_regions = True): All regions within a country are bundled into a singleee.FeatureCollectionand processed simultaneously by GEE viareduceRegionmapping. This submits a single "bulk" GEE task per year/variable, reducing the task queue size and may also avoid quota limits.- Note: For variables requiring heavy reductions (e.g.,
nsidcconverting 3-hourly images to daily means), Parallel Batch Mode may cause GEE tasks to take more time to run, time out or run out of memory. In case of error, using Sequential Mode (parallel_regions = False) is recommended for these variables. - Note: In Parallel Batch Mode, incremental updates for the current year do not generate partial files like Sequential Mode. Instead, the pipeline automatically re-extracts the entire year and overwrites the local CSVs to ensure seamless data coverage without complex local file merging and different time windows required by each variable.
- Note: For variables requiring heavy reductions (e.g.,
- Sequential Mode (
- Polling: The process tracks the submitted tasks and polls Earth Engine until all tasks are marked as
COMPLETEDorFAILED. To prevent unexpected billing, polling monitors EECU usage and cancels runaway tasks exceeding defined limits. - Download and Format: Once tasks are complete, the resulting CSVs are downloaded concurrently from Google Cloud Storage using
transfer_manager. If Parallel Batch Mode was used, the bulk CSV is automatically parsed and split locally into the individual region CSVs expected bygeomerge.
Metadata
Release files for geoextract-gee 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| geoextract_gee-0.2.2.tar.gz | 38.1 kB | Without provenance | Details for geoextract_gee-0.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| geoextract_gee-0.2.2-py3-none-any.whl | Python 3 | none | any | Details for geoextract_gee-0.2.2-py3-none-any.whl |
Total release size: 80.0 kB
Release files / geoextract_gee-0.2.2.tar.gz
| Download URL | geoextract_gee-0.2.2.tar.gz |
|---|---|
| Size | 38.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7b90d4e5221a5a342e618ea380f1e928642ab5f5cb5be8d5d2ceb202b3bb34d8
|
|
BLAKE2b-256 checksum How to use checksums |
6603640f57f440488ef51520ee422df8b47e5815482e03d02550a24c334c76c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / geoextract_gee-0.2.2-py3-none-any.whl
| Download URL | geoextract_gee-0.2.2-py3-none-any.whl |
|---|---|
| Size | 41.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e889271249a9f4a2aa04d0b5980ab7d5b68f81eddf51cf68744d3921446be19d
|
|
BLAKE2b-256 checksum How to use checksums |
50cdf55590b15890a5cd5a69eefb742450101a09001ee1c5763d4730d071f679
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for geoextract-gee 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.