ndwi {ASIP} | R Documentation |
Normalized Difference Water Index (NDWI) is used to monitor changes related to water content in water bodies proposed by McFeeters (1996).
ndwi(directory = getwd(), crop = "n", ext2crop = "none")
ext2crop , crop , directory |
Same as mentioned in |
Computed NDWI product
1. NDWI = (r_green - r_nir) / (r_nir + r_green)
where, "r_" denotes TOA reflectance band.
2. There is another NDWI to monitor changes in water content of leaves proposed by Gao (1996). User should understand the requirements and run accordingly.
Other important notes are mentioned in custom.eqn
.
library (raster)
library (rgdal)
# Finding the path of the sample satellite image directory.
# User may define paths directly like "/home/ur_folder" or "C:/ur_folder"
path <- system.file ("TM_sample", package = "ASIP")
shapefil <- paste0 (path, "/test.shp")
op <- ndwi (directory = path, crop = "y", ext2crop = shapefil)