2005-12-30 04:56:31 +00:00
|
|
|
|
2005-11-20 01:57:36 +00:00
|
|
|
/** \brief The RasterBandStats struct is a container for statistics about a single
|
|
|
|
* raster band.
|
|
|
|
*/
|
|
|
|
class QgsRasterBandStats
|
|
|
|
{
|
2007-01-09 02:39:15 +00:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgsrasterbandstats.h>
|
|
|
|
%End
|
|
|
|
|
2005-11-20 01:57:36 +00:00
|
|
|
public:
|
2012-09-24 02:28:15 +02:00
|
|
|
enum Stats
|
|
|
|
{
|
2014-05-27 23:22:50 +02:00
|
|
|
None,
|
|
|
|
Min,
|
|
|
|
Max,
|
|
|
|
Range,
|
|
|
|
Sum,
|
|
|
|
Mean,
|
|
|
|
StdDev,
|
|
|
|
SumOfSquares,
|
|
|
|
All
|
2012-09-24 02:28:15 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
QgsRasterBandStats();
|
|
|
|
|
|
|
|
/*! Compares region, size etc. not collected statistics */
|
|
|
|
bool contains( const QgsRasterBandStats &s ) const;
|
|
|
|
|
2005-11-20 01:57:36 +00:00
|
|
|
/** \brief The gdal band number (starts at 1)*/
|
2012-09-24 02:28:15 +02:00
|
|
|
int bandNumber;
|
|
|
|
|
2013-09-06 22:07:42 +02:00
|
|
|
/** \brief The number of not no data cells in the band. */
|
|
|
|
// TODO: check if no data are excluded in stats calculation
|
2013-11-02 13:52:45 +01:00
|
|
|
qgssize elementCount;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2005-11-20 01:57:36 +00:00
|
|
|
/** \brief The maximum cell value in the raster band. NO_DATA values
|
|
|
|
* are ignored. This does not use the gdal GetMaximmum function. */
|
2008-11-01 18:36:02 +00:00
|
|
|
double maximumValue;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
/** \brief The minimum cell value in the raster band. NO_DATA values
|
|
|
|
* are ignored. This does not use the gdal GetMinimum function. */
|
|
|
|
double minimumValue;
|
|
|
|
|
2005-11-20 01:57:36 +00:00
|
|
|
/** \brief The mean cell value for the band. NO_DATA values are excluded. */
|
2008-01-11 06:38:10 +00:00
|
|
|
double mean;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
/** \brief The range is the distance between min & max. */
|
|
|
|
double range;
|
|
|
|
|
2005-11-20 01:57:36 +00:00
|
|
|
/** \brief The standard deviation of the cell values. */
|
2008-01-11 06:38:10 +00:00
|
|
|
double stdDev;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
/** \brief Collected statistics */
|
|
|
|
int statsGathered;
|
|
|
|
|
2005-11-20 01:57:36 +00:00
|
|
|
/** \brief The sum of all cells in the band. NO_DATA values are excluded. */
|
2008-01-11 06:38:10 +00:00
|
|
|
double sum;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
/** \brief The sum of the squares. Used to calculate standard deviation. */
|
|
|
|
double sumOfSquares;
|
|
|
|
|
|
|
|
/** \brief Number of columns used to calc statistics */
|
|
|
|
int width;
|
|
|
|
|
|
|
|
/** \brief Number of rows used to calc statistics */
|
|
|
|
int height;
|
|
|
|
|
|
|
|
/** \brief Extent used to calc statistics */
|
|
|
|
QgsRectangle extent;
|
2005-11-20 01:57:36 +00:00
|
|
|
};
|