Skip to content
import { contrastBrightness, stretchMinMax, stretchStandardDeviation, stretchPercentClip, stretchNone } from "@arcgis/core/layers/support/rasterFunctionUtils.js";
Since
ArcGIS Maps SDK for JavaScript 4.28

Various utility functions that create RasterFunction for imagery processing. Utility methods in this module makes the raster function generations easier when applying raster functions to ImageryLayer and ImageryTileLayer.

Functions

NameReturn TypeObject
abs
cos
exp
int
log
mod
sin
tan

contrastBrightness

Function

Creates a Contrast And Brightness function that enhances the appearance of raster data by modifying the brightness and contrast within the image. See Contrast And Brightness function.

Signature
contrastBrightness (parameters: ContrastBrightnessParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.contrastBrightness({
contrastOffset: 10,
brightnessOffset: 8
});

stretchMinMax

Function

Creates a Stretch function using min-max stretch type. Pixel values inside [min, max] defined in the band's statistics are stretched to [outputMin, outputMax], those fall outside are clamped to [outputMin, outputMax]. See Stretch function.

Signature
stretchMinMax (parameters: MinMaxStretchParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// stretch NDVI values from -1 to 1 to 0 to 255.
layer.rasterFunction = rasterFunctionUtils.stretchMinMax({
statistics: [{min: -1, max: 1, avg: 0, stddev: 0.1}],
outputPixelType: "u8"
});

stretchStandardDeviation

Function

Creates a Stretch function using standard-deviation stretch type. Pixel values inside the defined number of standard deviations are stretched to [outputMin, outputMax], those fall outside are clamped to [outputMin, outputMax]. See Stretch function.

Signature
stretchStandardDeviation (parameters: StddevStretchParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Stretch elevation values with in 2 standard deviations to 0 to 255.
layer.rasterFunction = rasterFunctionUtils.stretchStandardDeviation({
numberOfStandardDeviations: 2,
statistics: [{min: 20, max: 1200, avg: 600, stddev: 100}],
outputPixelType: "u8"
});

stretchPercentClip

Function

Creates a Stretch function using percent-clip stretch type. The input data must have histograms for it to work properly. See Stretch function.

Signature
stretchPercentClip (parameters: PercentClipStretchParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Stretch Landsat imagery using percent clip, pixels values within both lower 2% and
// upper 2% are clamped to output min (0) and output max (255).
layer.rasterFunction = rasterFunctionUtils.stretchPercentClip({
minPercent: 2,
maxPercent: 2,
outputPixelType: "u8"
});

stretchNone

Function

Creates a Stretch function without a specific stretch method. Since output range can differ from pixel type's range, pixel values are projected to the output range linearly based on pixel type. For aerial or satellite imagery, it simply adjusts radiometric resolution and preserves DN values relatively. This is a no-op for all unsigned 8 bit images. See Stretch function.

Signature
stretchNone (parameters: BaseStretchParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Apply no additional stretch, pixel values are simply fitted into 0 to 255 range.
layer.rasterFunction = rasterFunctionUtils.stretchNone({
outputPixelType: "u8"
});

convolution

Function

Creates a Convolution function that performs filtering using the given kernel to enhance the image, e.g. sharpening an image, blurring an image, and detecting edges et al. See Convolution function.

Signature
convolution (parameters: ConvolutionFunctionParameters | ConvolutionFunctionCustomParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Sharpen the image
layer.rasterFunction = rasterFunctionUtils.convolution({
convolutionType: "sharpen"
});

bandArithmeticNDVI

Function

Creates a NDVI function. The Normalized Difference Vegetation Index (NDVI) method is a standardized index allowing you to generate an image displaying greenness (relative biomass). This index takes advantage of the contrast of the characteristics of two bands from a multispectral raster dataset—the chlorophyll pigment absorptions in the red band and the high reflectivity of plant materials in the NIR band.

Equation: NDVI = ((NIR - Red)/(NIR + Red))

See NDVI function and NDVI.

Signature
bandArithmeticNDVI (parameters: NDVIBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Creates NDVI from a 4-band image whose bands are arranged in BGRI order.
const ndvi = rasterFunctionUtils.bandArithmeticNDVI({
nirBandId: 3,
redBandId: 2
});
const colormap = rasterFunctionUtils.colormap({
colorRampName: "NDVI3",
raster: ndvi
});
layer.rasterFunction = colormap;

bandArithmeticSAVI

Function

Creates a Band Arithmetic function to calculate SAVI. The Soil-Adjusted Vegetation Index (SAVI) method is a vegetation index that attempts to minimize soil brightness influences using a soil-brightness correction factor. This is often used in arid regions where vegetative cover is low, and it outputs values between -1.0 and 1.0.

Equation: SAVI = ((NIR - Red) / (NIR + Red + L)) x (1 + L)

L = The amount of green vegetation cover

See SAVI raster function.

Signature
bandArithmeticSAVI (parameters: SAVIBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Creates SAVI from a 4-band image whose bands are arranged in BGRI order.
const index = rasterFunctionUtils.bandArithmeticSAVI({
nirBandId: 3,
redBandId: 2,
factor: 0.33
});

bandArithmeticTSAVI

Function

Creates a Band Arithmetic function to calculate TSAVI. The Transformed Soil Adjusted Vegetation Index (TSAVI) method is a vegetation index that minimizes soil brightness influences by assuming the soil line has an arbitrary slope and intercept. See TSAVI raster function.

Equation: TSAVI = (s * (NIR - s * Red - a)) / (a * NIR + Red - a * s + X * (1 + s * s)) s = the soil line slope a = the soil line intercept X = an adjustment factor that is set to minimize soil noise

Signature
bandArithmeticTSAVI (parameters: TSAVIBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Creates TSAVI from a 4-band image whose bands are arranged in BGRI order.
const tsavi = rasterFunctionUtils.bandArithmeticTSAVI({
nirBandId: 3,
redBandId: 2,
slope: 0.33,
intercept: 0.5,
factor: 1.5
});

bandArithmeticMSAVI

Function

Creates a Band Arithmetic function to calculate MSAVI. The Modified Soil Adjusted Vegetation Index (MSAVI) method minimizes the effect of bare soil on the SAVI. See MSAVI raster function.

Equation: MSAVI2 = 0.5 * ((2NIR+1)-sqrt((2NIR+1)(2NIR+1)-8(NIR-Red)))

Signature
bandArithmeticMSAVI (parameters: MSAVIBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Creates MSAVI from a 4-band image whose bands are arranged in BGRI order.
const msavi = rasterFunctionUtils.bandArithmeticMSAVI({
nirBandId: 3,
redBandId: 2
});

bandArithmeticGEMI

Function

Creates a Band Arithmetic function to calculate GEMI. The Global Environmental Monitoring Index (GEMI) method is a nonlinear vegetation index for global environmental monitoring from satellite imagery. It's similar to NDVI, but it's less sensitive to atmospheric effects. It is affected by bare soil; therefore, it's not recommended for use in areas of sparse or moderately dense vegetation. See GEMI raster function.

Equation: GEMI = eta * (1 - 0.25 * eta)-((Red - 0.125)/(1 - Red)) eta = (2 * (NIR * NIR - Red * Red) + 1.5 * NIR + 0.5 * Red)/(NIR + Red + 0.5)

Signature
bandArithmeticGEMI (parameters: GEMIBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Creates GEMI from a 4-band image whose bands are arranged in BGRI order.
const gemi = rasterFunctionUtils.bandArithmeticGEMI({
nirBandId: 3,
redBandId: 2
});

bandArithmeticPVI

Function

CCreates a Band Arithmetic function to calculate PVI. The Transformed Soil Adjusted Vegetation Index (TSAVI) method is a vegetation index that minimizes soil brightness influences by assuming the soil line has an arbitrary slope and intercept. See PVI raster function.

Equation: PVI = (NIR - a * Red - b) / (sqrt(1 + a*a)) a = slope of the soil line b = gradient of the soil line

Signature
bandArithmeticPVI (parameters: PVIBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Creates PVI from a 4-band image whose bands are arranged in BGRI order.
const pvi = rasterFunctionUtils.bandArithmeticPVI({
nirBandId: 3,
redBandId: 2,
slope: 0.3,
gradient: 0.5
});

bandArithmeticGVITM

Function

Creates a Band Arithmetic function to calculate GVITM. The Green Vegetation Index (GVI) method was originally designed from Landsat MSS imagery and has been modified for Landsat TM imagery. It's also known as the Landsat TM Tasseled Cap green vegetation index. It can be used with imagery whose bands share the same spectral characteristics. See GVITM raster function.

Equation: GVI = -0.2848 * Band1 - 0.2435 * Band2 - 0.5436 * Band3 + 0.7243 * Band4 + 0.0840 * Band5 - 0.1800 * Band7

Signature
bandArithmeticGVITM (parameters: LandsatBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Creates GVITM from a Landsat TM multispectral scene.
const gvitm = rasterFunctionUtils.bandArithmeticGVITM({
bandIds: [0, 1, 2, 3, 4, 5]
});

bandArithmeticSultan

Function

Creates a Band Arithmetic function to calculate Sultan index. Creates a BandArithmetic function. The Sultan's process takes a six-band 8-bit image and uses the Sultan's Formula method to produce a three-band 8-bit image. The resulting image highlights rock formations called ophiolites on coastlines. This formula was designed based on the TM or ETM bands of a Landsat 5 or 7 scene.

See Sultan raster function.

Signature
bandArithmeticSultan (parameters: SultanParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Creates Sultan 3 band output from a 6-band Landsat TM multispectral scene.
const sultan = rasterFunctionUtils.bandArithmeticSultan({
bandIds: [0, 2, 3, 4, 5]
});

bandArithmeticVARI

Function

Creates a Band Arithmetic function to calculate VARI. The Visible Atmospherically Resistant Index (VARI) method is a vegetation index for estimating vegetation fraction quantitatively with only the visible range of the spectrum. See VARI raster function.

Equation: VARI = (Green - Red) / (Green + Red – Blue)

Signature
bandArithmeticVARI (parameters: VARIBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Creates VARI from a typical drone image.
const index = rasterFunctionUtils.bandArithmeticVARI({
redBandId: 0,
greenBandId: 1,
blueBandId: 2
});

bandArithmeticGNDVI

Function

Creates a Band Arithmetic function to calculate GNDVI. The Green Normalized Difference Vegetation Index (GNDVI) method is a vegetation index for estimating photo synthetic activity and is a commonly used vegetation index to determine water and nitrogen uptake into the plant canopy. See GNDVI raster function.

Equation: GNDVI = (NIR-Green)/(NIR+Green)

Signature
bandArithmeticGNDVI (parameters: GDNVIBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Creates GNDVI from a 4-band image whose bands are arranged in BGRI order.
const gndvi = rasterFunctionUtils.bandArithmeticGNDVI({
nirBandId: 3,
greenBandId: 1
});

bandArithmeticSR

Function

Creates a Band Arithmetic function to calculate SR. The Simple Ratio (SR) method is a common vegetation index for estimating the amount of vegetation. It is the ratio of light scattered in the NIR and absorbed in red bands, which reduces the effects of atmosphere and topography. See SR raster function.

Equation: SR = NIR / Red

Signature
bandArithmeticSR (parameters: SRBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Creates SR from a 4-band image whose bands are arranged in BGRI order.
const sr = rasterFunctionUtils.bandArithmeticSR({
nirBandId: 3,
redBandId: 2
});

bandArithmeticNDVIre

Function

Creates a Band Arithmetic function to calculate NDVIre. The Red-Edge NDVI (NDVIre) method is a vegetation index for estimating vegetation health using the red-edge band. It is especially useful for estimating crop health in the mid to late stages of growth, when the chlorophyll concentration is relatively higher. Also, NDVIre can be used to map the within-field variability of nitrogen foliage to understand the fertilizer requirements of crops. See NDVIre raster function.

Equation: NDVIre = (NIR - RedEdge)/(NIR + RedEdge)

Signature
bandArithmeticNDVIre (parameters: NDVIreBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Creates NDVI (rededge).
const ndvire = rasterFunctionUtils.bandArithmeticNDVIre({
nirBandId: 3,
reBandId: 4
});

bandArithmeticSRre

Function

Creates a Band Arithmetic function to calculate SRre. The Red-Edge Simple Ratio (SRre) method is a vegetation index for estimating the amount of healthy and stressed vegetation. It is the ratio of light scattered in the NIR and red-edge bands, which reduces the effects of atmosphere and topography. See SRre raster function.

Equation: SRre = NIR / RedEdge

Signature
bandArithmeticSRre (parameters: SRreBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Creates SR (rededge).
const srre = rasterFunctionUtils.bandArithmeticSRre({
nirBandId: 3,
reBandId: 4
});

bandArithmeticMTVI2

Function

Creates a Band Arithmetic function to calculate MTVI2. The Modified Triangular Vegetation Index (MTVI2) method is a vegetation index for detecting leaf chlorophyll content at the canopy scale while being relatively insensitive to leaf area index. It uses reflectance in the green, red, and NIR bands. See MTVI2 raster function.

Signature
bandArithmeticMTVI2 (parameters: MTVI2BandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Creates MTVI2 from a 4-band image whose bands are arranged in BGRI order.
const mtvi2 = rasterFunctionUtils.bandArithmeticMTVI2({
nirBandId: 3,
redBandId: 2,
greenBandId: 1
});

bandArithmeticRTVICore

Function

Creates a Band Arithmetic function to calculate RTVICore. The Red-Edge Triangulated Vegetation Index (RTVICore) method is a vegetation index for estimating leaf area index and biomass. This index uses reflectance in the NIR, red-edge, and green spectral bands. See RTVICore raster function.

Equation: RTVICore = 100 * (NIR - RedEdge) - 10 * (NIR - Green)

Signature
bandArithmeticRTVICore (parameters: RTVICoreBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Creates RTVICore from a 4-band image whose bands are arranged in BGRI order.
const rtviCore = rasterFunctionUtils.bandArithmeticRTVICore({
nirBandId: 3,
redBandId: 2,
greenBandId: 1
});

bandArithmeticCIre

Function

Creates a Band Arithmetic function to calculate CIre. The Chlorophyll Index - Red-Edge (CIre) method is a vegetation index for estimating the chlorophyll content in leaves using the ratio of reflectivity in the NIR and red-edge bands. See CIre raster function.

Equation: CIre = (NIR / RedEdge)-1

Signature
bandArithmeticCIre (parameters: CIreBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Creates CI (Red-Edge).
const cire = rasterFunctionUtils.bandArithmeticCIre({
nirBandId: 3,
reBandId: 4
});

bandArithmeticCIg

Function

Creates a Band Arithmetic function to calculate CIg. Chlorophyll index - Green (CIG) method is a vegetation index for estimating the chlorophyll content in leaves using the ratio of reflectivity in the NIR and green bands. See CIg raster function.

Equation: CIg = (NIR / Green)-1

Signature
bandArithmeticCIg (parameters: CIgBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Creates CI (green) from a 4-band image whose bands are arranged in BGRI order.
const cig = rasterFunctionUtils.bandArithmeticCIg({
nirBandId: 3,
greenBandId: 1
});

bandArithmeticNDWI

Function

Creates a Band Arithmetic function to calculate NDWI. The Normalized Difference Water Index (NDWI) method is an index for delineating and monitoring content changes in surface water. It is computed with the NIR and green bands. See NDWI raster function.

Equation: NDWI = (Green - NIR) / (Green + NIR)

Signature
bandArithmeticNDWI (parameters: NDWIBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Creates NDWI from a 4-band image whose bands are arranged in BGRI order.
const ndwi = rasterFunctionUtils.bandArithmeticNDWI({
nirBandId: 3,
greenBandId: 1
});

bandArithmeticEVI

Function

Creates a Band Arithmetic function to calculate EVI. The Enhanced Vegetation Index (EVI) method is an optimized vegetation index that accounts for atmospheric influences and vegetation background signal. It's similar to NDVI but is less sensitive to background and atmospheric noise, and it does not become as saturated as NDVI when viewing areas with very dense green vegetation. See EVI raster function.

Equation: EVI = 2.5 * (NIR - Red) / (NIR + 6 * Red - 7.5 * Blue + 1)

Signature
bandArithmeticEVI (parameters: EVIBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Creates EVI from a 4-band image whose bands are arranged in BGRI order.
const evi = rasterFunctionUtils.bandArithmeticEVI({
nirBandId: 3,
redBandId: 2,
blueBandId: 0
});

bandArithmeticIronOxide

Function

Creates a Band Arithmetic function to calculate IronOxide. The Iron Oxide (ironOxide) ratio method is a geological index for identifying rock features that have experienced oxidation of iron-bearing sulfides using the red and blue bands. It is useful in identifying iron oxide features below vegetation canopies and is used in mineral composite mapping. See IronOxide raster function.

Equation: IronOxide = Red / Blue

Signature
bandArithmeticIronOxide (parameters: IronOxideBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
//Creates IronOxide from a 4-band image whose bands are arranged in BGRI order.
const ironOxide = rasterFunctionUtils.bandArithmeticIronOxide({
redBandId: 2,
blueBandId: 0
});

bandArithmeticFerrousMinerals

Function

Creates a Band Arithmetic function to calculate FerrousMinerals. The Ferrous Minerals (ferrousMinerals) ratio method is a geological index for identifying rock features containing some quantity of iron-bearing minerals using the SWIR and NIR bands. It is used in mineral composite mapping. See FerrousMinerals raster function.

Equation: FM = SWIR / NIR

Signature
bandArithmeticFerrousMinerals (parameters: FerrousMineralsBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Creates FerrousMinerals index.
const ferrousMinerals = rasterFunctionUtils.bandArithmeticFerrousMinerals({
swir1BandId: 6,
nirBandId: 3
});

bandArithmeticClayMinerals

Function

Creates a Band Arithmetic function to calculate ClayMinerals. The Clay Minerals (clayMinerals) ratio method is a geological index for identifying mineral features containing clay and alunite using two shortwave infrared (SWIR) bands. It is used in mineral composite mapping. See ClayMinerals raster function.

Equation: CM = SWIR1 / SWIR2

Signature
bandArithmeticClayMinerals (parameters: ClayMineralsBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
//Creates ClayMinerals index.
const clayMinerals = rasterFunctionUtils.bandArithmeticClayMinerals({
swir1BandId: 6,
swir2BandId: 7
});

bandArithmeticWNDWI

Function

Creates a Band Arithmetic function to calculate WNDWI. The Weighted Normalized Difference Water Index (WNDWI) method is a water index developed to reduce errors typically encountered in other water indices, including water turbidity, small water bodies, or shadow in remote sensing scenes.

Equation: WNDWI = [Green – α * NIR – (1 – α) * SWIR ] / [Green + α * NIR + (1 – α) * SWIR]

where a is weighted coefficient ranging from 0 to 1.

Signature
bandArithmeticWNDWI (parameters: WNDWIBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Creates WNDWI.
const wndwi = rasterFunctionUtils.bandArithmeticWNDWI({
greenBandId: 1,
nirBandId: 3,
swirBandId: 6
});

bandArithmeticBAI

Function

Creates a Band Arithmetic function to calculate BAI. The Burn Area Index (BAI) uses the reflectance values in the red and NIR portion of the spectrum to identify the areas of the terrain affected by fire. See BAI raster function.

Equation: BAI = 1/((0.1 -RED) * (0.1 -RED) + (0.06 - NIR) * (0.06 - NIR))

Signature
bandArithmeticBAI (parameters: BAIBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
//Creates BAI from a 4-band image whose bands are arranged in BGRI order.
const bai = rasterFunctionUtils.bandArithmeticBAI({
redBandId: 1,
nirBandId: 3
});

bandArithmeticNBR

Function

Creates a Band Arithmetic function to calculate NBR. The Normalized Burn Ratio Index (NBRI) uses the NIR and SWIR bands to emphasize burned areas, while mitigating illumination and atmospheric effects. Your images should be corrected to reflectance values before using this index. See NBR raster function.

Equation: NBR = (NIR - SWIR) / (NIR+ SWIR)

Signature
bandArithmeticNBR (parameters: NBRBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Creates NBR index.
const nbr = rasterFunctionUtils.bandArithmeticNBR({
nirBandId: 3,
swirBandId: 5
});

bandArithmeticNDBI

Function

Creates a Band Arithmetic function to calculate NDBI. The Normalized Difference Built-up Index (NDBI) uses the NIR and SWIR bands to emphasize manufactured built-up areas. It is ratio based to mitigate the effects of terrain illumination differences as well as atmospheric effects. See NDBI raster function.

Equation: NDBI = (SWIR - NIR) / (SWIR + NIR)

Signature
bandArithmeticNDBI (parameters: NDBIBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Creates NDBI index.
const ndbi = rasterFunctionUtils.bandArithmeticNDBI({
nirBandId: 3,
swirBandId: 5
});

bandArithmeticNDMI

Function

Creates a Band Arithmetic function to calculate NDMI. The Normalized Difference Moisture Index (NDMI) is sensitive to the moisture levels in vegetation. It is used to monitor droughts and fuel levels in fire-prone areas. It uses NIR and SWIR bands to create a ratio designed to mitigate illumination and atmospheric effects. See NDMI raster function.

Equation: NDMI = (NIR - SWIR1)/(NIR + SWIR1)

Signature
bandArithmeticNDMI (parameters: NDMIBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Creates NDMI index.
const ndmi = rasterFunctionUtils.bandArithmeticNDMI({
nirBandId: 3,
swirBandId: 5
});

bandArithmeticNDSI

Function

Creates a Band Arithmetic function to calculate NDSI. The Normalized Difference Snow Index (NDSI) is designed to use MODIS (band 4 and band 6) and Landsat TM (band 2 and band 5) for identification of snow cover while ignoring cloud cover. Since it is ratio based, it also mitigates atmospheric effects. See NDSI raster function.

Equation: NDSI = (Green - SWIR) / (Green + SWIR)

Signature
bandArithmeticNDSI (parameters: NDSIBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Calculates NDSI using Landsat 8.
const ndsi = rasterFunctionUtils.bandArithmeticNDSI({
greenBandId: 2,
swirBandId: 5
});

bandArithmeticMNDWI

Function

Creates a Band Arithmetic function to calculate MNDWI. The Modified Normalized Difference Water Index (MNDWI) uses green and SWIR bands for the enhancement of open water features. It also diminishes built-up area features that are often correlated with open water in other indices.

Equation: MNDWI = (Green - SWIR) / (Green + SWIR)

Signature
bandArithmeticMNDWI (parameters: MNDWIBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Creates MNDWI.
const mndwi = rasterFunctionUtils.bandArithmeticMNDWI({
greenBandId: 1,
swirBandId: 6
});

bandArithmeticCustom

Function

Creates a custom Band Arithmetic function. ser defined method. When using the user defined method to define your band arithmetic algorithm, you can enter a single-line algebraic formula to create a single-band output. The supported operators are -,+,/,*, and unary -. To identify the bands, add B or b to the beginning of the band number. See Band Arithmetic function.

equation: (b1 - b0) / (b1 + b0)

Signature
bandArithmeticCustom (parameters: CustomBandParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
//Creates a custom band arithmetic index that creates a normalized differential band ratio.
const ndvi = rasterFunctionUtils.bandArithmeticCustom({
bandIndexes: "(b1 - b0) / (b1 + b0)"
});

computeChange

Function
Since
ArcGIS Maps SDK for JavaScript 4.32

Creates a Compute Change function that analyzes changes between two rasters. Compute Change function.

Note: This function is supported on server side by ImageryLayer only.

See also
Signature
computeChange (parameters: ComputeChangeParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Compute the change between the two images.
layer.rasterFunction = rasterFunctionUtils.computeChange({
method: "difference",
raster: "$1",
raster2: "$2"
});
});

threshold

Function
Since
ArcGIS Maps SDK for JavaScript 4.32

Creates a Threshold function that creates a binary output, with 1 representing high pixel values. It uses the Otsu method and the input image is assumed to have a bimodal histogram. See Binary Thresholding function.

Note: This function is supported on server side by ImageryLayer only.

See also
Signature
threshold (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Create threshold function from a raster with bimodal histogram distribution.
layer.rasterFunction = rasterFunctionUtils.threshold({});

grayscale

Function
Since
ArcGIS Maps SDK for JavaScript 4.29

Converts a multiband image into a single-band grayscale image. Specified weights are applied to each of the input bands, and normalization is applied to the output image. The weights are often applied because some bands have variable importance depending on the application. For example, the blue band often contains more noise than other bands.

Signature
grayscale (parameters: GrayscaleParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The grayscale parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Clips image using user specifed extent and keeps the image that is inside the extent.
layer.rasterFunction = rasterFunctionUtils.grayscale({
weights: [3, 2, 5]
});

colorspaceConversion

Function
Since
ArcGIS Maps SDK for JavaScript 4.32

Creates a Color Space Conversion function that converts the color model between the hue, saturation, and value (HSV) color space and red, green, and blue (RGB). Color Model Conversion function.

Note: This function is supported on server side by ImageryLayer only.

See also
Signature
colorspaceConversion (parameters: ColorspaceConversionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Converts the image to hsv color space.
layer.rasterFunction = rasterFunctionUtils.colorspaceConversion({
conversionType: "rgb-to-hsv"
});

spectralConversion

Function
Since
ArcGIS Maps SDK for JavaScript 4.32

Creates a Spectral Conversion function that applies a matrix to a multiband image to affect the color values of the output. Each pixel of the output is the dot product of the conversion matrix and the raster pixel value vector. See Spectral Conversion function.

See also
Signature
spectralConversion (parameters: SpectralConversionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Creates a spectral conversion function from a raster with 3 bands.
layer.rasterFunction = rasterFunctionUtils.spectralConversion({
conversionMatrix: [0.5, 0.3, 0.2, 0.1, 0.8, 0.1, 0.1, 0.1, 0.8]
});

tasseledCap

Function
Since
ArcGIS Maps SDK for JavaScript 4.32

Creates a Tasseled Cap (Kauth-Thomas) transformation function to analyze and map vegetation phenomenology and urban development changes detected by various satellite sensor systems. See Tasseled Cap function.

Note: This function is supported on server side by ImageryLayer only.

See also
Signature
tasseledCap (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.tasseledCap({});

colormap

Function

Creates a Colormap function to define a colormap for a raster by specifying a corresponding color for each pixel value. See Colormap function.

Signature
colormap (parameters: ColormapParameters | ColormapByNameParameters | ColormapByRampParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object.

Returns
RasterFunction

Returns a RasterFunction.

Examples
// Creates a colormap to map pixel value 0 to red and 10 to green.
const colormap = rasterFunctionUtils.colormap({
colormap: [
[0, 255, 0, 0],
[10, 0, 255, 0]
]
});
// Creates a colormap to map pixel value 0 to red and 10 to green.
const colormap = rasterFunctionUtils.colormap({
colormap: [
{value: 0, color: "red"},
{value: 10, color: "green"}
]
});
// Creates a colormap to map pixel value 0 to red and 10 to green.
const colormap = rasterFunctionUtils.colormap({
colormap: [
{value: 0, color: "#ff0000"},
{value: 10, color: "#00ff00"}
]
});
// Creates a colormap to map pixel value using a named colorramp
const colormap = rasterFunctionUtils.colormap({
colorRampName: "red-to-green"
});

colormapToRGB

Function
Since
ArcGIS Maps SDK for JavaScript 4.31

Works with a single band image service that has an internal color map. It converts the image to a three-band 8-bit RGB raster. For more information, see Colormap To RGB function.

Signature
colormapToRGB (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

statisticsHistogram

Function

Creates a Statistics And Histogram function to define the statistics and histogram of a raster. See Statistics And Histogram function.

Signature
statisticsHistogram (parameters: StatisticsHistogramParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// attach statistics and histograms to the input imagery.
const statsHistFunction = rasterFunctionUtils.statisticsHistogram({
statistics: [{ min: 1, max: 5, mean: 3, standardDeviation: 1 }],
histograms: [{ min: 1, max: 5, counts: [100, 200, 100, 200, 100] }]
});

table

Function

Creates an Attribute Table function to specify an attribute table for the input categorical raster. See Attribute Table function.

Signature
table (parameters: TableParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Attach a classification table to the categorical imagery data.
const attributeTable = FeatureSet.fromJSON({
displayFieldName: "",
fields: [
{
name: "ObjectID",
type: "esriFieldTypeOID",
alias: "OID"
},
{
name: "Value",
type: "esriFieldTypeInteger",
alias: "Value"
},
{
name: "ClassName",
type: "esriFieldTypeString",
alias: "ClassName",
length: 256
},
{
name: "Red",
type: "esriFieldTypeInteger",
alias: "Red"
},
{
name: "Green",
type: "esriFieldTypeInteger",
alias: "Green"
},
{
name: "Blue",
type: "esriFieldTypeInteger",
alias: "Blue"
},
{
name: "Alpha",
type: "esriFieldTypeInteger",
alias: "Alpha"
}
],
features: [
{
attributes: {
ObjectID: 1,
Value: 10,
ClassName: "c0",
Red: 255,
Green: 190,
Blue: 190,
Alpha: 255
}
},
{
attributes: {
ObjectID: 2,
Value: 11,
ClassName: "c1",
Red: 255,
Green: 127,
Blue: 127,
Alpha: 255
}
}
]
});
const tableFunction = rasterFunctionUtils.table({ attributeTable });

extractBand

Function

Creates an Extract Band function to extract one or more bands from a multiband raster. To use bandNames or bandWavelengths, the data source must have corresponding key properties information. See Extract Band function.

Signature
extractBand (parameters: ExtractBandByIdParameters | ExtractBandByNameParameters | ExtractBandByWavelengthParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Creates a false color composite from a Landsat TM multispectral image.
const nrg = rasterFunctionUtils.extractBand({
bandIds: [3, 2, 1]
});
const nrg = rasterFunctionUtils.extractBand({
bandNames: ["NearInfrared_1", "Red", "Green"]
});
const nrg = rasterFunctionUtils.extractBand({
bandWavelengths: [800, 650, 550]
});

createColorComposite

Function
Since
ArcGIS Maps SDK for JavaScript 4.32

Creates a Color Composite function that produces a three-band raster from a multiband raster dataset in which each band can use an algebraic calculation based on band algebra. Create Color Composite function

Note: This function is supported on server side by ImageryLayer only.

See also
Signature
createColorComposite (parameters: ColorCompositeByIdParameters | ColorCompositeByNameParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for creating a custom color composite from input raster..

Returns
RasterFunction

Returns a RasterFunction.

Example
// Create a color composite using the first two bands.
const rasterFunction = rasterFunctionUtils.createColorComposite({
method: "name",
redBand: "B1",
greenBand: "B2",
blueBand: "B1-B2"
});

compositeBand

Function

Creates a Composite Bands function to combine multiple inputs into one multiband raster. See Composite Bands function.

Signature
compositeBand (parameters: BaseNRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

remap

Function

Creates a Remap function to change or reclassify the pixel values of the raster. See Remap function.

Signature
remap (parameters: RemapParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Remap costal elevation values into flood risk categories.
const warmWater = rasterFunctionUtils.remap({
rangeMaps: [
{ range: [-100, 10], output: 0 },
{ range: [10, 1000], output: 200 }
]
});

transposeBits

Function
Since
ArcGIS Maps SDK for JavaScript 4.32

Creates a Transpose Bits function that unpacks the bits of the input pixel and maps them to specified bit locations in the output pixel. Use this function to manipulate multiple bit sequences from an input, such as the Landsat 8 quality band. See Transpose Bits function.

Note: This function is supported on server side by ImageryLayer only.

See also
Signature
transposeBits (parameters: TransposeBitsParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.transposeBits({
inputBitPositions: [4, 5],
outputBitPositions: [0, 1],
raster: "$2", // the image whose objectId is 2 in a dynamic image service
});
});

mask

Function

Creates a Mask function to specify one or more NoData values, or a range of valid pixel values, to be removed from an output raster. See Mask function.

Signature
mask (parameters: MaskParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Only show sea surface temperature above 10 degrees.
const warmWater = rasterFunctionUtils.mask({
includedRanges: [[10, 50]]
});

clip

Function
Since
ArcGIS Maps SDK for JavaScript 4.29

Extracts a portion of an image based on an Extent or a Polygon geometry. The clip output includes any pixels that intersect the clip geometry.

Signature
clip (parameters: ClipParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The clip parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Clips image using user specifed extent and keeps the image that is inside the extent.
layer.rasterFunction = rasterFunctionUtils.clip({
geometry: extent,
keepOutside: false
});

plus

Function

Creates a raster function that adds (sums) the values of two rasters on a pixel-by-pixel basis. See Plus function.

Signature
plus (parameters: Base2RasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on two input rasters.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.plus({
raster: rasterFunctionUtils.defaultRaster,
raster2: 100,
outputPixelType: "u16"
});

minus

Function

Creates a raster function that subtracts the value of the second input raster from the value of the first input raster on a pixel-by-pixel basis. See Minus function.

Signature
minus (parameters: Base2RasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on two input rasters.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.minus({
raster: rasterFunctionUtils.defaultRaster,
raster2: 1,
outputPixelType: "s16"
});

times

Function

Creates a raster function that multiplies the values of two rasters on a pixel-by-pixel basis. See Times function.

Signature
times (parameters: Base2RasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on two input rasters.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.times({
raster: rasterFunctionUtils.defaultRaster,
raster2: 1
});

sqrt

Function

Creates a raster function that calculates the square root of the pixel values in a raster. See Suqare Root function.

Signature
sqrt (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.sqrt({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "f32"
});

power

Function

Creates a raster function that raises the pixel values in a raster to the power of the values found in another raster. See Power function.

Signature
power (parameters: Base2RasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on two input rasters.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.power({
raster: rasterFunctionUtils.defaultRaster,
raster2: 1
});

acos

Function

Creates a raster function that calculates the inverse cosine of the pixels in a raster. See ACos function.

Signature
acos (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.acos({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "f32"
});

asin

Function

Creates a raster function that calculates the inverse sine of the pixels in a raster. See ASin function.

Signature
asin (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.asin({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "f32"
});

atan

Function

Creates a raster function that calculates the inverse tangent of the pixels in a raster. See Atan function.

Signature
atan (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.atan({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "f32"
});

atanh

Function

Creates a raster function that calculates the inverse hyperbolic tangent of the pixels in a raster. See Atanh function.

Signature
atanh (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.atanh({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "f32"
});

abs

Function

Creates a raster function that calculates the absolute value of the pixels in a raster. See Abs function.

Signature
abs (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.abs({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "f32"
});

bitwiseAnd

Function

Creates a raster function that performs a Bitwise And operation on the binary values of two input rasters. See Bitwise And function.

Signature
bitwiseAnd (parameters: Base2RasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on two input rasters.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.bitwiseAnd({
raster: rasterFunctionUtils.defaultRaster,
raster2: 1
});

bitwiseLeftShift

Function

Creates a raster function that performs a Bitwise Left Shift operation on the binary values of two input rasters. See Bitwise Left Shift function.

Signature
bitwiseLeftShift (parameters: Base2RasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on two input rasters.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.bitwiseLeftShift({
raster: rasterFunctionUtils.defaultRaster,
raster2: 1
});

bitwiseNot

Function

Creates a raster function that performs a Bitwise Not (complement) operation on the binary value of an input raster. See Bitwise Not function.

Signature
bitwiseNot (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.bitwiseNot({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "s16"
});

bitwiseOr

Function

Creates a raster function that performs a Bitwise Or operation on the binary values of two input rasters. See Bitwise Or function.

Signature
bitwiseOr (parameters: Base2RasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on two input rasters.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.bitwiseOr(
raster: rasterFunctionUtils.defaultRaster,
raster2: 1
});

bitwiseRightShift

Function

Creates a raster function that performs a Bitwise Right Shift operation on the binary values of two input rasters. See Bitwise Right Shift function.

Signature
bitwiseRightShift (parameters: Base2RasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on two input rasters.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.bitwiseRightShift({
raster: rasterFunctionUtils.defaultRaster,
raster2: 1
});

bitwiseXor

Function

Creates a raster function that performs a Bitwise Xor operation on the binary values of two input rasters. See Bitwise Xor function.

Signature
bitwiseXor (parameters: Base2RasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on two input rasters.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.bitwiseXor({
raster: rasterFunctionUtils.defaultRaster,
raster2: 1
});

booleanAnd

Function

Creates a raster function that performs a Boolean And operation on the pixel values of two input rasters See Boolean And function.

Signature
booleanAnd (parameters: Base2RasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on two input rasters.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.booleanAnd({
raster: rasterFunctionUtils.defaultRaster,
raster2: 1
});

booleanNot

Function

Creates a raster function that performs a Boolean Not (complement) operation on the pixel values of the input raster. See Boolean Not function.

Signature
booleanNot (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.booleanNot({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "u8"
});

booleanOr

Function

Creates a raster function that performs a Boolean Or operation on the pixel values of two input rasters See Boolean Or function.

Signature
booleanOr (parameters: Base2RasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on two input rasters.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.booleanOr({
raster: rasterFunctionUtils.defaultRaster,
raster2: 1
});

booleanXor

Function

Creates a raster function that performs a Boolean Xor operation on the pixel values of two input rasters See Boolean Xor function.

Signature
booleanXor (parameters: Base2RasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on two input rasters.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.booleanXor({
raster: rasterFunctionUtils.defaultRaster,
raster2: 1
});

cos

Function

Creates a raster function that calculates the cosine of the pixels in a raster. See Cos function.

Signature
cos (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.cos({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "f32"
});

cosh

Function

Creates a raster function that calculates the hyperbolic cosine of the pixels in a raster. See Cosh function.

Signature
cosh (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.cosh({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "f32"
});

divide

Function

Creates a raster function that divides the values of two rasters on a pixel-by-pixel basis. See Divide function.

Signature
divide (parameters: Base2RasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on two input rasters.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.divide({
raster: rasterFunctionUtils.defaultRaster,
raster2: 1
});

equalTo

Function

Creates a raster function that performs an equal-to operation on two rasters on a pixel-by-pixel basis. See Equal To function.

Signature
equalTo (parameters: Base2RasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on two input rasters.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.equalTo({
raster: rasterFunctionUtils.defaultRaster,
raster2: 1
});

exp

Function

Creates a raster function that calculates the base e exponential of the pixels in a raster. See Exp function.

Signature
exp (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.exp({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "f32"
});

exp10

Function

Creates a raster function that calculates the base 10 exponential of the pixels in a raster. See Exp10 function.

Signature
exp10 (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.exp10({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "f32"
});

exp2

Function

Creates a raster function that calculates the base 2 exponential of the pixels in a raster. See Exp2 function.

Signature
exp2 (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.exp2({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "f32"
});

greaterThan

Function

Creates a raster function that performs a relational greater-than operation on two rasters on a pixel-by-pixel basis. See Greater Than function.

Signature
greaterThan (parameters: Base2RasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on two input rasters.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.greaterThan({
raster: rasterFunctionUtils.defaultRaster,
raster2: 1
});

greaterThanEqual

Function

Creates a raster function that performs a relational greater-than-or-equal-to operation on two rasters on a pixel-by-pixel basis. See Greater Than Equal function.

Signature
greaterThanEqual (parameters: Base2RasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on two input rasters.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.greaterThanEqual({
raster: rasterFunctionUtils.defaultRaster,
raster2: 1
});

int

Function

Creates a raster function that converts each pixel value of a raster to an integer by truncation. See Int function.

Signature
int (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.int({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "u32"
});

isNull

Function

Creates a raster function that determines which values from the input raster are NoData on a pixel-by-pixel basis. See Is Null function.

Signature
isNull (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.isNull({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "u8"
});

float

Function

Creates a raster function that converts each pixel value of a raster into a floating-point representation. See Float function.

Signature
float (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.float({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "f32"
});

lessThan

Function

Creates a raster function that performs a relational less-than operation on two rasters on a pixel-by-pixel basis. See Less Than function.

Signature
lessThan (parameters: Base2RasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on two input rasters.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.lessThan({
raster: rasterFunctionUtils.defaultRaster,
raster2: 1
});

lessThanEqual

Function

Creates a raster function that performs a relational less-than-or-equal-to operation on two rasters on a pixel-by-pixel basis. See Less Than Equal function.

Signature
lessThanEqual (parameters: Base2RasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on two input rasters.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.lessThanEqual({
raster: rasterFunctionUtils.defaultRaster,
raster2: 1
});

log

Function

Creates a raster function that calculates the natural logarithm (base e) of each pixel in a raster. See Ln function.

Signature
log (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.log({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "f32"
});

log10

Function

Creates a raster function that calculates the base 10 logarithm of each pixel in a raster. See Log10 function.

Signature
log10 (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.log10({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "f32"
});

log2

Function

Creates a raster function that calculates the base 2 logarithm of each pixel in a raster. See Log2 function.

Signature
log2 (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.log2({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "f32"
});

mod

Function

Creates a raster function that finds the remainder (modulo) of the first raster when divided by the second raster on a pixel-by-pixel basis. See Mod function.

Signature
mod (parameters: Base2RasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on two input rasters.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.mod({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "f32"
});

negate

Function

Creates a raster function that finds the changes the sign (multiplies by -1) of the pixel values of the input raster on a pixel-by-pixel basis. See Negate function.

Signature
negate (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.negate({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "f32"
});

notEqual

Function

Creates a raster function that performs a relational not-equal-to operation on two rasters on a pixel-by-pixel basis. See Not Equal function.

Signature
notEqual (parameters: Base2RasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on two input rasters.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.notEqual({
raster: rasterFunctionUtils.defaultRaster,
raster2: 1
});

roundDown

Function

Creates a raster function that returns the next lower integer, as a floating-point value, for each pixel in a raster. See Round Down function.

Signature
roundDown (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.roundDown({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "s16"
});

roundUp

Function

Creates a raster function that returns the next higher integer, as a floating-point value, for each pixel in a raster. See Round Up function.

Signature
roundUp (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.roundUp({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "s16"
});

sin

Function

Creates a raster function that calculates the sine of the pixels in a raster. See Sin function.

Signature
sin (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.sin({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "f32"
});

sinh

Function

Creates a raster function that calculates the hyperbolic sine of the pixels in a raster. See Sinh function.

Signature
sinh (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.sinh({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "f32"
});

square

Function

Creates a raster function that calculates the square of the pixel values in a raster. See Square function.

Signature
square (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.square({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "f32"
});

tan

Function

Creates a raster function that calculates the tangent of the pixels in a raster. See Tan function.

Signature
tan (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.tan({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "f32"
});

tanh

Function

Creates a raster function that calculates the hyperbolic tangent of the pixels in a raster. See Tanh function.

Signature
tanh (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.tanh({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "f32"
});

acosh

Function

Creates a raster function that calculates the inverse hyperbolic cosine of the pixels in a raster. See Acosh function.

Signature
acosh (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.acosh({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "f32"
});

asinh

Function

Creates a raster function that calculates the inverse hyperbolic sine of the pixels in a raster. See Asinh function.

Signature
asinh (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on an input raster.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.asinh({
raster: rasterFunctionUtils.defaultRaster,
outputPixelType: "f32"
});

atan2

Function

Creates a raster function that calculates the inverse tangent (based on x,y) of the pixels in a raster. See Atan2 function.

Signature
atan2 (parameters: Base2RasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for performing math operations on two input rasters.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.atan2({
raster: rasterFunctionUtils.defaultRaster,
raster2: 1
});

setNull

Function

Creates a raster function that sets the truthy pixels (value is not 0) to NoData, and falsy pixels (value is 0) to the pixel value of the false raster. See Set Null function.

Signature
setNull (parameters: SetNullParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The set null parameters object.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.setNull({
raster: rasterFunctionUtils.defaultRaster,
falseRaster: 1,
outputPixelType: "u8"
});

conditional

Function

Creates a raster function that sets the truthy pixels (value is not 0) to the pixel value from a true raster, and falsy pixels (value is 0) to the pixel value of the false raster. See Con function.

Signature
conditional (parameters: ConditionalParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The conditional parameters object.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.conditional({
raster: rasterFunctionUtils.defaultRaster,
trueRaster: 100,
falseRaster: 10,
outputPixelType: "u8"
});

cellStatistics

Function

Creates a raster function that calculates a statistic from multiple rasters, on a pixel-by-pixel basis. The available statistics are majority, maximum, mean, median, minimum, minority, percentile, range, standard deviation, sum, and variety. See Cell Statistics function.

Signature
cellStatistics (parameters: CellStatisticsParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.conditional({
rasters: [rasterFunctionUtils.defaultRaster],
statisticsType: "majority",
processAsMultiband: true
});

calculate

Function
Since
ArcGIS Maps SDK for JavaScript 4.32

Creates a Raster Calculator function that performs mathematical operations using a custom expression on a set of inputs.

Note: This function is supported on server side by ImageryLayer only.

See also
Signature
calculate (parameters: CalculatorParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Calculate the difference between two images.
layer.rasterFunction = rasterFunctionUtils.calculate({
inputNames: ["raster1", "raster2"],
expression: "raster1 - raster2",
raster: ["$1", "$2"], // the selected images from a dynamic image service
});
});

weightedSum

Function
Since
ArcGIS Maps SDK for JavaScript 4.32

Creates a Weighted Sum function that adds up several rasters weighted by their importance. See Weighted Sum function.

Note: This function is supported on server side by ImageryLayer only.

See also
Signature
weightedSum (parameters: WeightedSumParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Perform weighted sum of three single band images.
layer.rasterFunction = rasterFunctionUtils.weightedSum({
weights: [0.5, 0.3, 0.2],
raster: ["$1", "$2", "$3"], // the selected images from a dynamic image service
fields: ["Value", "Value", "Value"]
});
});

weightedOverlay

Function
Since
ArcGIS Maps SDK for JavaScript 4.32

Creates a Weighted Overlay function that overlays several rasters using a common measurement scale and weights each according to its importance. See Weighted Overlay function.

Note: This function is supported on server side by ImageryLayer only.

See also
Signature
weightedOverlay (parameters: WeightedOverlayParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Perform weighted overlay of three single band images.
layer.rasterFunction = rasterFunctionUtils.weightedOverlay({
weights: [0.5, 0.3, 0.2],
minScale: 0,
maxScale: 10,
raster: ["$1", "$2", "$3"], // the selected images from a dynamic image service
});
});

aspect

Function

Creates a Aspect function to identify the downslope direction of the maximum rate of change in value from each cell to its neighbors. Aspect can be thought of as the slope direction. The values of the output raster are the compass direction of the aspect. See Aspect function.

Signature
aspect (parameters: BaseRasterFunctionParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Create aspect from elevation data.
const aspect = rasterFunctionUtils.aspect({});

slope

Function

Creates a Slope function that calculates the rate of change of elevation for each digital elevation model (DEM) cell. It's the first derivative of a DEM. See Slope function.

Signature
slope (parameters: SlopeParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Create a slope from elevation data.
const slope = rasterFunctionUtils.slope({
slopeType: "degree",
zFactor: 1
});

hillshade

Function
Since
ArcGIS Maps SDK for JavaScript 4.31

Creates a hillshade function. The hillshade function produces a grayscale 3D representation of the terrain surface, with the sun's relative position taken into account for shading the image. For more information, see Hillshade function and How Hillshade works.

Signature
hillshade (parameters: HillshadeParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Create hillshade.
const hillshade = rasterFunctionUtils.hillshade({
aAzimuth: 215.0,
altitude: 75.0,
zFactor: 0.3
});

shadedRelief

Function
Since
ArcGIS Maps SDK for JavaScript 4.31

The ShadedRelief function creates a color 3D model of the terrain by merging the images from the elevation-coded and hillshade methods. For more information, see Shaded Relief function. You can specify a colormap or colorramp value to render the shaded relief results.

Signature
shadedRelief (parameters: ShadedReliefWithColorRampParameters | ShadedReliefWithColormapParameters | ShadedReliefWithColorRampNameParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters used to generate the shaded relief raster function.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Create shaded relief.
const shadedRelief = rasterFunctionUtils.shadedRelief({
azimuth: 215.0,
altitude": 75.0,
zFactor": 0.3,
colorMap": [
[1, 255, 0, 0],
[2, 0, 255, 0],
[3, 125, 25, 255]
]
});

curvature

Function

Creates a Curvature function that calculates the shape or curvature of the slope. A part of a surface can be concave or convex; you can tell that by looking at the curvature value. The curvature is calculated by computing the second derivative of the surface. See Curvature function.

Signature
curvature (parameters: CurvatureParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Create curvature from elevation data.
const slope = rasterFunctionUtils.curvature({
curvatureType: "standard",
zFactor: 1
});

statistics

Function

Creates a Statistics function that calculates focal statistics for each pixel of an image based on a defined focal neighborhood. See Statistics function.

Signature
statistics (parameters: StatisticsParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

The parameters object has the following properties.

Returns
RasterFunction

Returns a RasterFunction.

Example
// Create majority statistics function to get rid of noises in the image.
const slope = rasterFunctionUtils.statistics({
statisticsType: "majority",
rows: 3,
cols: 3
});

argStatistics

Function
Since
ArcGIS Maps SDK for JavaScript 4.32

Creates a raster function that calculates a statistical metric from all bands of input rasters.

All raster bands from input rasters are stacked together according to their input order and assigned a 0-based incremental band index, so the second raster will start from the first raster's band count, and the last band index of the last raster is totalBandCount - 1.

The "min", "max", and "median" statisticsType returns the band index for which the given pixel attains its min, max or median value from all bands. The "duration" statisticsType finds the longest consecutive elements in the array, where each element has a value between the specified minValue and maxValue, inclusive, and returns its length.

Note: This function is supported on server side by ImageryLayer only.

Signature
argStatistics (parameters: ArgStatisticsParameters | ArgStatisticsDurationParameters): RasterFunction
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for calculating arguments of the statistics on input rasters.

Returns
RasterFunction

Returns a RasterFunction.

Example
layer.rasterFunction = rasterFunctionUtils.argStatistics({
rasters: [rasterFunctionUtils.defaultRaster],
statisticsType: "min",
undefinedClass: 0
});

Variables

defaultRaster

Variable

A token representing the image service raster.

Type
"$$"