Skip to content

Description:

  • A petabyte scale platform for Earth Observation.

Resources:

Work with the Google Earth Engine (GEE) platform from Python.

Steps to get started:

  1. Use an existing or create a new google cloud project
  2. Enable access to GEE in your project or Sign up: https://code.earthengine.google.com/register
  3. Authenticate (For more information on authentication and step by step instructions, see authentication.ipynb)

This notebook reads these environment variables. Set them before you start Jupyter:

  • GOOGLE_CLOUD_PROJECT: the Google Cloud project id that has Earth Engine access.

Use MODIS data to select land cover per the criteria

import os
import ee
# Uses your saved Earth Engine credentials (`earthengine authenticate`), or else
# Application Default Credentials such as GOOGLE_APPLICATION_CREDENTIALS (see authentication.ipynb)
ee.Initialize(project=os.environ["GOOGLE_CLOUD_PROJECT"])
elev = ee.Image('CGIAR/SRTM90_V4')
cover = ee.Image('MODIS/051/MCD12Q1/2001_01_01').select('Land_Cover_Type_1')
blank = ee.Image(0)
# Where (1 <= cover <= 4) and (elev > 1000), set the output to 1.
output = blank.where(
cover.lte(4).And(cover.gte(1)).And(elev.gt(1000)),
1)
# Output contains 0s and 1s. Mask it with itself to get rid of the 0s.
result = output.mask(output)

ganymede is made by Eugo