Skip to main content
Returns Normalized Difference between two bands(band2 and band1) in a Geotiff image(example: NDVI, NDBI)

Signatures

RS_NormalizedDifference (Band1: ARRAY[Double], Band2: ARRAY[Double])

Parameters

Band1
ARRAY[Double]
required
The first spectral band.
Band2
ARRAY[Double]
required
The second spectral band.

Return type

An array of double values.

Example

val normalizedDF = spark.sql("select RS_NormalizedDifference(band1, band2) as normdifference from dataframe")