Tool parameters in map algebra

Available with Spatial Analyst license.

Tool parameters define how a tool processes input data. Tool parameters are composed of keywords, values, and classes.

Tool parameter rules

The following are tool parameter rules.

Parameter keywords

A keyword parameter such as output_measurement has specific preset keywords (DEGREE, PERCENT_RISE), which are enclosed in quotation marks. Keywords are not case sensitive, but it is recommended that you capitalize them for readability.

# Usage: Slope(in_raster, {output_measurement}, {z_factor})

# DEGREE will be used as the default output measurement in the 
#  following statement
outRas = Slope("elevation", "DEGREE")

Numerical values

Parameters that are numerical values are typically not in quotation marks.

# In the following statement, 4 is the zfactor parameter value
outRas = Slope("inraster", "DEGREE", 4)

Classes

Some input parameters are classes. Classes are used when geoprocessing tool parameters would otherwise be a more complicated string equivalent.

The specific arguments for the class are enclosed in parentheses. String input is in quotation marks, and numbers are not; parameters are comma delimited.

outRas = FocalStatistics("inraster", NbrAnnulus(1, 3, "MAP"), "VARIETY")

For additional information, see Spatial Analyst classes.

Default value for an optional parameter

To specify a default value for an optional parameter, you must use empty quotation marks.

# In the following statement the slope calculations will 
#  default to DEGREE; 4 is the z value
outRas = Slope("inraster", "", 4)

Related topics


In this topic
  1. Tool parameter rules