if (FALSE) {
# These examples require satellite imagery files (Landsat/Sentinel data etc.)
# Basic NDVI calculation
ndvi <- calculate_vegetation_index(red = red_band, nir = nir_band, index_type = "NDVI")
# Multi-band raster with auto-detection
evi <- calculate_vegetation_index(spectral_data = landsat_stack,
index_type = "EVI", auto_detect_bands = TRUE)
# Directory with automatic band detection
savi <- calculate_vegetation_index(spectral_data = "/path/to/sentinel/bands/",
index_type = "SAVI", auto_detect_bands = TRUE)
# Advanced index with custom parameters
pri <- calculate_vegetation_index(red = red_band, nir = nir_band, green = green_band,
index_type = "PRI", clamp_range = c(-1, 1))
# Custom band names for multi-band data
ndvi <- calculate_vegetation_index(spectral_data = sentinel_data,
band_names = c("B4", "B3", "B2", "B8"),
index_type = "NDVI")
}
Run the code above in your browser using DataLab