I have an arcpy / python script that is working fine with ArcMap 10 no Service pack (Build 2414) on windows XP, but consistently failing on using ArcMap 10 SP2 (Build 3200). Getting the ESRI 99999 error. In a nutshell, this script is supposed to reclassify and convert four raster files to polygon (shp).
Here is the code. Any help or ideas would be appreciated.
import arcpy, os, string
arcpy.CheckOutExtension("Spatial")
from arcpy.sa import *
#set output location
outLoc = "O:/gis/!KEYHOLE/DAILY_SHP"
#get file date, set data directory
fileDate = arcpy.GetParameterAsText(0)
dataFolder = "O:/gis/PRED_SVC/MET_PROJ/FOR_OBS_LTG_DATA"
#add file date message
arcpy.AddMessage("...using file date " + fileDate + "...")
#set precip amount file based on date input
prefixList = ["erc", "thz", "prpdur_", "prpamt_"]
for prefix in prefixList:
metName = prefix + fileDate
metFile = os.path.join(dataFolder, metName)
print metName
print metFile
#output workspace, turn overwrite output on
arcpy.env.workspace = "c:/tmp"
arcpy.env.overwriteOutput = 1
#reclassify
if prefix == "erc":
remap = RemapRange([[-99, -1.282, 1], [-1.282, -0.842, 2], [-0.842, -0.524, 3], [-0.524, -0.253, 4], \
[-0.253, 0, 5], [0, 0.253, 6], [0.253, 0.524, 7], [0.524, 0.842, 8], [0.842, 1.282, 9], \
[1.282, 1.645, 10], [1.645, 1.881, 11], [1.881, 99, 12]])
arcpy.AddMessage("...reclassifying ERC...")
elif prefix == "thz":
remap = RemapRange([[-99, -1.645, 1], [-1.645, -1.282, 2], [-1.282, -0.842, 3], [-0.842, -0.524, 4], \
[-0.524, -0.253, 5], [-0.253, 0.253, 6], [0.253, 0.524, 7], [0.524, 0.842, 8], \
[0.842, 1.282, 9], [1.282, 99, 10]])
arcpy.AddMessage("...reclassifying 1000HR fuels...")
elif prefix == "prpdur_":
remap = RemapRange([[0, 0.009, 1], [0.009, 1.9999, 2], [1.9999, 4.9999, 3], \
[4.9999, 9.9999, 4], [9.9999, 25, 5]])
arcpy.AddMessage("...reclassifying precipitation duration...")
else:
remap = RemapRange([[0, 0.0009, 1], [0.0009, 0.09999, 2], [0.09999, 0.249999, 3], \
[0.249999, 0.499999, 4], [0.499999, 0.999999, 5], \
[0.999999, 1.999999, 6], [1.999999, 1000000, 7]])
arcpy.AddMessage("...reclassifying precipitation amount...")
rcls = Reclassify(metFile, "Value", remap)
#make raster layer, convert to poly
metLyr = arcpy.MakeRasterLayer_management(rcls, "metLyr")
arcpy.env.workspace = outLoc
arcpy.env.overwriteOutput = 1
outPolyName = string.replace(prefix, "_", "") + "_poly.shp"
outPolyFile = outLoc + os.sep + outPolyName
arcpy.AddMessage("...converting " + metFile + " to poly...")
print outLoc
print outPolyName
print outPolyFile
arcpy.RasterToPolygon_conversion(metLyr, outPolyFile)
del rcls
arcpy.CheckInExtension("Spatial")