Skip to main content

Evoland models and data loaders

Project description

Cloud Free Image Downloader

A small tool to download cloud free images from GEE. Also serves as an example that projects in the DLR MF-DAS organization should follow. You should copy the CI/CD set-up and other practices for your repository.

Installation

This tool relies on Google Earth Engine's Python API which cannot be installed automatically as a dependency. You need to install it from conda-forge in your conda environment:

conda install -c conda-forge earthengine-api

This is assuming you already have a conda environment activated. To install from source code you can do the following:

git clone git@github.com:DLR-MF-DAS/gee_downloader.git
cd gee_downloader
pip install -e .

Or if you don't want the source code you can do:

pip install git+git@github.com:DLR-MF-DAS/gee_downloader.git

Usage

Authenticate to Google Earth Engine (note that authentication mode should be set to notebook)

earthengine authenticate --auth_mode notebook

Then you can run the script by executing the module with the -m flag.

python3 -m gee_downloader --help

Which will tell you what the options for the script are.

Usage: python -m gee_downloader [OPTIONS]

Options:
  -i, --geojson TEXT      Area of interest in the GeoJSON format  [required]
  -s, --start-date TEXT   Starting date for the composite (yyyy-mm-dd)
                          [required]
  -e, --end-date TEXT     End date for the composite (yyyy-mm-dd)  [required]
  -o, --output-file TEXT  File to write the results to  [required]
  --help                  Show this message and exit.

For designing command line interfaces I recomment the click library for Python - https://click.palletsprojects.com/. The implementation of the script can be found under src/gee_downloader/__main__.py. Please consider following this structure if your project requires you to provide an executable script.

To download some actual data you can try the following arguments from inside the repository file structure of this project.

python3 -m gee_downloader -i test/munich.json -s 2019-01-01 -e 2019-04-01 --output-file test.tiff

Which should result in a 13 band image part of which looks like this.

munich

CI/CD Setup

Testing

For testing you should use https://docs.pytest.org/. The GitHub Actions workflow file that runs the tests is located under gee_downloader/.github/workflows/python-app.yml. Use it and the tests under the test/ subdirectory as an example for your own projects.

Documentation

The documentation for this library is automatically built and uploaded to GitHub Pages on each commit. The workflow responsible for this is defined at gee_downloader/.github/workflows/pdoc.yml. I prefer to use pdoc for documentation building (over sphinx which is in my view an outdated abomination) but if you prefer to use something more complex the idea behind building and publishing it stays the same.

You can find the documentation here: https://dlr-mf-das.github.io/gee_downloader/

Publishing

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

gee_downloader-0.0.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

gee_downloader-0.0.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file gee_downloader-0.0.1.tar.gz.

File metadata

  • Download URL: gee_downloader-0.0.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for gee_downloader-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d703a229a87a4a56b4cb6379992850ca3a284755bc067603ddafeb7498730978
MD5 ff40b69f7bea54c84cba841b7d17a40a
BLAKE2b-256 9a80e37ee5c566d6a7de2ae6c5f11a337eef7f802fb46730e8505b3d2841863e

See more details on using hashes here.

File details

Details for the file gee_downloader-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for gee_downloader-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9d4cec83e96b236fded6a5ecfd45aef90b36b0dc237c4ae61edac8550c226566
MD5 d0e33eddda4fe12bb94e902428582b1f
BLAKE2b-256 5b70664f65c953f738a5d6b291e04eaf2bccfc3496bef70a257f6566eb269ae6

See more details on using hashes here.

Supported by

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