Quantcast
Channel: Forums - ArcObjects SDKs
Viewing all articles
Browse latest Browse all 1374

help me ! there are error when executing IZonalOp.ZonalStatisticsAsTable

$
0
0
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!

Code:

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


Viewing all articles
Browse latest Browse all 1374

Trending Articles