I have code about doing statistics for my raster data. I use ComputeStatsAndHist() to do statistics and should have been able to get raster histogram and the histogram's counts. But the histogram always nothing when I run the code, so the code dblCounts = pRasterHist.Counts always sends error message. Could you tell me if it is possible and normal that raster histogram is nothing or my code has some problem? Thank you so much.
Dim pColRBands As IRasterBandCollection pColRBands = pRaster
Dim pRasterBand As IRasterBand pRasterBand = pColRBands.Item(0) pRasterBand.ComputeStatsAndHist()
Dim pRasterHist As IRasterHistogram pRasterHist = pRasterBand.Histogram
Dim dblCounts() As Double dblCounts = pRasterHist.Counts