GEE Tutorials

Google Earth Engine Tutorial: Analyze Seasonal NDVI with MODIS Data

Credit: Youtube Channel “Terra Spatial, Tutorial on importing MODIS data and creating year charts to analyze seasonal vegetation patterns using NDVI.”

You can see all the tutorials from here: Techgeo Academy.

Google Earth Engine Tutorial: Analyze Seasonal NDVI with MODIS Data

Google Earth Engine (GEE) offers powerful tools for analyzing satellite data, including the MODIS (Moderate Resolution Imaging Spectroradiometer) dataset. Normalized Difference Vegetation Index (NDVI) is a commonly used metric to assess vegetation health. This tutorial will guide you through the process of analyzing seasonal NDVI trends using MODIS data in GEE.

1. Accessing MODIS Data in Google Earth Engine

To begin, access the MODIS image collection. The MOD13Q1 dataset is widely used for NDVI analysis, containing 16-day composite data at 250m resolution. Select the relevant bands (NIR and Red) for NDVI computation.


// Load the MODIS NDVI collection
var modisCollection = ee.ImageCollection('MODIS/006/MOD13Q1');

// Filter by date range and region
var filteredCollection = modisCollection
  .filterDate('2020-01-01', '2021-12-31')
  .filter(ee.Filter.geometry(geometry)); // Replace 'geometry' with your study area
  

2. Calculating NDVI

Compute NDVI using the formula: (NIR – Red) / (NIR + Red). Extract the relevant bands from the MODIS data and apply the formula to each image.


// Function to calculate NDVI
function calculateNDVI(image) {
  var ndvi = image.normalizedDifference(['NDSI', 'RED']).rename('NDVI');
  return image.addBands(ndvi);
}

// Apply NDVI calculation to the collection
var ndviCollection = modisCollection.map(calculateNDVI);
  

3. Visualizing NDVI

Visualize the seasonal NDVI trends by selecting key images and displaying them with a color palette. You can also generate time series plots for a specific location.


// Display the first image in the collection
Map.centerObject(geometry, 6);
Map.addLayer(ndviCollection.first(), {min: 0.2, max: 1, palette: ['white', 'green']}, 'NDVI');
  

4. Extracting Seasonal Data

Use a function to split the year into four seasons and compute the average NDVI for each. Filter each season to calculate the mean NDVI and add it as a property to the image.


// Define a function to get the season
function addSeason(image) {
  var date = image.date();
  var year = date.get('year');
  var month = date.get('month');
  var season = ee.String(ee.Number(month).lt(4).and(month.neq(0))
    .and(month.neq(1)).and(month.neq(2)).and(month.neq(3))
    .then('Winter', month.lt(7).and(month.gte(3)).then('Spring', month.lt(10).and(month.gte(6)).then('Summer', 'Autumn')));
  return image.set('season', season);
}

// Apply the season function and group by season
var seasonalNDVI = ndviCollection.map(addSeason).filter(ee.Filter.inList('season', ['Winter', 'Spring', 'Summer', 'Autumn']));
  

5. Analyzing Trends

Calculate the mean NDVI for each season and use the Inspector tool in GEE to explore values. You can also export the data as CSV or GeoTIFF for further analysis.

FAQ

  • What datasets are used for NDVI analysis in GEE? MODIS, Landsat, and Sentinel are common sources. MOD13Q1 is suitable for coarse-resolution, long-term trends.
  • How long does processing take? It depends on the region size and data volume, but GEE processes efficiently due to parallel computing.
  • Can I export the NDVI data? Yes, via Export.image for raster data or Export.table for statistical outputs.
  • What does a high NDVI value indicate? High values (接近1) suggest dense vegetation, while low values (接近0) indicate sparse vegetation or non-vegetated areas.
  • How to handle cloud cover in MODIS data? Use the CLASS band to mask clouds, or apply filters to exclude cloudy images during preprocessing.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *