Single Output Map Algebra

Runs a single expression built with the Map Algebra language.

Usage tips

Command line and Scripting


SingleOutputMapAlgebra_sa (expression_string, out_raster, in_data)
Parameter Explanation Datatype
Map Algebra expression (Required)

The string containing the expression you want to run, constructed with the Map Algebra language.

An example expression is:

slope (D:\data\surf_1, percentrise, 2)

MapAlgebra Expression
Output raster (Required)

The output raster to be created from the Map Algebra expression.

Raster Dataset
Input raster or feature data (Optional)

The list of input data that can be shown in Model Builder.

The inputs can be raster or feature data.

Composite Geodataset
Data types for geoprocessing tool parameters

Script Example

# Description: 
#   Runs an expression built with the Map Algebra language to 
#   output a new raster dataset.
# Requirements: None
# Author: ESRI
# Date: Sept 6, 2005

# Import system modules
import arcgisscripting

# Create the Geoprocessor object
gp = arcgisscripting.create()

    # Set local variables
    InExpression = "focalsum(C:/data/flowdir, Circle, 3)"
    OutRaster = "C:/data/soma01"

    # Check out Spatial Analyst extension license

    # Process: MapAlgebraStatement
    gp.SingleOutputMapAlgebra_sa(InExpression, OutRaster)

    # If an error occurred while running a tool, then print the messages.
    print gp.GetMessages()

Map Algebra syntax

Not Available.

You can use the Raster Calculator to issue a Map Algebra expression.

ArcObjects syntax

Not Available.

See Also

  • Multi Output Map Algebra
  • An overview of the Map Algebra tools