Help with Raster Calculator

3683
1
12-21-2012 04:51 AM
MichaelR
New Contributor
Hello,

I have created a 'Depth to Water Table' layer across the County of Norfolk using the raster Minus function to take Water Table Contour values away from values in a DEM. Naturally the two datasets don't quite match up, the resulting raster has values between -10 and 70 (metres). I am using this layer to define risk, so negative values (suggesting the water table is above the surface of the land) are just as bad as a water table that sits at the surface.

So I am trying to use the Raster Calculator (Spatial Analyst Tools, Map Alegbra) to convert any negative values to zero and leave all positive values as they are.

I have been using the below expression to try and achieved this, but I have fairly limited experience writing in Python terms.

Con( "Depth to Water Table" , "Depth to Water Table" , 0 , Value >= 0 )

I get a range of errors come up (see the screen shot). The only one I can really identify is the "'Value' is not defined" error, which when looking at my original raster has the 'Open Attribute Table' button greyed out, I tried Calculating Statistics (Data Management Tools, Raster, Raster Properties) to create an attribute table, while the operation was successful this didn't create an attribute table.

Does anyone have any ideas where I am going wrong?

[ATTACH=CONFIG]20131[/ATTACH]
0 Kudos
1 Reply
PrasantaBhattarai
Esri Contributor
Hi,
I am not sure if you have already figured it out. Here is an expression you can try in raster calculator:

Con("Depth to Water Table" <= 0,0,"Depth to Water Table")

or,

Con("Depth to Water Table" >= 0,"Depth to Water Table",0)

Hope this helps!

Regards,
Prasanta.
0 Kudos