help me ! there are error when executing  IZonalOp.ZonalStatisticsAsTable

3083
2
07-24-2013 12:25 AM
zhenliu
New Contributor II
When I use tool zonalstatistics as table or zonstatistics in ArcToolBox 10.1,I can get the result without error.
But when I use C# and IZonalOp.ZonalStatisticsAsTable( or pZonalOp.ZonalStatistics ) in ArcObjects 10.1,There are error as follows:
ERROR 010316: Unable to open the input raster: C:\USERS\ADMINI~1\APPDATA\LOCAL\TEMP\G_G722
ERROR 010067: Error in executing grid expression.
I have read many posts,but no one can...:(
My codes are listed as follows.Help Me!

ISurfaceOp2 pSurfaceOp = new RasterSurfaceOpClass();
object Missing = Type.Missing;
IRasterDataset rasterDataset = default(IRasterDataset);
rasterDataset = pdemWorkspace.OpenRasterDataset(demName);//"SDE.Slope_SDE1"
IGeoDataset pdemGeoDs = (IGeoDataset)rasterDataset;
IGeoDataset pOutputRaster = pSurfaceOp.Slope(pdemGeoDs, esriGeoAnalysisSlopeEnum.esriGeoAnalysisSlopeDegrees, ref Missing);//ç??æ??å?¡åº¦å?¾generate a slope map
IFeatureClass pgridfeatClass = default(IFeatureClass);
 pgridfeatClass = pgridWorkspace.OpenFeatureClass(gridName);
IGeoDataset pgridDs = pgridfeatClass as IGeoDataset;
IZonalOp pZonalOp = new RasterZonalOpClass();
ITable pTable = pZonalOp.ZonalStatisticsAsTable(pgridDs, pOutputRaster, true);//Error occurs
0 Kudos
2 Replies
zhenliu
New Contributor II
No one can help me? Damn it.
0 Kudos
MarcoBelotti
New Contributor II

Zhen,

did you solve the problem? I've a similar problem when I try to use IMath.Times with grid stored in a file personal gdb (arcgis 10.2 vb.net)

thanks

Marco

0 Kudos