Manage output from Image Analyst tools in map algebra

Available with Image Analyst license.

The primary raster output of an Image Analyst map algebra expression is a raster object. Raster objects reference a temporary raster when they are created as primary output from a map algebra expression. Temporary data, unless it is explicitly saved, will be removed when the ArcGIS session or script ends.

Save a temporary raster

A temporary raster can be permanently saved by using the save method on the raster object. If the temporary data has a layer associated with it, the data can also be saved through the layer's context menu or by saving the map document. These methods of saving are detailed below.

Use the save method

Save a temporary raster by using the save method on the raster object. In the example below, the temporary output from the Float tool is saved to the specified output folder.

outraster = Float("C:/Data/elevation") 
outraster.save("C:/output/floatraster")

The location where the data is saved depends on what you enter in the save method and what workspace environments you have set.

When the full path with dataset name is specified, this location is where the permanent data will be saved.

If only a dataset name is specified, the location of the saved data is determined by the geoprocessing workspace environments as follows:

  • If the Current Workspace or the Scratch Workspace environment is set, the saved data will be saved to the location of the set workspace.
  • If both the Current Workspace and Scratch Workspace environments are set, the saved data will be saved to the Current Workspace value.
  • If no workspace is set, an error will be returned.

To persist the data where it is with its default name, call the save method without specifying a name, as shown in the following example:

outraster.save()

Save the project

To persist a temporary raster dataset associated with a map layer, save the map project. When the project is saved, the raster dataset persists to disk at its current location with its automatically generated name.

Interaction of a raster object, layer, and dataset

A raster object references a raster dataset and, if used in a map display, can be associated with a raster layer in the table of contents. The relationships between the raster dataset, the raster object, and the raster layer are maintained in most cases, but it is important to understand these relationships to work productively with map algebra.

For more information on the interaction of raster objects, see Interaction of the Raster object.

Related topics