knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
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)
In 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)
The 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)
We can compute and compare water and moisture indices together:
water_stack <- geo_indices(img, c("NDWI", "MNDWI", "NDMI")) index_summary(water_stack)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.