NDWI Water Mapping in QGIS: Detect Lakes, Rivers, and Floods From Satellites
- Primary Signal: NDWI Water Mapping in QGIS: Detect Lakes, Rivers, and Floods From Satellites
- Overview: The Normalised Difference Water Index turns satellite imagery into a clear map of open water. This tutorial shows the formula, the QGIS workflow, and how to read the result....
- Verification: Analyzed and compiled by FreeSky GeoData editorial monitoring desk.
Water absorbs near-infrared light strongly while reflecting green light, and land vegetation does roughly the opposite, so comparing those two bands separates water from almost everything else. The Normalised Difference Water Index, proposed by McFeeters in 1996, is calculated as green minus near-infrared divided by green plus near-infrared, producing values from -1 to 1. Pixels above zero are usually water, while vegetation, soil, and built-up areas fall below zero, which makes the index easy to interpret even for beginners.
Sentinel-2 is ideal for NDWI because its green band at 10 metres and near-infrared band at 10 metres match in resolution, so no resampling is needed. Landsat 8 and 9 work equally well with their green and near-infrared bands at 30 metres. The key requirement is surface-reflectance data, because atmospheric haze distorts the green band more than the infrared, and comparing uncorrected scenes can shift the water threshold between dates.
Load your green and near-infrared bands into QGIS, then open the Raster Calculator and enter the formula with your band names, for example (Green - NIR) / (Green + NIR), making sure to guard against division by zero by adding a tiny constant or relying on the calculator's handling of null values. Save the output as a new raster and style it with a diverging colour ramp, blue for positive values and brown or grey for negative ones, so water bodies stand out immediately. Zoom to a known lake or river and check that it appears blue; if it does not, re-check that you assigned the bands correctly, since swapping green and infrared inverts the result.
To turn the index into a water mask, use the Raster Calculator again with a condition such as NDWI > 0, producing a binary raster where 1 means water. Then polygonise that raster to get vector water bodies you can measure, count, and compare over time. For flood mapping, calculate NDWI for a pre-flood and post-flood scene, subtract the two, and highlight areas that changed from land to water, which is a fast, defensible way to estimate inundation extent.
NDWI struggles in two common situations: dark shadows from mountains or tall buildings can score like water, and turbid or algae-rich water reflects more infrared than clear water, pushing its index toward zero. Built-up areas with reflective roofs can also confuse the original formula. The Modified NDWI, which replaces near-infrared with shortwave infrared, handles built-up areas better, so many analysts compute both and compare them before deciding which threshold to trust.
Always validate against a basemap or known water bodies, and report your threshold openly, because a threshold of 0.0 versus 0.1 can change a lake's measured area noticeably. For a small project, ground-checking a few points with a GPS or a recent aerial photo is enough to justify your map. NDWI will not replace field hydrology, but for a student, NGO, or local planner it delivers a credible water map from free data in under an hour, which is precisely why it remains one of the most taught indices in remote sensing.
To strengthen your NDWI work further, repeat the calculation for two or three dates across a wet and a dry season and watch how the water mask expands and contracts. That seasonal comparison teaches you more about your study area than any single map, because it reveals which ponds are permanent, which channels flow only after rain, and where the threshold you chose starts to fail. Share the resulting maps with local knowledge holders, such as farmers or water managers, who can confirm whether a mapped water body is real or a shadow artefact. Their corrections are the cheapest accuracy assessment available, and incorporating them turns a technical exercise into a map that people who live with the water actually trust.
📖 Continue Reading the Full Story
Continue reading this article on FreeSky GeoData.
⚡ Access Full Content Now