Delineating water bodies and tracking moisture conditions are
foundational tasks in hydrology, wetland monitoring, and irrigation
management. GeoIndexR implements three key indices:
McFeeters designed NDWI to delineate open water features by maximizing green band reflectance and minimizing NIR reflectance:
\[\text{NDWI} = \frac{\text{GREEN} - \text{NIR}}{\text{GREEN} + \text{NIR}}\]
Water bodies typically have positive NDWI values (\(\text{NDWI} > 0\)), while terrestrial vegetation and dry soil display negative values.
library(GeoIndexR)
img <- get_example_data()
ndwi <- geo_index(img, "NDWI")
index_summary(ndwi)
#>
#> === GeoIndexR Spectral Summary ===
#>
#> index min max mean median sd q05 q25 q75 q95
#> NDWI -0.8461 0.7301 -0.2114 -0.2433 0.5398 -0.8188 -0.7487 0.4134 0.6376
#> na_pct total_cells
#> 1 100In urbanized and complex landscapes, built-up surfaces often produce false positive signals under classical NDWI. Xu (2006) replaced the NIR band with the Shortwave Infrared (SWIR) band:
\[\text{MNDWI} = \frac{\text{GREEN} - \text{SWIR}}{\text{GREEN} + \text{SWIR}}\]
Because built-up areas reflect strongly in SWIR, their MNDWI values are negative, clearly separating urban structures from open water.
mndwi <- geo_index(img, "MNDWI")
index_summary(mndwi)
#>
#> === GeoIndexR Spectral Summary ===
#>
#> index min max mean median sd q05 q25 q75 q95 na_pct
#> MNDWI -0.5704 0.8607 -0.0517 -0.3293 0.512 -0.5139 -0.424 0.6403 0.7961 1
#> total_cells
#> 100The Normalized Difference Moisture Index monitors vegetation liquid water content:
\[\text{NDMI} = \frac{\text{NIR} - \text{SWIR}}{\text{NIR} + \text{SWIR}}\]
Higher values indicate well-hydrated vegetation canopies, whereas low or negative values signal drought or water stress.
ndmi <- geo_index(img, "NDMI")
index_summary(ndmi)
#>
#> === GeoIndexR Spectral Summary ===
#>
#> index min max mean median sd q05 q25 q75 q95 na_pct
#> NDMI -0.3275 0.6847 0.2469 0.3215 0.3331 -0.28 -0.1227 0.5409 0.6323 1
#> total_cells
#> 100We can compute and compare water and moisture indices together:
water_stack <- geo_indices(img, c("NDWI", "MNDWI", "NDMI"))
index_summary(water_stack)
#>
#> === GeoIndexR Spectral Summary ===
#>
#> index min max mean median sd q05 q25 q75 q95
#> NDWI -0.8461 0.7301 -0.2114 -0.2433 0.5398 -0.8188 -0.7487 0.4134 0.6376
#> MNDWI -0.5704 0.8607 -0.0517 -0.3293 0.5120 -0.5139 -0.4240 0.6403 0.7961
#> NDMI -0.3275 0.6847 0.2469 0.3215 0.3331 -0.2800 -0.1227 0.5409 0.6323
#> na_pct total_cells
#> 1 100
#> 1 100
#> 1 100