English

How To: Limit the values of a raster with Spatial Analyst

Summary

Instructions provided explain the procedure to use the Spatial Analyst Raster Calculator and a conditional statment to limit the values in a raster.

Procedure

Follow these steps to set the minimum value of a raster to zero with two different outputs. This document assumes the Spatial Analyst Extension is turned on, and the Spatial Anayst toolbar is active.

  1. Click the Spatial Analyst menu.
  2. Select Raster Calculator.
  3. In the raster calculator, type one of the following expressions:

    A. This expression will change all cells with a value less than zero to equal zero. The remainder of the cells will maintain the original values:

    Code:
    con([GridName] < 0, 0, [GridName])


    B. This expression will change all cells with a value less than zero to equal NoData. The remainder of the cells will maintain the original values:

    Code:
    con([GridName] < 0, setnull([GridName]), [GridName])


    Note:
    In the above expressions, GridName is the raster layer in the data frame. For further information regarding the use of 'con' statements, users with ArcGIS versions 8.2 and higher should see the Functional Reference for Spatial Analyst functions. This help can be accessed from the About Building Expressions button on the raster calculator.

  4. On the Raster Calculator, click Evaluate.
  5. To make this a permanent raster, either right-click on the output grid layer and select the Make permanent option, or save the map document.