Single Output Map Algebra

Runs a single expression built with the Map Algebra language.


Usage tips

Command line and Scripting

Syntax

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

# Single_Output_Map_Algebra_sample.py
# 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()

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

    # Check out Spatial Analyst extension license
    gp.CheckOutExtension("Spatial")

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

except:
    # 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