An Introduction to Geospatial Analysis Using the Google Earth Engine Platform
TC Chakraborty
&
Sabrina Szeto
Nov 13, 2018
https://github.com/TC25/Geospatial_workshop_EE
https://signup.earthengine.google.com
Collection, visualization, and analysis of geographical or spatial data.
-
Vector data represent lat-long coordinates
-
Raster data comprises of pixels with associated values
- Points
- Lines
- Polygons
- Raster layers/bands
- Cloud-based platform for planetary scale geospatial analysis
- Uses Google's computational resources to reduce processing time
- Massive archive of remote sensing data
- 200 public datasets
- greater than 4000 new images every day
- greater than 5 million images
- greater than 5 petabytes of data
Source: Google Earth Engine User summit
var varname = Containerforvariabletype(variable name);
Map.setCenter(long, lat, zoom level);
Zoom level varies from 0 (no zoom) to 20 (highest zoom level)
print(variable name)
Map.addLayer(VARIABLENAME);
var var_String = ee.String("This is a string. Or is it? It is.");
var var_Numbers = ee.Number(5);
var var_Array = ee.Array([[5, 2, 3], [-2, 7, 10], [6, 6, 9]]);
var var_List = ee.List([5, "five" , 6, "six"]);
var var_Dictionary = ee.Dictionary({five: 5 , six: 6});
- Geometries
- Features
- Feature Collections
- Images
- Image Collections
var var_Point = ee.Geometry.Point(0, 45);
var var_MultiPoint = ee.Geometry.MultiPoint(0, 45, 5,6, 70,-56);
var var_LineString = ee.Geometry.LineString([[0, 45], [5,6], [70,-56]]);
var var_MultiLineString = ee.Geometry.MultiLineString([[[0, 45], [5,6], [70,-56]], [[0, -45], [-5,-6], [-70,56]]]);
var var_LinearRing = ee.Geometry.LinearRing(0, 45, 5,6, 70,-56, 0,45);
var var_Rectangle = ee.Geometry.Rectangle(0, 0, 60,30);
var var_Polygon = ee.Geometry.Polygon([[[0, 0], [6,3], [5, 5], [-30,2], [0,0]]]);
var var_MultiPolygon = ee.Geometry.MultiPolygon([ee.Geometry.Polygon([[0, 0], [6, 3], [5, 5], [-30, 2], [0,0]]), ee.Geometry.Polygon([[0, 0], [-6, -3], [-5, -5], [30, -2], [0, 0]])]);
- Features are geometries associated with specific properties
- Feature Collections are groups of features
- A set of instructions to perform a specific task
function function_Name(Arguments) {statements};
var result = function_Name(Input);
var result = Input.map(function_Name);
var Geometry_area = var_Geometry.area();
var Line_length = var_LineString.length();
var Geometry_perimeter = var_Geometry.perimeter();
var SimplifiedGeometry = var_Geometry.simplify(100);
var Centroid = var_Geometry.centroid();
var Buffer = var_Geometry.buffer(100);
var BoundedGeometry = var_Geometry.bounds();
var Convexhull_Geometry = var_Geometry.convexHull();
var Inter_geometry = var_Geometry1.intersection(var_Geometry2);
var Union_geometry = var_Geometry1.union(var_Geometry2);
var var_Feature = ee.Feature(var_Geometry, {Name: "Feature name", Size: 500};
var var_Featurenew = var_Feature.select(["Name"], ["Descriptor"]);
var values = var_Feature.get(''Size'');
var BFilter = ee.Filter.eq(Property_name, Value);
or .neq , .gt , .gte , .lt , and .lte
var DiffFilter = ee.Filter.maxDifference(threshold, Property_name, Value);
var TxtFilter = ee.Filter.stringContains( Property_name, StringValue);
or .stringStartsWith, and .stringEndsWith
var RangeFilter = ee.Filter.rangeContains( Property_name, StringValue, MinValue, MaxValue);
var ListFilter = ee.Filter.listContains(Property_name, Value1, Property_name2, Value2);
.inList to test against list of values
var DateFilter = ee.Filter.calendarRange(StartDate, StopDate);
var DayFilter = ee.Filter.dayOfYear(startDay, StopDay);
var BoundsFilter= ee.Filter.bounds(GeometryorFeature);
var NewFilter=ee.Filter.and(Listoffilters);
var NewFilter=ee.Filter.or(Listoffilters);
var inverseFilter = ee.Filter.not(filter);
var band = var_Image.select(band name);
var mask =var_Image.eq(value);
or .neq or .gt or .gte or .lt or .lte
var masked =var_Image.mask(mask);
var results =var_Image.sum(value);
or .subtract , .multiply , .divide , .max , .min , .abs , .round , .floor , .ceil , .sqrt , .exp, .log, .log10, .sin , .cos , .tan , .sinh , .cosh , .tanh , .acos, .asin
newImage = oldImage.leftShift(valueofshift);
or .rightShift
var outputDictionary = var_Image.reduceRegion(Reducer, var_Geometry, scale);
var SelectedImages =var_ImCollection.limit (n, Property_name, Order);
var SelectedImages = var_ImCollection.filterMetadata (Property_name, Relation , Value);
Relations could be "equals", "less_than", "greater_than", "starts_with", "ends_with", and "contains"
var SelectedImages = var_ImCollection.filterDate (StartDate, StopDate);
var SelectedImages = var_ImCollection.filterBounds (var_Geometry);
var sumofimages = var_ImCollection.sum();
or .product, .max, .min, .mean, .mode, .median, and .count
var mosaicofimages = var_ImCollection.mosaic();
Export.image.toDrive({
collection: var_Image, description: 'FileName', region: var_Geometry, scale: 1000}
});
or image.toCloudStorage, image.toAsset, table.toDrive, table.toCloudStorage, video.toCloudStorage, and video.toDrive
What can you do with Google Earth Engine?
Google Earth Engine API documentation
Google Earth Engine Developers forum
Example scripts from Prof. Dana Tomlin's handouts for his course on Geospatial Software Design