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
|
|
|
|
{
|
|
|
|
None = 0,
|
|
|
|
Min = 1,
|
|
|
|
Max = 2,
|
|
|
|
Range = 4,
|
|
|
|
Sum = 8,
|
|
|
|
Mean = 16,
|
|
|
|
StdDev = 32,
|
|
|
|
SumOfSquares = 64,
|
|
|
|
All = 127
|
|
|
|
};
|
|
|
|
|
|
|
|
QgsRasterBandStats();
|
|
|
|
|
|
|
|
/*! Compares region, size etc. not collected statistics */
|
|
|
|
bool contains( const QgsRasterBandStats &s ) const;
|
|
|
|
|
2005-11-20 01:57:36 +00:00
|
|
|
/** \brief The name of the band that these stats belong to. */
|
|
|
|
QString bandName;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
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;
|
|
|
|
|
|
|
|
/** Color table */
|
|
|
|
// QList<QgsColorRampShader::ColorRampItem> colorTable;
|
|
|
|
|
|
|
|
/** \brief The number of cells in the band. Equivalent to height x width.
|
|
|
|
* TODO: check if NO_DATA are excluded!*/
|
|
|
|
int elementCount;
|
|
|
|
|
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
|
|
|
};
|
2007-01-09 02:39:15 +00:00
|
|
|
|