Skip to main content

Pulls data from Google Earth Engine, syncs it to Google Drive, and downloads files.

Project description

Project Summary

Earth-Engine-Wildfire-Data is a Python command-line utility and library for extracting and transforming wildfire-related geospatial data from Google Earth Engine. It supports:

  • Access to MODIS, VIIRS, GRIDMET, and other remote sensing datasets.

  • Filtering wildfire perimeters by date, size, and region.

  • Combining daily and final fire perimeters.

  • Generating YAML config files for use in simulation or prediction tools.

  • Command-line configurability with persistent YAML-based settings.

  • This tool is intended for researchers, data scientists, or modelers working with wildfire data pipelines, particularly those interested in integrating Earth Engine datasets into geospatial ML workflows.

Prerequisite

Requires at least python 3.10.

As of mid-2023, Google Earth Engine access must be linked to a Google Cloud Project, even for free/non-commercial usage. So sign up for a non-commercial earth engine account.

🔐 Google API Setup Instructions

To run this project with Google Earth Engine and Google Drive access, follow the steps below to create and configure your credentials.


1. ✅ Create a Service Account

In the Google Cloud Console, do the following:

  • Go to IAM & Admin → Service Accounts → Create Service Account
  • Assign the following roles to the Service Account:
    • Owner
    • Service Usage Admin
    • Service Usage Consumer
    • Storage Admin
    • Storage Object Creator

2. 🔑 Assign Roles to Your Personal Account

Make sure your main Google Cloud account (the one you'll log in with) has these roles:

  • Owner
  • Service Usage Admin
  • Service Usage Consumer

3. 🧭 Create OAuth Credentials (for Google Drive Access)

Still in the Google Cloud Console:

  • Go to APIs & Services → Credentials → + Create Credentials → OAuth Client ID
  • If prompted, configure the OAuth consent screen:
    • Choose Desktop App
    • Provide a name (e.g., "Drive Access")
  • Once created:
    • Download the JSON file (this is your OAuth credentials)
    • Save the client_id and client_secret (you’ll use these in your config)

4. 🚀 Enable Required APIs

In the left-hand menu:

  • Go to APIs & Services → Library
  • Enable the following APIs:
    • Google Drive API
    • Google Earth Engine API

5. 👤 Add Test Users (Required for OAuth)

  • Go to APIs & Services → OAuth consent screen
  • Scroll to the Test Users section
  • Click + Add Users and add your personal Google account (the one you'll use for authentication)

Install Instructions

For the stable build:

pip install ee-wildfire

For the experimental build:

git clone git@github.com:KylesCorner/Earth-Engine-Wildfire-Data.git
cd Earth-Engine-Wildfire-Data
pip install -e .

Configuration

There are two ways to configure this tool; you can use command line arguments to alter the internal YAML file, or you can input your own YAML. Here's a template:

year: '2020'
min_size: 10000000
project_id: YOUR_PROJECT_ID
geojson_dir: /home/kyle/NRML/data/perims/
output: /home/kyle/NRML/data/tiff/2020/
drive_dir: EarthEngine_WildfireSpreadTS_2020
credentials: /home/kyle/NRML/OAuth/credentials.json
download: false
export: false
show_config: true
force_new_geojson: false
sync_year: true

Command-Line Interface (CLI)

This tool can be run from the command line to generate fire configuration YAML files from GeoJSON data. Configuration can be passed directly via flags or through a YAML file using --config.

Argument Type Description
--config str Path to a YAML configuration file. Defaults to ./config_options.yml.
--year str The year of the fire events to process.
--min-size float Minimum fire size (in square meters) to include.
--output str Local directory to store generated TIFF files.
--drive-dir str Google Drive directory where TIFFs are uploaded or downloaded from.
--credentials str Path to the Google OAuth2 credentials JSON file. Required for GEE export.
--geojson-dir str Path to the input or output directory for GeoJSON files containing fire perimeter data.
--download flag If set, the tool will download TIFF files from Google Drive.
--export flag If set, data will be exported to Google Drive using Earth Engine.
--show-config flag Print the currently loaded configuration and exit. Useful for debugging.
--force-new-geojson flag Force the script to generate a new GeoJSON file even if one exists.
--sync-year flag Have all config and output files sync to the year in the config.
--version flag Outputs current program version.
--project-id str Your Google project ID

Basic Usage

ee-wildfire --config ./config_options.yml --year 2020 --geojson data/perims/ --sync-year

Acknowledgements

This project builds on work from the WildfireSpreadTSCreateDataset. Credit to original authors for providing data, methods, and insights.

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

ee_wildfire-2025.1.2.tar.gz (120.5 kB view details)

Uploaded Source

Built Distribution

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

ee_wildfire-2025.1.2-py3-none-any.whl (125.2 kB view details)

Uploaded Python 3

File details

Details for the file ee_wildfire-2025.1.2.tar.gz.

File metadata

  • Download URL: ee_wildfire-2025.1.2.tar.gz
  • Upload date:
  • Size: 120.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for ee_wildfire-2025.1.2.tar.gz
Algorithm Hash digest
SHA256 33124efe751db10b22b516ae963eca076db333d4c5e698691ac0bf9b3130ab02
MD5 1c988b71e00668df453426ef62da256e
BLAKE2b-256 bf145cdb110d8debcf12cff2ba9ce0ffa4d1953846fdfa87553765c2f490a378

See more details on using hashes here.

File details

Details for the file ee_wildfire-2025.1.2-py3-none-any.whl.

File metadata

  • Download URL: ee_wildfire-2025.1.2-py3-none-any.whl
  • Upload date:
  • Size: 125.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for ee_wildfire-2025.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7f71ee8a2eab048b73bc4a632e7ea8ac74ff06dfc79772a4f1817c610b16a119
MD5 ae68b445ac9feae09d1f17d06254c47f
BLAKE2b-256 b18bab61053e4ec6a8c5eefaa1115492803317fe1949ec05f1bebbab4c18dc74

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