3

I have a floating point raster with some values of 99999 that I want to set to NoData in Arc 10.2.2. I've tried using the SetNull dialogue box, the SetNull arcpy function, and the Raster Calculator dialogue box as described in Reclassify raster values of 9999 to NoData, leaving all other values alone, in ArcGIS Desktop?, but all of these fail with same error message:

ERROR 010423: myraster.FLOAT.TIFF does not have valid statistics as required by the operation.

I've tried using the Calculate Statistics tool as part of the Raster Properties toolbox, as suggested by the Help when I click on the error message, but this doesn't seem to change anything.

Any suggestions on how to make it work or alternatives for fixing the error?

  • 1
    Why not use Set Raster Properties resources.arcgis.com/en/help/main/10.1/index.html#//… if you know what the NoData value is or right click on the dataset in catalog, go to properties, and enter it there (there is a button for it). I suspect though you'll have bigger problems. Perhaps use CopyRaster to convert it to an IMG or GRID format to make it easier for use in raster calculator.. – Michael Stimson May 1 '15 at 0:57
  • Help lists three possible causes for that error. When you run calculate statistics, are you setting parameters like skip_factor or ignore_values, and if so to what? Does the tool complete, or is there any information present in the Geoprocessing Results window? Long shot, have you tried renaming the raster to something more simple, like test.tif? – Chris W May 1 '15 at 6:02
  • @Michael, Set Raster Properties worked. When I view the value of the target cells it says "NoData" instead of 99999. I am able to perform Calculate the Statistics for the raster and this time it actually changes things (I couldn't use Classification as a symbology method since the histogram wasn't calculating before, but now that is an allowed symbology option). This also seems far more direct than using SetNull in the raster calculator. I tried to change the NoData value by typing it into Properties, but I could only view the properties and not change them. – Mon Mo May 1 '15 at 7:35
  • In ArcMap you can't edit them directly, only in Catalog, however the SetRasterProperties tool can be executed from ArcMap.. but don't expect the NoData to show straight away, you (possibly) need to remove the layer and re-add it to get ArcMap to recognize the changes to NoData.. I find it best to do this in ArcCatalog. – Michael Stimson May 3 '15 at 21:25
1

As suggested by Michael Stimson in comments, one alternative is the Set Raster Properties tool:

Sets the data type, statistics, and NoData values on a raster or mosaic dataset.

import arcpy
arcpy.env.workspace = "C:/Workspace"

arcpy.SetRasterProperties_management("test.tif", nodata=[[1,99999]])

Remove the layer and re-add it, so ArcMap can recognize the changes.

It was also suggested to set NoData values directly from ArcCatalog (right click on the dataset, go to 'properties', and edit from there).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.