Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Google Earth Engine fundamentals and potential

Google Earth Engine (GEE) is a cloud-based platform for geospatial analysis. It provides access to large satellite image archives, environmental datasets, and tools for processing data directly in the cloud.

For ecology and forest management, GEE is useful because it allows users to explore spatial patterns, build time series, calculate spectral indices, summarize raster values, and export results without downloading large image collections locally.

This section introduces the basic objects and operations that appear throughout the hands-on activities.

Core Earth Engine objects

Image

An ee.Image is a raster dataset. It can contain one band or many bands.

For example, SRTM elevation is loaded as a single image:

var srtm = ee.Image("USGS/SRTMGL1_003");

An image can represent elevation, reflectance, NDVI, NBR, classification results, or disturbance year.

ImageCollection

An ee.ImageCollection is a set of images. Many satellite datasets are stored as image collections because they contain repeated observations through time.

var s2 = ee.ImageCollection("COPERNICUS/S2_SR_HARMONIZED");

For example, a Sentinel-2 image collection contains many images acquired on different dates. We can filter the collection by location, date, cloud cover, and other properties.

Geometry

A geometry defines a spatial object such as a point, line, or polygon.

var point = ee.Geometry.Point([-79.3, 48.45]);

In this workshop, geometries are used to define the region of interest, select pixels, clip rasters, and summarize values.

Feature and FeatureCollection

A feature is a geometry with attributes. A feature collection is a set of features.

var waterbody = ee.FeatureCollection(
  "projects/naveenv/assets/cef2026/waterbody_ferld"
);

Feature collections can represent waterbodies, forest inventory polygons, training samples, roads, plots, or management units.

Common operations

Filter by region

.filterBounds(roi)

This keeps images that intersect the region of interest.

For example, if the ROI is around Forêt Duparquet, .filterBounds(roi) keeps only images that overlap that area.

Filter by date

.filterDate("2023-01-01", "2023-12-31")

This keeps images acquired within a specific date range.

Date filters are essential for phenology, annual composites, disturbance detection, and before-after comparisons.

Select bands

var nir = image.select("B8");

Band selection keeps only the bands needed for analysis. For example, NDVI requires near-infrared and red bands, while NBR requires near-infrared and shortwave-infrared bands.

Calculate an index

var ndvi = image.normalizedDifference(["B8", "B4"]).rename("NDVI");

Spectral indices combine bands to highlight vegetation condition, moisture, disturbance, or other surface properties.

Map a function over a collection

var withNDVI = s2.map(function(image) {
  var ndvi = image.normalizedDifference(["B8", "B4"]).rename("NDVI");
  return image.addBands(ndvi);
});

.map() applies the same function to every image in an image collection.

In this example, NDVI is calculated for every Sentinel-2 image.

Reduce values

Reducers summarize many values into fewer values.

var stats = image.reduceRegion({
  reducer: ee.Reducer.mean(),
  geometry: roi,
  scale: 30
});

This example calculates the mean value of an image inside the ROI.

Common reducers include:

ee.Reducer.mean()
ee.Reducer.minMax()
ee.Reducer.sum()
ee.Reducer.stdDev()
ee.Reducer.count()

Reducers are used to summarize elevation, calculate mean NDVI, estimate disturbed area, and assess classification results.

Display a layer

Map.addLayer(image, visParams, "Layer name");

Map.addLayer() displays data in the Earth Engine Code Editor map. Visualization parameters control the displayed colors and value range.

Displaying a layer does not export or save the result. It only shows the data on the map.

Export a result

Export.image.toDrive({
  image: image,
  description: "export_name",
  folder: "GEE_exports",
  region: roi,
  scale: 30,
  maxPixels: 1e13
});

Exporting creates a task that saves a raster result to Google Drive. Exports are useful when you want to use the result in QGIS, ArcGIS, R, Python, or another workflow.

Client-side and server-side thinking

Most Earth Engine objects are server-side objects. This means they describe a computation that will be sent to Google’s servers, rather than a value stored directly in your browser. For more details, see the Earth Engine documentation on client-side and server-side objects

The key rule is:

Use Earth Engine methods for Earth Engine objects.

For example, an ee.Number is not the same as a normal JavaScript number. An ee.ImageCollection is not the same as a normal JavaScript list.

This is why direct JavaScript operations sometimes fail on Earth Engine objects. When working with Earth Engine objects, use Earth Engine functions such as .map(), .filterDate(), .filterBounds(), .select(), .addBands(), and .reduceRegion().

Lazy evaluation

Earth Engine uses lazy evaluation. This means it does not immediately run every operation when a line of code is written.

Instead, the script builds a processing plan. Earth Engine executes that plan when a result is requested, such as when you display a layer, print a value, create a chart, or start an export.

This makes it possible to describe large computations without downloading or processing everything locally.

Why system:time_start matters

Time series charts need a date for each image. Earth Engine usually stores that date in the system:time_start property.

For derived composites, such as monthly NDVI or annual NBR images, we often assign this property manually:

.set("system:time_start", ee.Date.fromYMD(year, month, 15).millis())

This places the composite at a specific date in the chart.

The date is converted to milliseconds because Earth Engine stores time as milliseconds since 1970-01-01 UTC, also called the Unix epoch.

Visualizing versus exporting

It is important to separate map visualization from data export.

Map.addLayer(image, visParams, "Layer name");

This displays an image on the map.

Export.image.toDrive({...});

This saves an image as a raster file.

A layer may look good on the map because of the visualization parameters, but the exported raster contains the original data values unless you explicitly export a visualized image.

Why this matters for the hands-on activities

The same GEE logic appears throughout the workshop:

Once this workflow is clear, it can be adapted to many ecological and forest management applications.

Questions

  1. What is the difference between an ee.Image and an ee.ImageCollection?

  2. Why do we filter image collections by date and region?

  3. What does .map() do in Earth Engine?

  4. Why is cloud masking important before analysis?

  5. What does a reducer do?

  6. What is the difference between client-side and server-side objects?

  7. Why does Earth Engine use lazy evaluation?

  8. What is the purpose of system:time_start in time series analysis?

  9. What is the difference between visualizing a layer and exporting a result?

  10. Why should we define a clear region of interest before analysis?

Answers
  1. An ee.Image is one raster dataset. An ee.ImageCollection is a set of images, often representing repeated observations through time.

  2. Filtering by date and region keeps only the images relevant to the question and study area. This reduces unnecessary processing and focuses the analysis.

  3. .map() applies the same function to every image in a collection.

  4. Cloud masking removes cloud, shadow, snow, or other poor-quality pixels that can distort indices, composites, charts, and change detection.

  5. A reducer summarizes many values into fewer values. For example, it can calculate the mean NDVI inside an ROI or the total disturbed area in hectares.

  6. Client-side objects exist in the browser as normal JavaScript values. Server-side Earth Engine objects describe computations that run on Google’s servers.

  7. Lazy evaluation allows Earth Engine to build a processing plan and run it only when an output is requested. This makes large-scale analysis more efficient.

  8. system:time_start stores the date of an image. Time series charts use it to place images correctly on the x-axis.

  9. Visualization displays data on the map using colors and value ranges. Export saves raster data to a file for use outside Earth Engine.

  10. A clear ROI limits the analysis to the area of interest, reduces unnecessary processing, and makes summaries and exports more meaningful.

Practical check questions

  1. What does this line do?

var s2 = ee.ImageCollection("COPERNICUS/S2_SR_HARMONIZED");
  1. What does this line do?

.filterBounds(roi)
  1. What does this line do?

.filterDate("2023-01-01", "2023-12-31")
  1. Why is this not the same as downloading data to your computer?

Answers
  1. It loads the Sentinel-2 Surface Reflectance Harmonized image collection from the Earth Engine Data Catalog.

  2. It keeps only images that intersect the region of interest.

  3. It keeps only images acquired between January 1 and December 31, 2023.

  4. The data remain in Earth Engine’s cloud environment. The script describes and runs computations on the server. Data are only downloaded if you explicitly export or download a result.