I have a raster in ArcGIS which has a number of cells with the values 9999, showing that the data could not be generated for that cell. I want to convert all of these 9999 values to NoData, so that then I can do statistics on the dataset without getting crazy results.

How should I do this?

I have tried to use the reclassify tool, just adding one reclassification from 9999 -> No Data, but it seems to change all of the other values as well. Is there a way to do a reclassification which only does the changes you specify, and leaves all other values alone?

In case it matters, my dataset is a TIFF, with floating point values in it.


3 Answers 3


you can do this with arcpy, if you want. In this code, any input cell with a value 9999 will be set to NoData in the output raster, and the remaining cells will retain their original value.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outSetNull = SetNull("elevation", "elevation", "VALUE = 9999")

you can read Conditional evaluation with Con and Set Null (Spatial Analyst) from ArcGIS Resource Center...

SetNull (in_conditional_raster, in_false_raster_or_constant, {where_clause})


i hope it helps you...

  • 2
    If you have Spatial Analyst then you could also use the Set Null tool - so, just what Aragon said but not bother with the scripting part :) May 2, 2012 at 12:38
  • 2
    Using your link to Set Null (Spatial Analyst) I found that I could just run that without needing to use ArcPy. I've written a How To on my blog: blog.rtwilson.com/…
    – robintw
    May 2, 2012 at 12:44
  • yes this is another way. it is good to hear solving your problem.
    – urcm
    May 2, 2012 at 13:31
  • @urcm I tried the solution to resolve same problem. It seems solution is suitable for single band raster. I've multi-band composite image where VALUE=0 in all bands need to be set as NoData.
    – Rex
    Jan 18, 2023 at 8:21

Your approach used to work fine in old versions of Arc but not now. You can around this by adding in another value (set to be identical to the old one). One value is usually sufficient unless you have floating point values, in which case I would add the highest and lowest original values (set to be the same as their original value). The values in between USUALLY end up as per the original.

This is a hack, so always check the results afterwards!


I know this is a very old question and is already answered, but today I had the same problem but found the solution on my own using the reclass tool, not arcpy. Appearently when you reclass, all the values you do not include in the ranges are not touched. Be sure also to uncheck the "Change missing values to NoData".

I had a raster with values from 1 to 30 and the NoData had to become 0, so the only range I set to be changed was NoData --> 0. Not adding the rest of the values left them alone and where carried to the new raster unchanged.

Hope this helps someone with the same doubt.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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