Skip To Content

Creating output

Available with Spatial Analyst license.

All Map Algebra tools and operators produce output. For most Map Algebra tools and operators, a raster object is the output to the left of an equal sign.

Output rules

  • Operators or tools that result in a raster produces a raster object identified to the left of an equal sign. In this case the Raster object points to a temporary raster dataset .
    outSlope = Slope("indem")
  • The output raster object created from one statement can be directly used in subsequent statements.
    outDirection = FlowDirection("inelevation")
    outAccumulation = FlowAccumulation(outDirection)
  • The referenced raster dataset of the resultant raster object is temporary and will be removed from disk when the ArcGIS session is ended. You can save the referenced raster dataset permanently by calling the save method on the raster object.
    outSlope = Slope("indem")
    outSlope.save("sloperaster")
    For additional cases of how the referenced dataset for a raster object can become permanent, see

    For more information on the raster object and its properties and methods, see Creating a raster object.

  • When a tool can create more than one output, the optional output will be expressed as tool parameters within parentheses to the right of the equal sign. Optional raster outputs are permanent datasets on disk; they are not raster objects.
    # Empty "" indicate use the default values for the parameter. 
    #   In the following statement the defaults are taken for 
    #   maximum_distance and cell_size parameters. outdirection will be a 
    #   a permanent raster stored in the current workspace  
    outDistance = EucDistance("input", "", "", "outdirection")
  • There are a few tools in the ArcGIS Spatial Analyst extension that do not output a raster, such as Contour. These will express the output as a parameter within the parentheses in the tool definition.
    Contour("elevation", "C:/sapyexamples/output/outcontours.shp", 200, 0)

Related topics


In this topic
  1. Output rules