1 of 10

EE 104: Introduction to the Earth Engine Python API

Madhu Mysore

2 of 10

Using the Python API

WHY?

HOW?

3 of 10

WHY use the EE Python API?

Geospatial�Datasets

Algorithmic�Primitives

add

focal_min

filter

reduce

join

distance

mosaic

convolve

Storage & Compute

Google Earth Engine Platform

Requests

Results

4 of 10

Default Portal to the Platform: EE Code Editor

EE JavaScript API

5 of 10

EE Python API

Google Colab Notebook

Jupyter Notebook / Lab

RStudio Notebook

<<Your Favourite Python IDE here>>

6 of 10

So, here is another way (via Jupyter Notebook)

7 of 10

And another way… (via Google Colab Notebooks)

8 of 10

And another… (via RStudio)

9 of 10

The trade-offs

JavaScript API

Advantages

  • Simple, Integrated, Powerful
  • Easy to share scripts

Disadvantages

  • Limited I/O functionality
  • Limited customisation of development environment

Python API

Advantnges

  • Powerful
  • Extensive customisation options
  • Easy to share scripts
  • Vast I/O options

Disadvantages

  • Requires assembly and maintenance!

10 of 10

HOW to get started with the EE Python API

  • Starter Google Colab Notebook (Link)
    • Save a copy in your own Google Drive before trying to run
    • Be sure you are logged into the same Google account with which you are signed up to GEE

  • Starter R Notebook (Link)
    • Ensure that you have a properly working Python environment in which earthengine-api is installed, and that the authentication token is generated and saved locally (link to documentation)
    • In the Python code chunks, replace path with path to your own local Python environment
    • To access Python objects from within R (and vice versa), please install the reticulate R package