Part 1 Primer: Google Earth Engine for Tethys Developers

Last Updated: January 2023

This tutorial provides links to Google Earth Engine tutorials and resources that can be used to learn what you need to know for this Tethys tutorial. This is by no means exhaustive and we encourage you familiarize yourself with everything Google Earth Engine has to offer by visiting their documentation: https://developers.google.com/earth-engine/. You will need an active Google Earth Engine account to complete this tutorial.

1. What is Google Earth Engine?

Review the Google Earth Engine Introduction.

2. Google Earth Engine JavaScript API

As a Tethys Developer, you will likely use the the Python API more often than the JavaScript API. However, there are not as many examples or documentation for Python. We recommend becoming familiar with the JavaScript examples and then learning how to convert any JavaScript example into the Python equivalent.

Complete the Get Started guide.

3. Google Earth Engine Python API

Complete the Python Installation - Colab Notebook guide

4. Convert JavaScript Example to Python

  1. Review the following syntax differences between the JavaScript and Python APIs: JavaScript-Python Syntax Comparison

  2. Choose an example from the Scripts tab of the Code Editor and convert it into Python in the Colab editor using the guidelines from the article above.

5. Create a Google Earth Engine Conda Environment

Create a new Conda environment with Google Earth Engine installed:

bash
conda create --name ee
conda activate ee
conda install -c conda-forge earthengine-api

6. Authenticate with Google Earth Engine

Before you can use Google Earth Engine in your Tethys Development or in a Jupyter Notebook, you'll need to do a one-time authentication using the command line tool:

bash
earthengine authenticate

Note

The Google Earth Engine command line tool is installed when you install the conda package.

A URL will be provided that generates an authorization code upon agreement. Copy the authorization code and enter it as command line input. This will save a token to a credentials file in the following location:

bash
ls $HOME/.config/earthengine/credentials

7. Review GEE Key Concepts

Reference