Export and cloud mask Google Earth Engine imagery.
Project description
Geedim
Geedim provides a Python API and command line toolkit for exporting and cloud masking Google Earth Engine (GEE) imagery. Images and Image collections can be exported to:
GeoTIFF file
NumPy array
Xarray Dataset / DataArray
Google Cloud platforms
And cloud masking is supported on:
Landsat 4-9 collection 2 images
Sentinel-2 TOA and surface reflectance images
Installation
To install from PyPI:
pip install geedim
To install from conda-forge:
conda install -c conda-forge geedim
To support exporting to Xarray, use pip install geedim[xarray] or conda install -c conda-forge geedim xarray instead.
A registered Google Cloud project is required for access to Earth Engine. Once installation and registration is done, Earth Engine should be authenticated:
earthengine authenticate
Examples
API
Geedim provides access to its functionality through the gd accessor on the ee.Image and ee.ImageCollection GEE classes. This example exports a 6 month cloud-free composite of Sentinel-2 surface reflectance imagery to a GeoTIFF file:
import ee
# import geedim to enable accessors
import geedim # noqa: F401
ee.Initialize()
# filter collection based on cloud-free portion etc.
region = ee.Geometry.Rectangle(24.35, -33.75, 24.45, -33.65)
coll = ee.ImageCollection('COPERNICUS/S2_SR_HARMONIZED')
filt_coll = coll.gd.filter(
'2021-10-01', '2022-04-01', region=region, cloudless_portion=60
)
# print image properties
print(filt_coll.gd.schemaTable)
print(filt_coll.gd.propertiesTable)
# create a cloud-free composite & download
comp_im = filt_coll.gd.composite('median')
prep_im = comp_im.gd.prepareForExport(
crs='EPSG:3857', region=region, scale=10, dtype='uint16'
)
prep_im.gd.toGeoTIFF('s2_comp.tif')
Command line interface
Much of the API functionality can also be accessed on the command line with geedim and its sub-commands. This repeats the API example, exporting a 6-month cloud-free composite of Sentinel-2 surface reflectance imagery to a GeoTIFF file:
geedim search -c COPERNICUS/S2_SR_HARMONIZED -s 2024-10-01 -e 2025-04-01 -b 24.35 -33.75 24.45 -33.65 -cp 60 composite -cm median download -c EPSG:3857 -r - -s 10 -dt uint16
Documentation
Documentation is hosted at geedim.readthedocs.io.
License
This project is licensed under the terms of the Apache-2.0 License.
Credits
Tiled downloading was inspired by the MIT licensed GEES2Downloader project.
Medoid compositing, and the accessor approach to extending the GEE API, were adapted from geetools under terms of the MIT license.
Sentinel-2 cloud masking was adapted from ee_extra under terms of the Apache-2.0 license
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 geedim-2.0.0.tar.gz.
File metadata
- Download URL: geedim-2.0.0.tar.gz
- Upload date:
- Size: 96.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58578f57d88082e9882c9f5ccf04060b46b50b2e2cebfb54032aac79bf9cc0d3
|
|
| MD5 |
2601731a72e6b2dbd6b91d5f517a4847
|
|
| BLAKE2b-256 |
8b46e39125c8a82c342a5bcd86bf91a44d12385c35167e438c3a7efb2ae8ebf0
|
Provenance
The following attestation bundles were made for geedim-2.0.0.tar.gz:
Publisher:
publish-pypi.yml on leftfield-geospatial/geedim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
geedim-2.0.0.tar.gz -
Subject digest:
58578f57d88082e9882c9f5ccf04060b46b50b2e2cebfb54032aac79bf9cc0d3 - Sigstore transparency entry: 422551264
- Sigstore integration time:
-
Permalink:
leftfield-geospatial/geedim@7e5637f42e50a39f720b720bdb960dd191606964 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/leftfield-geospatial
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@7e5637f42e50a39f720b720bdb960dd191606964 -
Trigger Event:
release
-
Statement type:
File details
Details for the file geedim-2.0.0-py3-none-any.whl.
File metadata
- Download URL: geedim-2.0.0-py3-none-any.whl
- Upload date:
- Size: 73.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a703c02440eee4802e1b366a40840be1a05387c9a85a4ab37642c93c7adfb477
|
|
| MD5 |
ac288cf3a010614acb901c0c7d841d42
|
|
| BLAKE2b-256 |
4063099abed6df42c0c473e1058d9d15f4cd9d0ccfaba40be39efa4160f60bab
|
Provenance
The following attestation bundles were made for geedim-2.0.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on leftfield-geospatial/geedim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
geedim-2.0.0-py3-none-any.whl -
Subject digest:
a703c02440eee4802e1b366a40840be1a05387c9a85a4ab37642c93c7adfb477 - Sigstore transparency entry: 422551280
- Sigstore integration time:
-
Permalink:
leftfield-geospatial/geedim@7e5637f42e50a39f720b720bdb960dd191606964 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/leftfield-geospatial
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@7e5637f42e50a39f720b720bdb960dd191606964 -
Trigger Event:
release
-
Statement type: