An overview of the Spatial Analyst functions

Available with Spatial Analyst license.

Available with Image Analyst license.

The Spatial Analyst extension supports many functions in ArcPy for processing and creating rasters or raster objects. They are organized into related groupings in the following categories: Analysis, Appearance, Conversion, Correction, Data Management, Math, Reclassification, Statistical, and Surface.

Many of these functions, available with the arcpy.sa module, do not require a Spatial Analyst license. Where applicable, the license requirements for each function are listed in the function documentation. A number of functions are also available with the arcpy.ia module, and similarly do not require the Image Analyst license. If the function requires a license and you are working with a Concurrent Use license, you can use the CheckOutExtension function to access the functionality.

Analysis

FunctionDescription

Anomaly

Creates a raster object that contains the anomaly pixel values of the input multidimensional raster based on a time-dimension interval and the anomaly calculation method.

Apply

Creates a raster object by applying a raster function or function chain to one or more input rasters.

Foreach

Creates a raster object by applying a raster function or a customized function template to every slice in the input multidimensional raster.

HeatIndex

Calculates apparent temperature based on ambient temperature and relative humidity. The apparent temperature is often described as how hot it feels to the human body.

TasseledCap

Creates a raster object by applying a tasseled cap transformation on an input raster.

Threshold

Creates a raster object by dividing an input raster into two distinct classes, where a high-value class is displayed with white pixels and a low-value class is displayed with black pixels.

WindChill

Identifies dangerous winter conditions that, depending on exposure times to the elements, can result in frostbite or hypothermia.

Appearance

FunctionDescription

ContrastBrightness

Creates an enhanced image by improving the contrast and brightness of the source image.

Convolution

Performs filtering on the pixel values in an image, which can be used for sharpening an image, blurring an image, detecting edges within an image, or other kernel-based enhancements.

Pansharpen

Creates a higher-resolution multiband image by fusing a lower-resolution multispectral image and a higher-resolution panchromatic image.

StatisticsHistogram

Computes the statistics and histogram of a raster.

Stretch

Enhances an image by changing properties such as brightness, contrast, and gamma through multiple stretch types based on statistics.

VectorFieldRenderer

Visualize flow direction and magnitude information in your raster with vector symbols.

Conversion

FunctionDescription

Colormap

Transforms the pixel values to display the raster data as either a grayscale or an RGB color image based on a color scheme or specific colors in a color map file.

ColormapToRGB

Converts a single-band raster with a color map to a three-band (red, green, and blue) raster.

ColorspaceConversion

Converts the color model of a three-band unsigned 8-bit image from either the hue, saturation, and value (HSV) to red, green, and blue (RGB) or vice versa.

Complex

Computes the magnitude from complex values.

Grayscale

Converts a multiband image into a single-band grayscale image. Specified weights are applied to each of the input bands, and a normalization is applied for output.

SpectralConversion

Applies a matrix to a multiband image to affect the color values of the output.

UnitConversion

Converts pixels from one unit to another. It supports conversion of distance, speed, and temperature.

VectorField

Combines and converts two rasters into a two-band raster that is of either data type Magnitude-Direction or data type U-V.

Correction

FunctionDescription

Speckle

Creates a raster object by removing speckle and smoothing out noise in radar datasets, while retaining edges and sharp features in the image.

Data Management

FunctionDescription

ApplyEnvironment

Creates a new raster that is a copy of the input raster with the current environment settings being applied.

CompositeBand

Creates a raster object by combining multiple rasters to form a multiband image.

ExtractBand

Creates a raster object by extracting one or more bands from, or reordering the bands in, a multiband raster.

Mask

Creates a raster object by specifying one or more NoData values or a range of valid pixel values.

Resample

Creates a raster object by changing the spatial resolution of the input raster and sets rules for aggregating or interpolating values across the new pixel sizes.

Subset

Creates a raster object that is a subset of the input multidimensional raster based on selected variables and dimension intervals.

TransposeBits

Creates a raster object by unpacking the bits of the input pixel and mapping them to specified bits in the output pixel. The purpose of this function is to manipulate bits from a couple of inputs, such as the Landsat 8 quality band products.

Math

FunctionDescription

Arithmetic

Performs an arithmetic operation between two rasters or between a raster and a scalar and returns a raster object with the operation applied.

BandArithmetic

Performs an arithmetic operation on the bands of a multiband raster object and returns a raster object with the operation applied.

CIg

Calculates the Green Chlorophyll Index (CIg) from a multiband raster object and returns a raster object with the index values.

CIre

Calculates the Red-Edge Chlorophyll Index (CIre) from a multiband raster object and returns a raster object with the index values.

ClayMinerals

Calculates the Clay Minerals (CM) ratio from a multiband raster object and returns a raster object with the index values.

EVI

Calculates the Enhanced Vegetation Index (EVI) from a multiband raster object and returns a raster object with the index values.

FerrousMinerals

Calculates the Ferrous Minerals (FM) ratio from a multiband raster object and returns a raster object with the index values.

GEMI

Calculates the Global Environmental Monitoring Index (GEMI) from a multiband raster object and returns a raster object with the index values.

GNDVI

Calculates the Green Normalized Difference Vegetation Index (GNDVI) from a multiband raster object and returns a raster object with the index values.

GVITM

Calculates the Green Vegetation Index for Landsat TM (GVITM) from a Landsat TM image and returns a raster object with the index values.

IronOxide

Calculates the Iron Oxide (IO) ratio from a multiband raster object and returns a raster object with the index values.

MSAVI

Calculates the Modified Soil Adjusted Vegetation Index (MSAVI2) from a multiband raster object and returns a raster object with the index values.

MTVI2

Calculates the Modified Triangular Vegetation Index (MTVI2) from a multiband raster object and returns a raster object with the index values.

NDVI

Calculates the Normalized Difference Vegetation Index (NDVI) from a multiband raster object and returns a raster object with the index values.

NDVIre

Calculates the Red-Edge Normalized Difference Vegetation Index (NDVIre) from a multiband raster object and returns a raster object with the index values.

NDWI

Calculates the Normalized Difference Water Index (NDWI) from a multiband raster object and returns a raster object with the index values.

PVI

Calculates the Perpendicular Vegetation Index (PVI) from a multiband raster object and returns a raster object with the index values.

RasterCalculator

Provides access to all existing math functions and returns a raster object with the mathematical operation applied.

RTVICore

Calculates the Red-Edge Triangulated Vegetation Index (RTVICore) from a multiband raster object and returns a raster object with the index values.

SAVI

Calculates the Soil Adjusted Vegetation Index (SAVI) from a multiband raster object and returns a raster object with the index values.

SRre

Calculates the Red-Edge Simple Ratio (SRre) from a multiband raster object and returns a raster object with the index values.

Sultan

Calculates Sultan's formula from a six-band 8-bit raster object and returns a three-band 8-bit raster object.

TSAVI

Calculates the Transformed Soil Adjusted Vegetation Index (TSAVI) from a multiband raster object and returns a raster object with the index values.

VARI

Calculates the Visible Atmospherically Resistant Index (VARI) from a multiband raster object and returns a raster object with the index values.

Reclass

FunctionDescription

Remap

Categorizes the pixel values of the raster data into groups with specific values.

Statistical

FunctionDescription

ArgStatistics

Creates a raster object where each pixel contains the band index at which that pixel reached the statistical argument. If the input raster is multidimensional, the output raster object will contain dimension values instead of band indices.

Statistics

Calculates statistics for each cell of an image based on a defined focal neighborhood.

Surface

FunctionDescription

AspectSlope

Creates a raster object that simultaneously displays the aspect and slope of a surface.

ElevationVoidFill

Creates pixels on a raster object where holes exist in the elevation.

ShadedRelief

Creates a color 3D representation of the terrain by merging the images from the elevation-coded and hillshade methods.

Related topics