Select to view content in your preferred language

Simple Raster Calculator Problem

14133
2
09-25-2012 10:27 AM
BreeWitteveen
Deactivated User
I am trying to remove negative values in a depth raster that I created. I'm sure it's quite simple to do, but I'm new to using Raster Calculator and cannot seem to get the syntax right. What is the correct syntax for returning values greater than or equal to zero for a raster "depth_layer"?

Thanks!
2 Replies
MarcinGasior
Frequent Contributor
If you want to turn values below 0 into NoData and leave the rest untouched try this expression in Raster Calculator:
SetNull("depth_layer" < 0, "depth_layer")

If you want to change values below 0 into some value (eg. 0) try this:
Con("depth_layer" < 0, 0,"depth_layer")

If you want to just see which values are below 0 use simply:
"depth_layer" < 0
ALI78671
New Contributor

Sir, i am applying your method of negative values to no data, it works, but the range of values to the positive side is increasing every time from 0 to some value higher than the original positive value of the raster file.

0 Kudos