Skip to content

Spectral Indices

Spectral indices output a single value between -1 and 1 for each pixel. Unless you want to display a grayscale image, you probably want to apply a colormap after computing the index.

normalizedDifference

Computes the normalized difference of two bands:

normalized_difference = (x - y) / (x + y)

normalized_difference always uses the first two bands in the pre-assembled image as x and y respectively.

To create the Normalized difference vegetation index (NDVI), for example, you would pass the near-infrared band and the red band as the first two images to the imageBands prop in the combineBands module.

enhancedVegetationIndex

Computes the Enhanced Vegetation Index (EVI).

Layers are expected to exist as near-infrared, red, and blue bands on the input image, respectively. For example, with Landsat 8 data, you would pass bands 5, 4, and 2 to the imageBands prop in the combineBands module in that order.

soilAdjustedVegetationIndex

Computes the Soil Adjusted Vegetation Index (SAVI).

Layers are expected to exist as near-infrared and red bands on the input image, respectively. For example, with Landsat 8 data, you would pass bands 5 and 4 to the imageBands prop in the combineBands module in that order.

modifiedSoilAdjustedVegetationIndex

Computes the Modified Soil Adjusted Vegetation Index (MSAVI).

Layers are expected to exist as near-infrared and red bands on the input image, respectively. For example, with Landsat 8 data, you would pass bands 5 and 4 to the imageBands prop in the combineBands module in that order.