A Brief Foray into Google Earth Engine: Calculate NDVI from the Cloud

Google Earth Engine (GEE) is a cloud-based platform for planetary-scale environmental data analysis which uses a JavaScript API and an online IDE code editor. In short, you can utilize remotely sensed imagery available in Google’s cloud to run analyses without downloaded the data to your local machine. You’ll need to sign up as a developer to gain access here.

Below is an example from an upcoming lecture to the Anthropology and Geography group of the Social Sciences Department at Cal Poly University. In my talk I showed an example of the Normalized Difference Vegetation Index for Cal Poly’s campus. Here I’ll demonstrate the workflow I used to create NDVI using GEE with data from the cloud.

To execute the example below, please download the campus shapefile here (originally obtained from the campus website). You’ll need to upload the shapefile into GEE using these instructions (see the “Uploading table assets” section) and load the data into your script using these instructions (see the “Importing assets to your script” section). If you’d like to run the example without downloading campus data, skip to the second code block below.

Copy and paste the following code into the Code Editor of GEE:

NDVI derived from color-infrared aerial photos for Cal Poly’s campus. The code block above will produce this image in Google Earth Engine. Dark green pixels indicate high values of NDVI; orange/red pixels indicate low values; grey pixels indicate a mask (values below -0.25).

The code below does not require download of any campus data; however, it will calculate NDVI over the entire extent as opposed to the campus extent in the example above. Copy and paste the following code into the Code Editor of GEE:



Leave a Reply

Your email address will not be published. Required fields are marked *