Integrating Earth Engine into other Tools

Dave Thau
Manager of Developer Relations, Earth Engine and Earth Outreach

Overview

Footnote

  • More fun with the Earth Engine GUI
  • Uploading and training with your vector data
  • Uploading imagery with Maps Engine
  • Exporting images, tables, and video
  • Viewing data in external tools

Earth Engine GUI and Using Classified Images and Expressions

Earth Engine Graphical User Interface

Footnote

Goal: Make a map of all the forests in Bolivia above 500 meters

  • Make a map of the forests of Bolivia with pre-classified images
  • Add in elevation data
  • Create an expression that selects just forest above 500m
  • Style it a bit

Add data

Choose hand-drawn

points and polygons

Add some classes

Select a year

Assign some classes

Add SRTM

elevation data

Stretch it

Add computation

Choose expression

1.

2.

3.

4.

5.

Add computation

Then choose Apply Mask

Uploading and Using Vector Data

Rules for Using your Own Vector Data

Vectors are stored in Fusion Tables

(http://google.com/fusiontables)

The Fusion Table must:

1. Have only one geometry column and it

must contain KML

2. Have a column that contains numerical

classes

Example Fusion Table

http://goo.gl/awFGW

When you go there, you'll see a long URL

ending with:

docid=1tea2P3w7TA7a_g6oq75nzwi8ykgSS1uJpfQM5Ps

Table View

Map View

Importing Fusion Tables into Earth Engine

Add data then choose Fusion Table

Importing Fusion Tables into Earth Engine

Click on Fusion Table Layer

Importing Fusion Tables into Earth Engine

Paste the docid

then Load table

Importing Fusion Tables into Earth Engine

Choose your class column

then Load classes

Importing Fusion Tables into Earth Engine

Assign Fusion Tables classes

to your classification classes

Then save

Importing Fusion Tables into Earth Engine

Change names

by clicking on

the names

Change colors

by clicking on

the swatches

Multiple ways to make a Fusion Table.

#1: Use Google Earth

Add Placemarks and Polygons, set the class number here

Multiple ways to make a Fusion Table.

#1: Use Google Earth – Save KML

Right click where you saved your points – save Place as KML

Multiple ways to make a Fusion Table.

#2: Shape Escape

http://www.shpescape.com

Multiple ways to make a Fusion Table.

#3: ogr2ogr

ogr2ogr –f KML to.kml from.shp

Generally part of GDAL:

http://www.gdal.org/ogr2ogr.html

Multiple ways to make a Fusion Table.

#4: Text File for Import into FT

  • Create a tab delimited File
  • Each row is a point
  • The first column is the class number
  • The second is the location:
  • <Point><coordinates>lon,lat,altitude</coordinates></Point>

Uploading and Using Raster Data

Uploading Rasters for Earth Engine via Maps Engine

Click on the up arrow and choose Upload source files

Go to your Maps Engine account:

http://mapsengine.google.com

Uploading Rasters for Earth Engine via Maps Engine

Choose Image

Browse to find the Image

Then Upload

Uploading Rasters for Earth Engine via Maps Engine

After some time, your image will be processed and you'll be

able to click the link icon

Uploading Rasters for Earth Engine via Maps Engine

Click on the link icon and copy the Earth Engine ID

Uploading Rasters for Earth Engine via Maps Engine

Paste the id

into the Earth

Engine search

bar

Uploading Rasters for Earth Engine via Maps Engine

The search result

will appear here.

Click on it and it will

appear as a data layer.

Paste the id

into the Earth

Engine search

bar

Viewing Downloaded Images with QGIS

  • Most image tools won't understand Earth Engine data

  • QGIS is open source RS/GIS tool:
    • http://www.qgis.org/

  • Opening multiband images can be tricky.

Downloading Details

Select input

and output files

Click layer stack

Load into canvas

Not quite right

Click on Image - Layer > Properties

Rearrange Bands

Exporting Images, Tables, and Videos

Exporting Images

Footnote

// Load a Landsat image and select three bands.

var landsat = ee.Image('LANDSAT/LC8_L1T_TOA/LC81230322014135LGN00') .select(['B4', 'B3', 'B2']);

// Create a geometry representing an export region.

var geometry = ee.Geometry.Rectangle([116.3491, 39.9572, 116.4325, 40.0123]);

// Convert the geometry to a JSON string used as an argument to Export.

var jsonCoordString = geometry.toGeoJSON();

// Export the image, specifying scale and region.

Export.image(landsat, 'exportImageExample', {

scale: 30,

region: jsonCoordString

});

Exporting Tables

Footnote

var image = ee.Image('LANDSAT/LC8_L1T_TOA/LC80440342014077LGN00');

var region = ee.Geometry.Rectangle([-122.2806, 37.1209, -122.0554, 37.2413]);

// Get a dictionary of means in the region.

var means = image.reduceRegion({

reducer: ee.Reducer.mean(),

geometry: region,

scale: 30

});

// Make a feature without geometry and set the properties to the dictionary of means.

var feature = ee.Feature(null, means);

// Wrap the Feature in a FeatureCollection for export.

var featureCollection = ee.FeatureCollection([feature]);

// Export the FeatureCollection.

Export.table(featureCollection, 'exportTableExample', {fileFormat: 'CSV'});

Exporting Video

var collection = ee.ImageCollection('LANDSAT/LT5_L1T_TOA')

.filterMetadata('WRS_PATH', 'equals', 44) .filterMetadata('WRS_ROW', 'equals', 34)

.filterMetadata('CLOUD_COVER', 'less_than', 30) .filterDate('1991-01-01', '2011-12-30')

.select(['B4', 'B3', 'B2'])

.map(function(image) {

return image.multiply(512).uint8();

});

var polygon = ee.Geometry.Rectangle([-122.7286, 37.6325, -122.0241, 37.9592]);

// Export (change dimensions or scale for higher quality).

Export.video(collection, 'sf_example_video', {

dimensions: '720',

framesPerSecond: 12,

region: polygon.toGeoJSON()

});

  • Earth Engine Graphical User Interface
  • Uploading and training with your own vector data
  • Uploading your own raster data
  • Viewing in QGIS
  • Exporting images, tables, and videos

50

Recap : Integrating Earth Engine...

Thank you

UC Berkeley GIF 2015: Integrating Earth Engine and other Tools - Google Slides