AnsweredAssumed Answered

Reclassify in Arcpy creates erroneous values?

Question asked by rgthurau on Apr 26, 2012
Latest reply on Apr 26, 2012 by jskinner-esristaff
This post could go under a previous thread I started under the heading "Why does Python suck?", but want to start off fresh.

I am trying to reclassify NoData values to zero for two rasters that each have a single value.

import arcpy, os from import * from arcpy import env arcpy.CheckOutExtension("Spatial") arcpy.env.overwriteOutput = True  ws = arcpy.env.workspace=r"X:\DATA\Raster_LC.gdb" arcpy.env.extent = r"X:\DATA\Raster_LC.gdb\Study_Area_ras" arcpy.env.mask = r"X:\DATA\Raster_LC.gdb\Study_Area_ras" arcpy.env.snapRaster = r"X:\DATA\Raster_LC.gdb\Study_Area_ras"  #####  Following section Converts nodata to 0 values within the extent of the above mask.     TreeAd = Reclassify("New_Trees", "Value", RemapValue ([["NODATA", 0], [700, 1000]]))"Trees_Ad_0") TreeAd = "Trees_Ad_0" TreeErase = Reclassify("Remove_Trees", "Value", RemapValue ([["NODATA", 0], [100, 30]]))"Tree_Erase_0") TreeErase = "Tree_Erase_0"

"New_Trees" is a single value raster (700) and "Remove_Trees" is a single value raster (100). I use the study area extent, mask, and snap raster to define the extent of my NoData conversion.

Attribute tables: Should be ; Actually produced
"Trees_Ad_0": 0, 1000; 9, 1000 - Where does the 9 come from?
"Trees_Erase_0": 0, 30; 29, 30 - Where does the 29 come from?

I'd love to know why this happens (has happened in the past), and
How do I prevent this from happening?

Many thanks.