NDVI and NDWI: What Spectral Indices Actually Show
A satellite image is a grid of numbers. Each pixel stores how much light the ground reflected in each band. A spectral index is a simple formula that combines two or more of those bands into one new number. That number highlights something you care about, such as healthy plants or open water.
NDVI and NDWI are the two most common indices. They are easy to compute, but they are also easy to misread. This post explains the idea behind them, how to read the results, and the mistakes that trip up beginners. If you need a refresher on bands and resolution, see our earlier post on satellite imagery basics.
The reflectance idea behind indices
Reflectance is the fraction of incoming sunlight that a surface reflects back toward the sensor. Different materials reflect different amounts in different wavelengths. This pattern is called a spectral signature.
Three simple cases show why indices work:
- Healthy leaves absorb most red light for photosynthesis. They reflect a lot of near-infrared (NIR) light, because of the internal structure of the leaf.
- Water absorbs NIR and shortwave infrared strongly. It reflects some green light, so it looks dark in NIR.
- Bare soil and built surfaces reflect fairly similar amounts across red and NIR, with no sharp contrast.
A single band can be confusing. A dark pixel might be water, shadow or wet soil. But the contrast between two bands is more telling. An index measures that contrast, and it also reduces the effect of overall brightness, which changes with sun angle and terrain shading.
The normalized difference formula
Both NDVI and NDWI use the same pattern, called a normalized difference:
index = (A - B) / (A + B)
Subtracting shows the contrast. Dividing by the sum scales the result so it always falls between -1 and +1. This makes values comparable between bright and dark pixels.
NDVI: the vegetation index
NDVI stands for Normalized Difference Vegetation Index. It compares NIR and red:
NDVI = (NIR - Red) / (NIR + Red)
For Sentinel-2, NIR is band 8 and red is band 4. Both are 10 m bands. For Landsat 8 and 9, NIR is band 5 and red is band 4.
Healthy vegetation reflects a lot of NIR and absorbs red, so NDVI is high. Bare ground gives values near zero. Water often gives negative values.
These are rough guides, not fixed rules:
- Below 0: usually water, snow or cloud.
- Near 0 to about 0.2: bare soil, rock, sand or built-up areas.
- Moderate values: sparse vegetation, grassland or crops that are young or dry.
- High values: dense, healthy green vegetation.
Exact thresholds depend on the sensor, the season and the land cover. Always check values against known places in your own study area.
NDWI: the water index
NDWI stands for Normalized Difference Water Index. Be careful here, because two different formulas share this name.
The version by McFeeters highlights open surface water using green and NIR:
NDWI = (Green - NIR) / (Green + NIR)
For Sentinel-2, that is (B3 - B8) / (B3 + B8). Water reflects more green than NIR, so water pixels become positive. Vegetation and soil tend to become negative.
A different version by Gao uses NIR and shortwave infrared (SWIR). It is sensitive to the water content inside leaves, not to open water. Some people call this one NDMI (Normalized Difference Moisture Index) to avoid confusion.
For flood and surface water mapping, you almost always want the green/NIR version. Always write the formula in your methods, so readers know which one you used. A modified version, MNDWI, swaps NIR for SWIR and is often better in cities, where built surfaces can look like water in the standard version.
Computing the indices
You can compute both in the QGIS Raster Calculator, in Google Earth Engine, or in Python. In Earth Engine, Sentinel-2 surface reflectance images make this short:
var ndvi = image.normalizedDifference(['B8', 'B4']).rename('NDVI');
var ndwi = image.normalizedDifference(['B3', 'B8']).rename('NDWI');
In the QGIS Raster Calculator, the NDVI expression looks like this (layer names depend on your project):
("B08@1" - "B04@1") / ("B08@1" + "B04@1")
If your bands are stored as integers, convert them to floating point first. Integer division can silently destroy your result.
You can download Sentinel-2 data from the Copernicus Data Space, and find tools at QGIS and Google Earth Engine.
Reading vegetation stress and surface water
Vegetation stress
Drought, disease, fire damage and flooding can all reduce NDVI. Stressed plants absorb less red light than healthy ones and reflect less NIR. The index drops.
The best way to use this is by comparison. A single NDVI map tells you little. Two maps tell you more:
- Compare the same area in the same season across different years.
- Compare a field or forest with its neighbors on the same date.
- Plot NDVI over time for one location and look for sudden drops against the usual seasonal curve.
A drop does not tell you the cause. It tells you where to look. Pair it with rainfall data, field visits or local reports. For fire severity, the related index dNBR is covered in our wildfire post.
Surface water
NDWI helps you outline lakes, rivers and flooded fields. A common workflow is to pick a threshold, often near zero as a starting point, and turn the index into a water/non-water mask. Then you compare a before-flood image with an after-flood image to find new water.
Thresholds vary by scene. Check the histogram and zoom in on known water bodies and known dry land. Adjust until the mask matches what you see.
Optical indices need a clear view. During storms, clouds block the ground. That is why radar is often used for floods, as described in our SAR flood post. Use NDWI when you have clear-sky images, such as before an event or in the days after the clouds clear.
Common mistakes
- Mixing up the two NDWI formulas. Green/NIR maps open water. NIR/SWIR maps leaf moisture. State which one you used.
- Using digital numbers instead of reflectance. Use surface reflectance products when possible. For Sentinel-2, that means Level-2A. Comparing raw values from different dates can mislead you.
- Ignoring clouds, cloud shadows and haze. Shadows are dark and can look like water. Clouds can give odd index values. Use the scene classification or cloud mask that comes with the product.
- Comparing different seasons. Crops and deciduous trees change naturally through the year. A lower NDVI in winter is not damage.
- Treating one threshold as universal. A value that works in one scene may fail in another. Validate against reference points.
- Forgetting saturation. In very dense vegetation, NDVI levels off and stops separating dense from very dense canopy.
- Confusing shadows and terrain with water. In steep valleys, shaded slopes can resemble water. Check with a DEM or a hillshade layer.
- Mixing pixel sizes. A 10 m pixel in a narrow stream may hold water, bank and trees together. The index then shows a mixture, not pure water.
- Skipping accuracy checks. A pretty map is not a validated map. Use reference points and a confusion matrix, as in our accuracy assessment post.
What to try next
- Download one cloud-free Sentinel-2 scene of a place you know, with both a river or lake and some farmland.
- Compute NDVI and NDWI in QGIS or Earth Engine. Check that the water body is positive in NDWI and negative or low in NDVI.
- Try several NDWI thresholds. Note which one matches the shoreline best.
- Repeat for the same place in a different season and describe what changed, and why.
Next in the series: Training Data for GeoAI: Labeling Imagery Without Fooling Yourself. Indices like these often serve as input features for the models discussed there.
More materials (some in Korean) are on GeoAI for Disaster Safety.
This post was drafted with the help of AI tools and checked before publishing. Tool features and data portals change over time, so check the official documentation when you practice.
Comments
Post a Comment