Skip to content

5 Awesome things about Google Earth Engine

This week I saw an excellent overview of Google Earth Engine

Google Earth Engine docs

I’ve previously written about Google Earth Engine here. If you want a basic guide, take a look.

It is worth repeating from my previous article, “You can sign up / request access here As long as you are using this non-commercially then no problem. I am using it non-commercially.” Again, everything I do and write here is non-commerical. So, 5 awesome things about Google Earth Engine.

1.It has its own interactive developer environment. Your very own Earth Observation Sandbox!

On the far left you have a window for Scripts, Docs (documentation) and Assets. Scripts is the place to access and save scripts you have written. Docs is for looking up developer information about running various methods and Assets is for uploading your own data. The top middle is the where the script is written/imported/adjusted, which includes a run button and a save button. The results of this are displayed in the top right of the console and visually displayed on the map at the bottom of the page (I’ve printed “hello world”). Make a slight change in the script (and assuming it runs ok) this will be displayed interactively below. You will receive instant feedback. You can zoom, pan etc; most of the standard things you would expect from a Google Maps App.

2. You don’t have to be a coding ninja to use Google Earth Engine!

The code editor displayed above runs JavaScript. You don’t need to know much about coding though to get up and running.

In fact there are 66 example scripts to choose from. So if you wanted to create an NDVI image using MODIS data then you can

The script is in “image – Normalized Difference” and will zoom in on Kanas City, but you can zoom out like I did and see the whole US and begin to appreciate the issues we have with clouds!

3. You can upload your own area of interest and display on the map!

First, create a kml file and upload to a fusion table. In this example I am using a simple polygon around the Isle of Wight. Navigate to Google Fusion Tables and step through the dialog


And finish; at this point you should be able to view your kml in the fusion table map

To get this into Google Earth Engine, “File – About this table” and copy everything next to id. This is your kml/fusion table data now and you will parse it in Google Earth Engine.

// Load a Fusion Table from the ID using the FeatureCollection constructor.
var fc = ee.FeatureCollection('ft:yourid');
// Display as default and with a custom color.
Map.addLayer(fc, {}, 'default display');
Map.addLayer(fc, {color: 'FF0000'}, 'coloured');

Copy and paste this id value into the script window (replace “yourid”) and click run and it will display – awesome!

Bonus bit… what would be more awesome if you could get, say, Elevation data just for this area? Can that be done? Yes! I going to use an example from this document

Add the world SRTM DEM: I am scaling it from 0m to 300m, then change this according to your topography

Now to clip it to your fusion table. It is one line of code and to better display this new image, I am commenting out the two other map.addlayer’s.

Here is the code:

Map.addLayer(elevation.clip(fc), {min:0, max:300, palette:['000000',"ffffff"]},"elevation2");

Unbelievably, 3 lines and super quick. That is awesome.

4. You can access huge temporal information at your fingers with image collections

Temporal imagery is awesome. Not too many years ago an Earth Observation person might be lucky to get 2 images of the same area and that allowed for some nice change detection mapping. Today though we have an ever increasing amount of data, and image collections make accessing this incredibly simple.

Let’s slightly adapt the script from the documentation and add a mean and a min variable. I am not going to bother with a max (why? Clouds).

// Load a Landsat 8 collection for a single path-row.
var collection = ee.ImageCollection('LANDSAT/LC8_L1T_TOA')
    .filter(ee.Filter.eq('WRS_PATH', 44))
    .filter(ee.Filter.eq('WRS_ROW', 34))
    .filterDate('2014-01-01', '2015-01-01');

// Compute a median image and display.
var median = collection.median();
var mean = collection.mean();
var min = collection.min();
Map.setCenter(-122.3578, 37.7726, 12);
Map.addLayer(median, {bands: ['B4', 'B3', 'B2'], max: 0.3}, 'median');
Map.addLayer(mean, {bands: ['B4', 'B3', 'B2'], max: 0.3}, 'mean');
Map.addLayer(min, {bands: ['B4', 'B3', 'B2'], max: 0.3}, 'min');

You can turn on and off the layers. Min is quite good, mean is washed out but median is great. Assuming your area is relatively stable (the filter here is for 1 year ‘2014-01-01’, ‘2015-01-01’) median ‘should’ give you a good image. There are so many cool things you can do with collections (create time lapse perhaps?). Get the basics here.

5. The maps are incredibly interactive!

You can create graphs and charts, (see point 2, which mentions the 66 example scripts of which 10 are charts and graphs). One of the great things about Google Earth Engine is that you can click on a point on the map window and the inspector window will tell you all about the layer you clicked on – just like a GIS. I have highlighted in black my code change (stretching the image) and the Inspector returning the mouse click values.

and here is the elevation histogram of Colorado:

Google Earth Engine is Awesome! And they hold a user conference every year and there is still time for 2017!