how to set values to no data/null/nil/whatever!

889
4
05-21-2012 08:34 AM
DarleneWilcox
New Contributor III
I have a binary raster -- 1, 0, and No Data.  What I want is 1 and No Data.  How do I get rid of the 0 values?  Specifically, how do I recalculate the the 0 values to no data/nil/null or whatever the correct term for it is?

Thanks, Darlene
0 Kudos
4 Replies
TarunJaiswal
Esri Contributor
Greetings!

Please use Set Null tool to convert your zero values as NoData.

Set Null:
Input Conditional raster - original raster
Expression  - Value = 0
Input false raster or constant value  - original raster
output raster - location of output raster

Thank you.
0 Kudos
PaulCook
New Contributor
Darlene,

I believe the tool you are looking for is Reclassify.  This tool is only available if you the 3D Analyst extension.  You would launch this tool and add your raster in the 'Input raster' field.  On the left you would see the current values of your raster.  In the right column you would change the "New values" for your current value of 0 to NoData so it would be something like the attached JPG.

If you don't have the 3D Analyst I think this can be done with the Raster Calculator (Spatial Analyst extension) but I can't remember how off the top of my head.

Added in edit:
I just found out that you can exclude values when using the "Copy Raster" tool.  Just enter the value you want to get rid of, in this case 0 (zero) in the 'NoData Value (optional)' field.
0 Kudos
TimothyHales
Esri Notable Contributor
As Paul mentioned, this can be done with the Raster Calculator as well.  You would need to use the SetNull function similar to the SetNull tool that Tarun mentioned.

SetNull (in_conditional_raster, in_false_raster_or_constant, {where_clause})
0 Kudos
EricRice
Esri Regular Contributor
Or you can just run the Con tool with the "Input true raster or constant value" set to 1.  See screenshot.  No 'where clause' with this technique.


Regards,
Eric
0 Kudos