Google Earth Engine Tutorial: Create MODIS NDVI Time Series Animation
Credit: Youtube Channel “Terra Spatial, Tutorial on creating unique time series animations of MODIS NDVI data for vegetation monitoring.”
You can see all the tutorials from here: Techgeo Academy.
Overview
Google Earth Engine (GEE) is a powerful platform for geospatial analysis and visualization. This tutorial demonstrates how to create a time series animation of the MODIS NDVI (Normalized Difference Vegetation Index) using GEE, enabling users to monitor vegetation changes over time across a region of interest.
Prerequisites
To follow this tutorial, ensure you have a Google Earth Engine account and access to the Earth Engine API. Additionally, set up the GEE code editor in your browser and install the Earth Engine JavaScript library if required.
Step 1: Load MODIS Data
Begin by loading the MODIS NDVI dataset from the Earth Engine repository. The MODIS 13A2 product provides a 16-day composite at 500m resolution, which is ideal for time series analysis.
var modis = ee.ImageCollection('MODIS/006/MOD13A2');
Step 2: Define Region of Interest
Specify the geographic area for analysis using a geometry. For example, you can define a polygon or use a predefined region.
var roi = ee.Geometry.Rectangle([longitudeMin, latitudeMin, longitudeMax, latitudeMax]);
Step 3: Filter and Select Data
Narrow down the dataset by date and region. Choose a date range that aligns with your study period.
var filtered = modis.filterDate('YYYY-MM-DD', 'YYYY-MM-DD').filter(ee.Filter.geometry(roi));
Step 4: Compute NDVI
Calculate the NDVI using the formula (NIR – Red) / (NIR + Red). MODIS data includes a ‘NDVI’ band, so you may directly select it.
var ndvi = filtered.map(function(image) {
return image.select('NDVI');
});
Step 5: Generate Time Series
Create a time series by iterating through the image collection and extracting the NDVI values over time. Use the getRegion method to retrieve data for specific points or polygons.
var timeSeries = ndvi.getRegion(roi, 500);
Step 6: Create Animation
Use the ui.Chart.image.series or ui.Video tools in GEE to generate an animation. Here’s an example script for a video output:
var video = ui.Video.segment(ndvi, {
dimensions: '1024x768',
framesPerSecond: 2,
region: roi
});
video.save('ndvi_animation', {driveFolder: 'GEE_Animations'});
Conclusion
This tutorial provides a foundational approach to creating MODIS NDVI time series animations. Adjust the parameters, such as date range, region, or visualization settings, based on your specific requirements. GEE’s cloud computing capabilities make it efficient for large-scale geospatial tasks.
FAQ
What is MODIS NDVI and why is it useful?
MODIS NDVI measures vegetation health by comparing near-infrared and red light reflectance. It is valuable for monitoring crop growth, deforestation, and land cover changes over time.
How do I customize the date range for the animation?
Modify the filterDate method by specifying start and end dates in the format ‘YYYY-MM-DD’ to align with your research period.
Can I use other satellite data instead of MODIS?
Yes, GEE supports multiple datasets. Replace the MODIS collection with other sources like Landsat or Sentinel, ensuring the selected dataset includes the NDVI band.
How to handle cloud cover in the analysis?
Use cloud masking tools or filter the image collection to exclude cloudy images. For example, apply filter(ee.Filter.eq('CLOUD_COVER', 0)) to retrieve cloud-free data.
What are the limits for animation size and resolution?
Earth Engine imposes size restrictions based on your account type. Adjust the dimensions and framesPerSecond parameters to optimize performance.
How to visualize the NDVI time series in a chart?
Utilize ui.Chart.image.series to generate a line chart. Define the region and scale parameters for accurate visualization.







