Knowledge Base - Technical Articles
HowTo: Change a particular value of a raster dataset to zero without changing the other values
| Article ID: | 39974 |
|---|---|
| Software: | ArcGIS - ArcEditor 8.1, 8.1.2, 8.2, 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1, 10 ArcGIS - ArcInfo 8.0.1, 8.0.2, 8.1, 8.1.2, 8.2, 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1, 10 ArcGIS - ArcView 8.1, 8.1.2, 8.2, 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1, 10 |
| Platforms: | Windows NT 4.0, 2000, XP, Server 2003, Vista, Server 2008, Windows 7 |
Summary
Instructions provided describe how to change a particular value of a raster dataset to zero without changing the other values.
Often times, during spatial analysis using raster data, there might be a need to change a particular value in the data to different value to use the raster in the next analytical operation. For example, some values might need to be changed to zero.
ArcGIS offers a couple options to convert a particular value of a raster dataset to zero. One option is to use the Spatial Analyst Reclassify (reclass) tool to convert a particular value to zero. However, sometimes this might be cumbersome, if a raster has a large range of values. Hence, one has to go through each value (old value column) and look for the particular value in the list and then assign it as a zero (new value column).
A simpler option is to write a 'Con' statement in the Raster Calculator.
Often times, during spatial analysis using raster data, there might be a need to change a particular value in the data to different value to use the raster in the next analytical operation. For example, some values might need to be changed to zero.
ArcGIS offers a couple options to convert a particular value of a raster dataset to zero. One option is to use the Spatial Analyst Reclassify (reclass) tool to convert a particular value to zero. However, sometimes this might be cumbersome, if a raster has a large range of values. Hence, one has to go through each value (old value column) and look for the particular value in the list and then assign it as a zero (new value column).
A simpler option is to write a 'Con' statement in the Raster Calculator.
Procedure
For ArcGIS versions 8.x and 9.x
1. In ArcMap, navigate to Spatial Analyst toolbar > Spatial Analyst drop-down menu > Raster Calculator.
2. In the Raster Calculator, input the following syntax:
Edit '-9999' to the particular value in the data to be changed to zero.
3. Click Evaluate.
4. To make this a permanent raster, either right-click the raster layer, click Data, and select the Make Permanent option, or save the map document.
2. In the Raster Calculator, input the following syntax:
Con([InRaster] == -9999, 0 , [InRaster])
3. Click Evaluate.
4. To make this a permanent raster, either right-click the raster layer, click Data, and select the Make Permanent option, or save the map document.
For ArcGIS version 10.0
1. In ArcMap, navigate to ArcToolbox > Spatial Analyst Tools > Map Algebra and open the Raster Calculator.
2. In the Raster Calculator, input the following syntax:
Edit "-9999" to the particular value in data to be changed to zero.
3. Specify a location for the output raster.
4. Click OK.
2. In the Raster Calculator, input the following syntax:
Con("InRaster" == -9999, 0 , "InRaster")3. Specify a location for the output raster.
4. Click OK.
Related Information
Created: 3/2/2012
Last Modified: 4/25/2012