Raster Calculator - using the conditional options

4205
6
02-23-2015 11:17 AM
lauriehogan
New Contributor

I'd like to use the raster calculator to convert 0 values in the raster to 0.0001.

I was trying to use the syntax below

CON ("raster1" == 0, 0.001, "raster1")

Based on 39974 - Change a particular value of a raster dataset to zero without changing the other values

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")

All I get is errors in 10.3 (see attachment).  I'm not a python user, so could really use help with this syntax.

Thanks for the help!

Tags (1)
0 Kudos
6 Replies
DanPatterson_Retired
MVP Emeritus

That is for older versions, check the current help files for Con

0 Kudos
lauriehogan
New Contributor

Thanks for pointing me to the area to check out...  I had tried to find that source, but no luck.

I'll give these syntax examples a try.

0 Kudos
DanPatterson_Retired
MVP Emeritus

A good link for bookmarking is the top of the Arctoolbox tree as in this link...

0 Kudos
lauriehogan
New Contributor

Con ("raster1", 0.0001, "raster1" == 0) was next syntax in raster caculator didnt' work either.

and

Con ("raster" == 0 , 0.0001, "raster1")

Con("elev_967_1","elev_967_1", 0.0001, "VALUE>0.0001")

Con("VALUE < 0.001","elev_967_1", 0.0001)

None of these worked.

0 Kudos
JakeSkinner
Esri Esteemed Contributor

Hi Laurie,

How are you adding the raster name to the statement?  Are you double-clicking from the 'Layers and Variables' box within this tool?  The error is indicating it cannot find the raster.

0 Kudos
lauriehogan
New Contributor

Jake,

Yes, I was double clicking into the  Layers and variables in the  dialog box...  (These are not on my c: drive, but these layers are in arcmap currently.

Laurie

0 Kudos