Select to view content in your preferred language

ERROR 010152: Object IGeoDataset is null. Failed to execute (TabulateArea)

3147
2
04-30-2012 04:35 PM
AminulIslam1
Deactivated User
Folks,

I am having the error message "ERROR 010152: Object IGeoDataset is null. Failed to execute (TabulateArea)" while executing batch tabulate area script. The function of the script is to get raster datasets from the workspace and calculate tabulate area for each raster using a zonal feature data (shape file). I have attached this script with a tool. Problem is I get this error message, I don't know why and where is it coming from. But if I execute the script line by line in the Python window, I get the result (except that GetParameterAsText functions are replaced by the actual paths). Any help?? BTW I am using ArcGIS 10 with Service Pack 3 installed.

# calculates TabulateArea statistics in batch mode
# it uses a shape file as the zone feature, takes multiple rasters from the workspace (inWorkspace) and return the calculated TabulateArea stat for each raster in outWorkspace folder

import arcpy
import os
from arcpy import env
arcpy.CheckOutExtension("spatial")

zoneFeature = arcpy.GetParameterAsText(0)
inWorkspace = arcpy.GetParameterAsText(1)
outWorkspace = arcpy.GetParameterAsText(2)

env.Workspace = inWorkspace

# Loop through a list of feature classes in the workspace and calculate TabulateArea stat for each raster

for rc in arcpy.ListRasters():
# Set the output name to be the same as the input name, and
# locate in the 'outWorkspace' workspace
output = os.path.join(outWorkspace, rc)
arcpy.gp.TabulateArea_sa(zoneFeature, "STEWARDLEV", rc, "VALUE", output, 30)


Thanks
Aminul
Tags (2)
0 Kudos
2 Replies
KristinBott1
New Contributor
Hello Animul,

Wondering how you solved this problem? I'm working with a student who is encountering this same error when running an analysis.

cheers -
-kristin
0 Kudos
WestonAnderson
New Contributor
I know this is a bit of a dead thread, but I recently got this same error while writing a script to batch-calculate areas and figured it out. In my case, the zone data set had an unknown projection. Once I defined the projection the command worked fine.
0 Kudos