# Import system modules import arcpy from arcpy import env from arcpy.sa import * # Get Parameters infc = arcpy.GetParameterAsText(0) reclass_field = arcpy.GetParameterAsText(1) reMap = arcpy.GetParameterAsText(1) outfc = arcpy.GetParameterAsText(2) # Local Parameters recl_data = "DATA" # Reclassify outRecl = arcpy.sa.Reclassify(infc, reclass_field, reMap, recl_data) outRecl.save(outfc)
mxdname = 'Kaag EOSD map.mxd' gdbpath = "C:\\GIS DATA\\NWT\\2012-01 Ka'a'gee tu\\2.processed\\Kaag.gdb\\" # path to where this mxd file is stored eosd_rs = 'EOSD_085CFv2' # name of raster file to reclassify (ground surface data in our case) #-> Local variables: outputs outputfolder = gdbpath corename = 'Kaag' # root prefix identifying the project (for naming convention) os.chdir(gdbpath) # set python current working directory to current geodatabase path suffix= 'temp' out_rs_name = gdbpath+corename+suffix+'_rs' # name of the raster to be generated by reclassification ## Reclassify if 1: # This method is based on help file: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z000000sr000000.htm remap = arcpy.sa.RemapValue([ \ [0, 0.00], \ [12, 0.00], \ [20, 5.01], \ [30, 0.00], \ [32, 0.00], \ [33, 0.00], \ [40, 2.40], \ [51, 656.07], \ [52, 656.07], \ [81, 9163.08], \ [82, 9163.08], \ [83, 9163.08], \ [100, 656.07], \ [211, 1534.28], \ [212, 1151.31], \ [213, 768.34], \ [221, 1534.28], \ [222, 1151.31], \ [223, 768.34], \ [231, 1534.28], \ [232, 1151.31], \ [233, 768.34]]) out_rs=arcpy.sa.Reclassify(eosd_rs, "Value", remap, "NODATA") out_rs.save(out_rs_name) print out_rs.maximum elif 0: # this is the method that came out of the model builder output remap="0 0.00; \ 12 0.00; \ 20 5.01; \ 30 0.00; \ 32 0.00; \ 33 0.00; \ 40 2.40; \ 51 656.07; \ 52 656.07; \ 81 9163.08; \ 82 9163.08; \ 83 9163.08; \ 100 656.07; \ 211 1534.28; \ 212 1151.31; \ 213 768.34; \ 221 1534.28; \ 222 1151.31; \ 223 768.34; \ 231 1534.28; \ 232 1151.31; \ 233 768.34 " arcpy.gp.Reclassify_sa(eosd_rs, "Value", remap,out_rs_name , "NODATA")
I have usually only used reclassify to reclassify one set of integers to another.
Seems to me a another approach to try would be to try the Lookup() tool instead.
(Logging an incident request with support may be a good idea too!)
For example (untested code - ymmv)
remap = \ [0, 0.00], \ [12, 0.00], \ (...) [232, 1151.31], \ [233, 768.34]] rmDict = dict(zip(i[0] for i in remap],[j[1] for j in remap])) arcpy.AddField("myrast","REMAP","DOUBLE") Rows = arcpy.UpdateCursor("myrast") for Row in Rows: val = rmDict[int(Row.VALUE)] Row.REMAP = val del Row, Rows from arcpy.sa import * outRast = Lookup("myrast","REMAP") outRast.save("rmrast")