HOW TO

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

Last Published: April 26, 2023

Summary

During spatial analysis using raster data, it may be necessary to change a particular value in a raster without changing the other values to improve the display of the raster data. For example, to change the maximum cell value to zero while retaining the minimum cell value. While the Reclassify tool can be used to convert a certain value to zero, it can be inconvenient if the raster has a large range of values. Therefore, this task is simplified by using the Raster Calculator tool.

This article provides the workflow to change the value of a raster dataset to zero without changing other values in ArcGIS Pro. The image below shows the minimum and maximum cell values of a raster layer.

The range of values of a raster layer.

Procedure

  1. Open the ArcGIS Pro project.
  2. On the Analysis tab, in the Geoprocessing group, click Tools.
  3. In the Geoprocessing pane, search for and click the Raster Calculator tool.
  4. In the Raster Calculator pane, on the Parameters tab, enter the following Python syntax into the expression box. Replace <InRaster> with the name of the raster layer, and <value> with the value of the raster layer.
Con("<InRaster>" == <value>, 0 , "<InRaster>")
  1. For the Output raster parameter, specify a name for the new layer.
  2. Click Run.
The configured parameters in the Raster Calculator pane.

The image below shows the value of the raster layer changed to zero (0).

The value of the raster layer changed to zero.

Article ID: 000030146

Software:
  • ArcGIS Pro 3 1
  • ArcGIS Pro 3 0
  • ArcGIS Pro 2 x

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options