I have a script that runs Tabulate Area
on a single feature class multiple times with different rasters. In total Tabulate Area
runs 5 times. 2 of the input rasters are provided as arguments to the script and Tabulate Area
works as expected. The other 3 rasters are results of raster functions (i.e. Reclassify, SetNull, EucDistance, etc.
).
Every time I run the script, Python crashes when trying to run Tabulate Area
on one of those preprocessed rasters. It happens on a different raster every time, seemingly randomly. There is no error message, Python simply crashes. When I hit Get Details
in the generic Windows error dialog, it seems like there is a different Fault Module every time as well.
When I try to run Tabulate Area
manually in ArcCatalog, ArcCatalog crashes and asks if I want to send a report to ESRI. Again, no error message.
UPDATE:
Here is some of the code involved:
def GetBuffer(inRaster, lcClass, bufDist, ringBuffer=True):
setnull = SetNull(inRaster, 1, "Value <> " + str(lcClass))
dist = EucDistance(setnull, bufDist)
buf = Reclassify(dist, "Value", RemapRange([[0, 100, 1], ["NODATA", 0]]))
if ringBuffer:
reclass = Reclassify(setnull, "Value", RemapValue([[0, 0], [1, 1], ["NODATA", 0]]))
ring = arcpy.gp.Minus_sa(buf, reclass)
return ring
else: return buf
def SubtractRaster(inRaster1, inRaster2):
sub = arcpy.gp.Minus_sa(inRaster1, inRaster2)
setnull = SetNull(sub, 1, "Value <> 1")
return setnull
lcRaster = arcpy.Raster(landcover)
treecanopy = GetBuffer(lcRaster, TreeCanopyClass, TreeCanopyBuffer, False)
parkinglots = SubtractRaster(GetBuffer(lcRaster, ParkingLotClass, ParkingLotBuffer), treecanopy)
buildings = SubtractRaster(GetBuffer(lcRaster, BuildingClass, BuildingBuffer), treecanopy)
impervious = SubtractRaster(GetBuffer(lcRaster, ImperviousClass, ImperviousBuffer), treecanopy)
...
TabulateArea(fc, "GID", parkinglots, "Value", plTabArea , 1)
TabulateArea(fc, "GID", buildings, "Value", buildTabArea , 1)
TabulateArea(fc, "GID", impervious, "Value", impTabArea , 1)
UPDATE 2:
I installed ArcGIS 10.1 Service Pack 1 after seeing bugs related to Tabulate Area
in 10.1. When I first ran the script with SP1, it worked. When I ran it again later, I had the same issue where Python simply crashed without providing an error message.
TabulateArea
calls (and a different one of the 3 each time).