How To: Limit the values of a raster with Spatial Analyst
Instructions provided explain the procedure to use the Spatial Analyst Raster Calculator and a conditional statment to limit the values in a raster.
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.
- Click the Spatial Analyst menu.
- Select Raster Calculator.
- 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:
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:
con([GridName] < 0, setnull([GridName]), [GridName])
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.
- On the Raster Calculator, click Evaluate.
- 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.