Select to view content in your preferred language

Setting raster NoData value

8650
3
04-17-2012 11:32 PM
AnnaUkkola
Emerging Contributor
Hello,

I was wondering how I can change the NoData value of a raster dataset? When I created the raster from an XY table (text file) ArcMap set the NoData value to the default -3.40282346639e+038. However, I am trying to calculate zonal statistics for the raster dataset and want NoData values to be ignored in the calculations. Missing values are set to -9999 in the original dataset so I need to have these values ignored. How can I change this? Is it possible to set the NoData value when I create the raster or can it only be done afterwards?

I've tried using the Con and Set Null tools in Spatial Analyst to change the NoData value but without success. One problem I've had using these tools is that when I open the SQL window to write the expression no fields show up. My raster dataset has fields "stretched value" and "pixel value", I've tried typing these into SQL, but the output is a strange 'stripy' raster with big blocks missing. Any help appreciated!
0 Kudos
3 Replies
SteveLynch
Esri Regular Contributor
Anna

You can use SetNull or CopyRaster.

However, NoData values are treated as Nulls and are ignored in calculations and operations.

Steve
0 Kudos
AnnaUkkola
Emerging Contributor
Hi Steve,

Thanks for your reply. I managed to use Copy Raster for some datasets to change the NoData value but it doesn't work for all of them. For one dataset it simply won't change the NoData value or sets it to another number I did not specify.
Also I still have problems using the SetNull tool because no fields show up in the SQL Query Builder. The identify tool shows two fields, 'Stretched value' and 'Pixel value', so I tried writing "Pixel value"=-999 as the expression but that did not work either, or for some datasets it creates a strange stripy raster with blocks missing.
Would you have any further ideas how to fix this?

thanks.
0 Kudos
MarcinGasior
Frequent Contributor
In ArcMap add your raster and then try Spatial Analyst Tools -> Map Algebra -> Raster Calculator
Here you can try to run CON or SetNULL commands even if standard toolbox tools don't display fields to query:

SetNull("FloatingPointRaster" = -9999, "FloatingPointRaster")
Con("FloatingPointRaster" != -9999, "FloatingPointRaster")
0 Kudos