geo_indices: Compute Multiple Spectral Indices from Multispectral Raster...

View source: R/geo_indices.R

geo_indicesR Documentation

Compute Multiple Spectral Indices from Multispectral Raster Data

Description

Computes a collection of spectral indices from a multispectral terra::SpatRaster or raster file path and returns the results stacked into a multi-layer SpatRaster.

Usage

geo_indices(
  image,
  indices,
  bands = NULL,
  scale_factor = NULL,
  sensor = NULL,
  ...
)

Arguments

image

A terra::SpatRaster object or file path containing multispectral bands.

indices

Character vector of index codes to compute (e.g., c("NDVI", "NDWI", "NDBI", "NDMI")).

bands

Optional named vector or list specifying custom band mapping.

scale_factor

Optional numeric scaling divisor (e.g. 10000).

sensor

Optional character string specifying a sensor preset.

...

Additional parameters passed to index calculation functions.

Value

A multi-layer terra::SpatRaster where each layer corresponds to one computed index, named accordingly.

Examples

img <- get_example_data()

# Compute NDVI, NDWI and MNDWI simultaneously
stack <- geo_indices(img, c("NDVI", "NDWI", "MNDWI"))
print(stack)
names(stack)


GeoIndexR documentation built on Oct. 10, 2026, 5:08 p.m.