utilizes GEE's expression() function to implement the EVI formula, clearly mapping the red, near-infrared (NIR), and blue bands from the MODIS image
While the Normalized Difference Vegetation Index (NDVI) is a valuable tool for assessing vegetation health, it can sometimes be sensitive to atmospheric influences and soil background brightness, particularly in areas with dense vegetation. The Enhanced Vegetation Index (EVI) is designed to address these limitations by incorporating the blue band in its calculation. This article will guide you through a Google Earth Engine (GEE) script that computes the EVI from MODIS satellite data using an expression, offering a more robust measure of vegetation greenness and biomass. This example demonstrates how to leverage GEE's expression functionality for more sophisticated remote sensing analysis.
What This Script Does
This Google Earth Engine script calculates the Enhanced Vegetation Index (EVI) using a single MODIS surface reflectance image. Unlike NDVI, the EVI formula includes the blue band to correct for atmospheric scattering and canopy background effects. The script first loads a MODIS image and applies a scaling factor to the reflectance bands. It then utilizes GEE's expression()
function to implement the EVI formula, clearly mapping the red, near-infrared (NIR), and blue bands from the MODIS image to variables within the expression. The resulting EVI values, typically ranging from -1 to +1, are then added as a layer to the map for visualization, providing a potentially more accurate representation of vegetation characteristics compared to NDVI in certain scenarios.
GEE Code Sample
// Load a MODIS image and apply the scaling factor.
var img = ee.Image('MODIS/006/MOD09GA/2012_03_09').multiply(0.0001);
// Compute EVI using an expression. The second argument is a map from
// variable name to band name in the input image.
var evi = img.expression(
'2.5 * (nir - red) / (nir + 6 * red - 7.5 * blue + 1)',
{
red: img.select('sur_refl_b01'), // 620-670nm, RED
nir: img.select('sur_refl_b02'), // 841-876nm, NIR
blue: img.select('sur_refl_b03') // 459-479nm, BLUE
});
// Center the map.
Map.setCenter(-92.84497, 41.01918, 8);
// Display the input image and the EVI computed from it.
Map.addLayer(img.select(['sur_refl_b01', 'sur_refl_b04', 'sur_refl_b03']),
{min: 0, max: 0.2}, 'MODIS bands 1/4/3');
Map.addLayer(evi, {min: 0, max: 1}, 'EVI');
Step-by-Step Explanation:
// Compute Enhanced Vegetation Index (EVI) over the MODIS MOD09GA product
and subsequent comments: These comments introduce the script's purpose, which is to calculate the EVI using the MODIS MOD09GA product via an expression.var img = ee.Image('MODIS/006/MOD09GA/2012_03_09').multiply(0.0001);
: This line loads a specific MODIS Surface Reflectance Daily Global 500m (MOD09GA) image from March 9, 2012. The.multiply(0.0001)
part applies the necessary scaling factor to the reflectance bands, converting the integer values in the MODIS product to the range of 0 to 1, which is required for accurate vegetation index calculations.var evi = img.expression(...)
: This is where the EVI is calculated using theexpression()
function.'2.5 * (nir - red) / (nir + 6 * red - 7.5 * blue + 1)'
: This is the mathematical expression for EVI. The formula incorporates the Near-Infrared (NIR), Red, and Blue bands with specific coefficients to enhance the vegetation signal and minimize atmospheric and soil effects.{ red: img.select('sur_refl_b01'), nir: img.select('sur_refl_b02'), blue: img.select('sur_refl_b03') }
: This is a JavaScript object that maps the variable names (red
,nir
,blue
) used in the expression to the corresponding band names in the loaded MODIS image (img
).'sur_refl_b01'
: Red band (620-670nm).'sur_refl_b02'
: Near-Infrared (NIR) band (841-876nm).'sur_refl_b03'
: Blue band (459-479nm).
- The result of this expression, the EVI image, is stored in the variable
evi
.
Map.setCenter(-92.84497, 41.01918, 8);
: This line centers the map view to a specific latitude and longitude at a zoom level of 8, focusing the initial display.Map.addLayer(img.select(['sur_refl_b01', 'sur_refl_b04', 'sur_refl_b03']), {min: 0, max: 0.2}, 'MODIS bands 1/4/3');
: This adds the original MODIS image to the map for visual reference, using the Red, Near-Infrared (in this case, Band 4 is used for a common false-color composite), and Blue bands. The{min: 0, max: 0.2}
parameter sets the visualization range for the reflectance values.Map.addLayer(evi, {min: 0, max: 1}, 'EVI');
: This adds the calculated EVI image to the map. The{min: 0, max: 1}
parameter sets the visualization range for the EVI values, which typically fall within this range for vegetated areas. A default color palette will be applied by Earth Engine for visualization.
Applications
The Enhanced Vegetation Index (EVI) is valuable in various applications, often providing advantages over NDVI:
- Improved Vegetation Monitoring in High Biomass Regions: EVI is less susceptible to saturation in areas with dense vegetation, offering a better assessment of biomass differences.
- Reduced Atmospheric Influence: The inclusion of the blue band helps to correct for atmospheric scattering, leading to more consistent results across different atmospheric conditions.
- Minimized Soil Background Effects: EVI is less sensitive to variations in soil brightness, providing a clearer signal of vegetation greenness, especially in areas with sparse vegetation.
- Forest Monitoring: EVI's reduced sensitivity to atmospheric effects makes it particularly useful for monitoring forest health and canopy structure.
- Agricultural Monitoring: While NDVI is widely used, EVI can provide additional insights in regions with high crop density or varying atmospheric conditions.
- Land Cover Classification: EVI can be a valuable feature in differentiating various vegetation types and other land cover classes.
- Phenology Studies: Tracking seasonal changes in vegetation greenness can benefit from the more stable signal provided by EVI.
Visualization Example
As with the NDVI example, I cannot directly embed an interactive map here. To visualize the EVI:
- Run the provided script in the Google Earth Engine Code Editor.
- Observe the EVI layer overlaid on the map. You will likely see different color gradients representing varying levels of EVI, indicating vegetation health and density.
- Take a screenshot of the EVI visualization in the Code Editor.
- Upload this screenshot to your Blogger post, ensuring you add descriptive alt text.
Example of EVI visualization highlighting vegetation greenness with reduced atmospheric and soil noise.
Notes
- Scaling Factor: Remember the importance of applying the scaling factor (
multiply(0.0001)
) to the MODIS reflectance bands before calculating EVI. - EVI Range: EVI values typically range from -1 to +1, with healthy vegetation generally exhibiting higher positive values. However, the visualization in the script is set from 0 to 1 for common vegetation ranges.
- Expression Function: The
expression()
function in GEE is a powerful tool for implementing complex band arithmetic and custom indices directly within the Earth Engine environment. - Band Selection: Ensure you are selecting the correct band names (
'sur_refl_b01'
,'sur_refl_b02'
,'sur_refl_b03'
) corresponding to the Red, NIR, and Blue bands in the MODIS MOD09GA product.
📚 References
- Google Earth Engine Documentation - Image Expressions
- MODIS MOD09GA Product User's Guide
- Enhanced Vegetation Index (EVI) - NASA
Prepared by: Jamal Chaaouan | GEE Academy @ GeoJamal.com
COMMENTS