Learn R Programming

LSRS (version 0.2.0)

Normalized Difference Vegetation Index: Normalized Difference Vegetation Index

Description

Normalized Difference Vegetation Index (NDVI) quantifies vegetation by measuring the difference between near-infrared (which vegetation strongly reflects) and red light (which vegetation absorbs). NDVI always ranges from -1 to +1. But there isn<U+2019>t a distinct boundary for each type of land cover. For example, when you have negative values, it<U+2019>s highly likely that it<U+2019>s water. On the other hand, if you have a NDVI value close to +1, there<U+2019>s a high possibility that it<U+2019>s dense green leaves. But when NDVI is close to zero, there isn<U+2019>t green leaves and it could even be an urbanized area.As shown below, Normalized Difference Vegetation Index (NDVI) uses the NIR and red channels in its formula. NDVI=NIR-Red/NIR+Red

The result of this formula generates a value between -1 and +1. If you have low reflectance (or low values) in the red channel and high reflectance in the NIR channel, this will yield a high NDVI value. And vice versa.Overall, NDVI is a standardized way to measure healthy vegetation. When you have high NDVI values, you have healthier vegetation. When you have low NDVI, you have less or no vegetation. satellites like Sentinel-2, Landsat and SPOT produce red and near infrared images.

Usage

NDVI(a="NIR",b="Red")

Arguments

a

NIR satellite band (format:TIF)

b

Red satellite band (format:TIF)

References

[1] http://gisgeography.com/ndvi-normalized-difference-vegetation-index/

Examples

Run this code
# NOT RUN {
## The function is currently defined as
function (a, b){
    name <- NDVI(a,b)
areaXY <-c(xmin, xmax, ymin, ymax)
cropXY <- crop(name, areaXY)
plot(cropXY,lwd=4,
     main="NDVI",
     xlab="easting", ylab="northing")
hist(cropXY,
     main="NDVI",

     xlab="NDVI",col="red", ylab="Frequency of Pixels")
}
# }

Run the code above in your browser using DataLab