when run this script as a tool:-
# -*- coding: utf-8 -*-
import arcpy
import os
arcpy.env.overwriteOutput = True
arcpy.CheckOutExtension("spatial")
InputPath = arcpy.GetParameterAsText(0)
OutputPath = arcpy.GetParameterAsText(1)
OutputFolderName = arcpy.GetParameterAsText(2)
FeatureZone = arcpy.GetParameterAsText(3)
ZoneField = arcpy.GetParameterAsText(4)
arcpy.CreateFolder_management(OutputPath, OutputFolderName)
arcpy.env.workspace = InputPath
listDatasets = arcpy.ListDatasets()
for Datasets in listDatasets:
Set_Null = Datasets
Zonal_Statistices = OutputPath + "\\" + OutputFolderName + "\\" + Set_Null + ".dbf"
arcpy.gp.ZonalStatisticsAsTable_sa(FeatureZone, ZoneField, Set_Null, Zonal_Statistices, "True", "ALL")
This message appears:-
Traceback (most recent call last):
File "E:\ArcPy_Toolbox\MODIS\Scripts\ZonalStatisticsAsTable.py", line 24, in <module>
arcpy.gp.ZonalStatisticsAsTable_sa(FeatureZone, ZoneField, Set_Null, Zonal_Statistices, "True", "ALL")
File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\geoprocessing\_base.py", line 498, in <lambda>
return lambda *args: val(*gp_fixargs(args, True))
ExecuteError: ERROR 999999: Error executing function.
Create output table failed
Failed to execute (ZonalStatisticsAsTable)
Actually�?? I want the name of the table (.dbf) is the same name of input raster in the loop