统计栅格数据中某个字段的个数、和等
IRasterLayer rasterLayer = axMapControl1.get_Layer(0) as IRasterLayer;
IRaster pRaster = rasterLayer.Raster;
IRasterBandCollection collection= pRaster as IRasterBandCollection;
IRasterBand band=collection.Item(0);
ITable pTable= band.AttributeTable;
IDataStatistics pDataStatistics = new DataStatistics();
IQueryFilter filter=new QueryFilter();
filter.WhereClause="\"Value\"<350";
ICursor pCursor = pTable.Search(filter, false);
pDataStatistics.Cursor = pCursor;
pDataStatistics.Field = "Count";
IStatisticsResults pStaResult = pDataStatistics.Statistics;
double count = pStaResult.Sum;
浙公网安备 33010602011771号