0

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")

1 Answer 1

2

I don't have an immediate solution to this problem, as it may be a bug, but I would suggest that the first thing you do is upgrade ArcGIS 10 from Service Pack 2, to the latest Service Pack, which is 5.

ArcGIS 10 (Desktop, Engine, Server) Service Pack 5 - English

I am making this suggestion from the outset, as there have been a number of questions posted in the last couple of months that were solved by upgrading to the current version.

Here are the Issues Addressed in Service Pack 3

This fix seems like it may be related to your problem:
NIM067104: Lookup and Reclassify tools produce incorrect results when using a string field as the lookup/reclass field.

I would still recommend upgrading to SP 5 as it will include this bug fix, along with others.

If you are not able to upgrade to the current Service Pack, that would be useful information to include in your question.

1
  • Upgrading to SP5 and retesting was my first thought too.
    – PolyGeo
    Aug 20, 2012 at 0:30

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.