Skip to content

Latest commit

 

History

History
67 lines (44 loc) · 2.79 KB

README.md

File metadata and controls

67 lines (44 loc) · 2.79 KB

Earth Engine Imagery Downloader

The code in this repository takes an object-oriented approach to retrieving, filtering, exploring, and exporting imagery from Google Earth Engine. Since the workflow to do this in a one-off sense (e.g. for a specific region, date range, collection, and set of filters) is fairly quick and simple to implement in the Earth Engine Code Editor, this codebase is designed to handle slightly more involved imagery acquisition needs.

Key use cases include:

  1. Configure (and save) multiple regions of interest, each with different image collections and filters
  2. Fetch imagery for multiple discrete date ranges at once (e.g. get imagery for same months over different seasons)
  3. Access various groups of filtered imagery simultaneously - e.g. retrieve HH/HV and VV SAR imagery at the same time, but give each a handle to interact with individually.

Nearly all functionality is defined in the eeImageryInterface class and associated utils.py.

Setup

  1. Install miniconda if not already installed

  2. Restore conda environment from environment.yml: conda env create -f environment.yml. Activate the conda environment.

  3. Install this code as a package: pip install -e . (include the '.')

  4. Initialize earthengine-api: run earthengine authenticate. Sign into the Google account whose Google Drive storage you would like to use for image exporting (see Workflow step 3).

Workflow

All code is in ./ee_imagery_downloader.

1. Configure Regions of Interest, Image Collections, and Image Filtering

Start with config/roi_configs.py and config/collection_filters.py.

2. Explore Configured Imagery in a GEE-Interfacing Notebook

See notebooks/browse_ee_imagery_example.ipynb.

Keep in mind that while some eeImageryInterface methods accept date ranges to return imagery for (e.g. a subset of images in a season for visualization), the imagery that has been filtered, loaded and made available to the client-side class instance is defined by the roi configuration.

3. Export Loaded Imagery to Google Drive

Exporting via Google Drive is necessary for files larger than 32MB. If your imagery is smaller than that, see Image.getDownloadURL.

Navigate to and run scripts/export_imagery.py. To see available arguments:

export_imagery.py --help

4. Download Exported Imagery Using the Drive API

Once imagery is exported to Google Drive, you could download it manually. However, if you have a lot of images, this sucks. Instead, you can try setting up & using a script that leverages the Google Drive API to do this automatically. It requires a few steps of Google-y setup, but once it works, it's pretty magical.

See scripts/download_drive_files.md.