sebastian_4m

Python crashes when doing Calculate Distance Band

Discussion created by sebastian_4m on Nov 10, 2011
As part of an iterative creation of density surfaces I am calculating the distance to the K-th neighbor using the tool "CalculateDistanceBand_stats" when I run it in my script I get the following error

Traceback (most recent call last):
File "C:\Python26\ArcGIS10.0\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 325, in RunScript
exec codeObject in __main__.__dict__
File "C:\Users\Sebastian\Documents\py_codes\kernel_mod\kernel_mod.py", line 41, in <module>
mindist, avgdist, maxdist = arcpy.CalculateDistanceBand_stats(inputFC, neighbors, "EUCLIDEAN_DISTANCE")
File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\arcobjects\mixins.py", line 866, in __getitem__
return self.getOutput(item)
File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\arcobjects\arcobjects.py", line 919, in getOutput
return convertArcObjectToPythonObject(self._arc_object.GetOutput(*gp_fixargs(args)))
RuntimeError: ResultObject: Error in getting output

the critical parts of my script are as follows (the original has the indents):

import arcpy
arcpy.env.workspace = "C:\\Users\\thegdb.gdb"
neighbors = 30
featureClassList = arcpy.ListFeatureClasses("_*")
for featureClass in featureClassList:
inputFC = featureClass
mindist, avgdist, maxdist = arcpy.CalculateDistanceBand_stats(inputFC, neighbors, "EUCLIDEAN_DISTANCE")
#other processes here...

Please, any suggestion on what's going on here?

Outcomes