Select to view content in your preferred language

arcpy 10.1 Tabulate Area fails unpredictably

1696
10
06-18-2013 11:43 AM
MichaelMcWilliams
Emerging Contributor
Hello everyone,

I am creating python scripts that make use of the Tabulate Area tool (ArcGIS 10.1). I have lately been experiencing odd behavior where a script will work initially, and then not work for a period of time... and then it will work again somewhat unexpectedly. When it fails, it fails on the TabulateArea line.

I use PyScripter as my IDE, and a script failure generates the message:
"[Errno 10054] An existing connection was forcibly closed by the remote host"

I have also experimented using IDLE, and I get the same failure behavior, but I do not receive an error message... it just doesn't complete the script.

This is a simplified version of the code that will itself generate errors (and sometimes work):

import arcpy
from arcpy.sa import *

arcpy.env.overwriteOutput = True

zones = r'F:\...\zones.shp'
input_raster = r'F:\...\raster.shp'
outTable = r'F:\...\table.dbf'

arcpy.CheckOutExtension("Spatial")
TabulateArea(zones, 'zone_id', input_raster, 'raster_value', outTable, '#')



I have not experienced this problem with any other arcpy functions.

Does anyone have any ideas what could be going on? What is the "forcibly closed" message all about?

Thanks for your time and help!
Tags (2)
0 Kudos
10 Replies
MichaelMcWilliams
Emerging Contributor
I discovered the same solution just the other day, though it wasn't intended as a fix for this problem. I had been using the work-around of running my script from the Python window within ArcMap -- for some reason that works.

The Tabulate Area command converts feature classes to rasters on the fly, and my scripts involve looping many Tabulate Area commands over the same input zones... so it made sense to first convert the feature classes to rasters in order to speed up the processing.

Well, the speed improved and I discovered that the Tabulate Area error disappeared as well.

Thank you for posting your solution. I confirm that it worked for me as well.
0 Kudos