HOW TO

Change a particular value of a raster dataset to zero without changing the other values

Last Published: April 25, 2020

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.

Procedure


Note:
This document assumes that the Spatial Analyst Extension is turned on (for all versions) and that the Spatial Analyst toolbar is active (for versions 8.x and 9.x).

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:

Con([InRaster] == -9999, 0 , [InRaster])


Note:
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.

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:

Con("InRaster" == -9999, 0 , "InRaster")


Note:
Edit "-9999" to the particular value in data to be changed to zero.


3. Specify a location for the output raster.

4. Click OK.

Article ID:000011501

Software:
  • ArcMap

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic