Normalized Difference Vegetation Index (NDVI), Normalized Difference Water Index (NDWI)
Project: Spatio-Temporal Analysis.
Overview: Used R to automate and carried out spatio-temporal analysis. To measure vegetation and water content, two remote sensing indices were carried out, namely; Normalized Difference vegetation index (NDVI), and Normalized Difference water index (NDWI) using Landsat 7 & 5 Imageries of 1999, 2008, and 2018 for dry and wet seasons.
Study Area: Kainji Lake, Nigeria
Data Source: United States Geological Surveys https://earthexplorer.usgs.gov/
NDVI and NDWI are two different indices used to analyze remote sensing data, often from satellite imagery, to measure vegetation and water content respectively.
NDVI stands for "Normalized Difference Vegetation Index". It is calculated using near-infrared (NIR) and red light bands from remote sensing data and provides a measure of the amount and health of vegetation in an area. NDVI values range from -1 to 1, with higher values indicating a greater amount of healthy vegetation.
### Landsat Imageries of the study area were downloaded from USGS site.
# and saved on our local disk
# reading the imageries
# L07_18753_0208 <- list.files("C:/RSG 507/LE07_L1TP_187053_20080216_20161230_01_T1",
# pattern = glob2rx("*B*.TIF$"),
# full.names = TRUE)
# # Declare B3 & B4 for Dry 2008
L07_18753_0208_NW_B4 <- raster("C:/RSG 507/LE07_L1TP_187053_20080216_20161230_01_T1/LE07_187053_20080216_B4_GF.TIF")
L07_18753_0208_NW_B3 <- raster("C:/RSG 507/LE07_L1TP_187053_20080216_20161230_01_T1/LE07_187053_20080216_B3_GF.TIF")
# Declare B3 & B4 for 501_landsat
L08_B3 <- raster('landsat8_band3.tif')
L08_B4 <- raster('landsat8_band4.tif')
#Declare B3 & B4 for Wet 2008
L07_19753_1008_B3 <- raster("C:/RSG 507/LE07_L1TP_187053_20081029_20161224_01_T1/LE07_187053_20081029_B3.TIF")
L07_19753_1008_B4 <- raster("C:/RSG 507/LE07_L1TP_187053_20081029_20161224_01_T1/LE07_187053_20081029_B4.TIF")
# NDVI Outputs
NDVI_507_L08 <- NDVI_fun(L08_B3, L08_B4)
View(NDVI_507_L08)
NDVI_L07_18753_0208_NW <- NDVI_fun(L07_18753_0208_NW_B4, L07_18753_0208_NW_B3)
#
NDVI_L07_19753_1008 <- NDVI_fun(L07_19753_1008_B4, L07_19753_1008_B3)
#
NDVI_L07_18753_0218 <- NDVI_fun(L07_18753_0218_B4, L07_18753_0218_B3)
#
NDVI_L07_187053_1118 <- NDVI_fun(L07_187053_1118_B4, L07_187053_1118_B3)
#
NDVI_L07_187053_1099 <- NDVI_fun(L07_187053_1099_B4, L07_187053_1099_B3)
#
NDVI_L05_187053_0299 <- NDVI_fun(L05_187053_0299_B4, L05_187053_0299_B3)
# we can use ggplot lib and tmap lib to plot the output,
# but we used plot function