Getting started with Google Earth Engine


Google Earth Engine (GEE) is a free resource for conducting spatial analyses!

I use Google Earth Engine on an almost daily basis in my research. Whether you are at an exploratory stage or finalizing your analyses, GEE can help you accomplish powerful research quickly and accessibly. Some of the benefits of using GEE are:

  • GEE allows all of your computations to happen on Google's servers (instead of your own machine)
  • GEE hosts tons of large datasets which can be hard to access independently
  • GEE is a great way to store and share datasets that you generate (especially those that cover a large spatial extent and take up a lot of memory)
  • GEE can be used from whatever coding environment you are most comfortable with, such as Python, R, and Java

Some examples of GEE usage (and data sharing) from friends of mine include my recent paper in Nature, where all of the analysis took place in GEE. Check out the GitHub site for the paper where we share all of the GEE resources needed to reproduce our research, including interactive maps! (See my tutorial for how to make and host your own interactive maps).Dr. K. Dana Chadwick, currently at NASA's JPL, also has a great example of GEE data distribution with her site representing research she did as a post-doc working on vegetation trait mapping. The files necessary to visualize this data can be as large as 16 GB, so being able to easily distribute her work on GEE, for example with this asset here, allows her research to be super accessible!

Here you will find a GoogleColab introduction to the basics of GEE as well as a video recording that walks through the Colab document. For other GEE resources, check out:

Follow along with the video in the code!

Watershed analyses using Google Earth Engine

Here we use Google Earth Engine (GEE) to access, download, and plot data corresponding to USGS gauged watersheds. All you need to run this code is an 8-digit code corresponding to the gauged watershed of your choice! This colab is well documented, however if you are new to GEE, check out the "Getting Started with Google Earth Engine" post!

In this notebook, you will learn how to extract and plot the following data for any USGS gauged watershed:

  • Set up GEE with Google Drive integration and install packages
  • Extract USGS discharge timeseries and convert units
  • Extract PRISM daily precipitation and Penman Monteith Leunig (PML) evapotranspiration timeseries using the geemap package
  • Use PRISM temperature to calaculate potential evapotranspiration (PET) timeseries using the Hargreaves and Samani (1985) equation
  • Plot the watershed water balance
  • Calculate and plot the flood frequency curve

Talking about widespread use of bedrock water by woody vegetation

<

Watch my presentation at UT's "Water, Climate, and Energy" seminar last month, where I describe the motivation and results behind our recent paper, published in Nature in September. You can read more about that project, as well as access the resulting data, here.

How to extract timeseries with GEE

Google Earth Engine hosts an unbelievable amount of data, stored as 'assets,' which can take the form of Images (essentially a single raster), ImageCollections (a stack of rasters representing multiple timesteps, most typically), or Features (vectors). However, because every asset is likely formatted in a slightly unique way, extracting GEE data for a point, watershed, or other geometry can sometimes be challenging. Here I will walk through two ways to extract various evapotranspiration datasetes:

  1. Using the geemap package, with excess code used to format extracted data into neat Pandas dataframe format written out in full
  2. Using a "manual" method pioneered by David Dralle of the USDA Forest Service and Jesse Hahm of Simon Fraser University

For a more concise application of the geemap method, including the creation of asset-specific extraction functions, see my other tutorial on watershed analyses using GEE.

For a basic introduction to GEE, see the tutorial here!