Introduction to Google Earth Engine
Introduction:
Google Earth Engine is a cloud-based platform for planetary-scale environmental data analysis. It combines a multi-petabyte catalog of satellite imagery and geospatial datasets with computational capabilities to analyze and extract insights. In this blog, we will explore how to use Google Earth Engine, access its data, what types of analysis are possible, and how to produce composite images and measure deforestation.
Part I: Getting Started with Google Earth Engine
1.1: Setting Up
To begin, you will need to sign up for a Google Earth Engine account. Once approved, you can access the Code Editor at https://code.earthengine.google.com/.
1.2: Navigating the Interface
The Google Earth Engine Code Editor is divided into several panels:
- Scripts panel: where you can create, save, and manage your scripts.
- Code Editor panel: where you enter JavaScript code.
- Map panel: where results are displayed.
- Inspector panel: to query map results.
Part II: Accessing Data
2.1: Image and ImageCollection
In Google Earth Engine, raster data are represented as Image
objects. A collection of images is an ImageCollection
. You can access satellite imagery and other raster datasets from the Earth Engine Data Catalog.
2.2: Example - Accessing Landsat Imagery
var image = ee.Image('LANDSAT/LC08/C01/T1_TOA/LC08_044034_20140318');
Map.addLayer(image, {bands: ['B4', 'B3', 'B2'], max: 0.3}, 'true color image');
Part III: Types of Analysis
3.1: Basic Operations
You can perform arithmetic operations on images, compute spectral indices, and extract statistics.
3.2: Example - NDVI Calculation
var ndvi = image.normalizedDifference(['B5', 'B4']);
Map.addLayer(ndvi, {min: 0, max: 1, palette: ['white', 'green']}, 'NDVI');
Part IV: Creating Composite Images
Creating a composite image involves combining several images into one. In the context of Google Earth Engine, you can create a composite image from an ImageCollection
.
4.1: Example - Median Composite
var collection = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA')
.filterDate('2019-01-01', '2019-12-31');
var composite = collection.median();
Map.addLayer(composite, {bands: ['B4', 'B3', 'B2'], max: 0.3}, 'composite image');
Part V: Measuring Deforestation with Google Earth Engine
Google Earth Engine can be used to monitor and measure deforestation. You can compute the difference between two images or track changes over time.
5.1: Example - Difference in NDVI
var image1 = ee.Image('LANDSAT/LC08/C01/T1_TOA/LC08_044034_20140101');
var image2 = ee.Image('LANDSAT/LC08/C01/T1_TOA/LC08_044034_20141231');
var ndvi1 = image1.normalizedDifference(['B5', 'B4']);
var ndvi2 = image2.normalizedDifference(['B5', 'B4']);
var difference = ndvi2.subtract(ndvi1);
Map.addLayer(difference, {min: -1, max: 1, palette: ['blue', 'white', 'green
']}, 'NDVI difference');
Conclusion:
Google Earth Engine is a powerful platform for large-scale geospatial data analysis. It provides an accessible interface for both accessing vast amounts of data and applying complex analyses to generate meaningful insights. As we’ve seen in the blog, it can be used to monitor and measure environmental phenomena such as deforestation. While we’ve only scratched the surface, I encourage you to explore the platform further, as the range of applications is vast.