QGIS API Documentation 4.1.0-Master (60fea48833c)
Loading...
Searching...
No Matches
qgsrasterminmaxorigin.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsrasterminmaxorigin.h - Origin of min/max values
3 --------------------------------------
4 Date : Dec 2016
5 Copyright : (C) 2016 by Even Rouault
6 email : even.rouault at spatialys.com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSRASTERMINMAXORIGIN_H
19#define QGSRASTERMINMAXORIGIN_H
20
21#include "qgis.h"
22#include "qgis_core.h"
23#include "qgis_sip.h"
24
25#include <QDomDocument>
26#include <QDomElement>
27
34class CORE_EXPORT QgsRasterMinMaxOrigin
35{
36 public:
38 static constexpr double CUMULATIVE_CUT_LOWER = 0.02;
39
41 static constexpr double CUMULATIVE_CUT_UPPER = 0.98;
42
44 static constexpr double DEFAULT_STDDEV_FACTOR = 2.0;
45
47
48 bool operator==( const QgsRasterMinMaxOrigin &other ) const;
49
51
53 Qgis::RasterRangeLimit limits() const { return mLimits; }
54
56 Qgis::RasterRangeExtent extent() const { return mExtent; }
57
59 Qgis::RasterRangeAccuracy statAccuracy() const { return mAccuracy; }
60
62 double cumulativeCutLower() const { return mCumulativeCutLower; }
63
65 double cumulativeCutUpper() const { return mCumulativeCutUpper; }
66
68 double stdDevFactor() const { return mStdDevFactor; }
69
71
74
77
79 void setStatAccuracy( Qgis::RasterRangeAccuracy accuracy ) { mAccuracy = accuracy; }
80
82 void setCumulativeCutLower( double val ) { mCumulativeCutLower = val; }
83
85 void setCumulativeCutUpper( double val ) { mCumulativeCutUpper = val; }
86
88 void setStdDevFactor( double val ) { mStdDevFactor = val; }
89
91
93 void writeXml( QDomDocument &doc, QDomElement &parentElem ) const;
94
96 void readXml( const QDomElement &elem );
97
99
101 static QString limitsString( Qgis::RasterRangeLimit limits );
102
104 static Qgis::RasterRangeLimit limitsFromString( const QString &limits );
105
107 static QString extentString( Qgis::RasterRangeExtent extent );
108
110 static Qgis::RasterRangeExtent extentFromString( const QString &extent );
111
113 static QString statAccuracyString( Qgis::RasterRangeAccuracy accuracy );
114
116 static Qgis::RasterRangeAccuracy statAccuracyFromString( const QString &accuracy );
117
118 private:
122 double mCumulativeCutLower;
123 double mCumulativeCutUpper;
124 double mStdDevFactor;
125};
126
127#endif // QGSRASTERMINMAXORIGIN_H
RasterRangeLimit
Describes the limits used to compute raster ranges (min/max values).
Definition qgis.h:1623
@ NotSet
User defined.
Definition qgis.h:1624
RasterRangeAccuracy
Describes the accuracy used to compute raster ranges (min/max values).
Definition qgis.h:1654
@ Estimated
Approximated statistics.
Definition qgis.h:1656
RasterRangeExtent
Describes the extent used to compute raster ranges (min/max values).
Definition qgis.h:1639
@ WholeRaster
Whole raster is used to compute statistics.
Definition qgis.h:1640
void setLimits(Qgis::RasterRangeLimit limits)
Sets the limits.
void setExtent(Qgis::RasterRangeExtent extent)
Sets the extent.
double cumulativeCutLower() const
Returns the lower bound of cumulative cut method (between 0 and 1).
Qgis::RasterRangeExtent extent() const
Returns the raster extent.
static constexpr double CUMULATIVE_CUT_UPPER
Default cumulative cut upper limit.
double stdDevFactor() const
Returns the factor f so that the min/max range is [ mean - f * stddev , mean + f * stddev ].
static constexpr double DEFAULT_STDDEV_FACTOR
Default standard deviation factor.
void setCumulativeCutUpper(double val)
Sets the upper bound of cumulative cut method (between 0 and 1).
void setStdDevFactor(double val)
Sets the factor f so that the min/max range is [ mean - f * stddev , mean + f * stddev ].
double cumulativeCutUpper() const
Returns the upper bound of cumulative cut method (between 0 and 1).
void setCumulativeCutLower(double val)
Sets the lower bound of cumulative cut method (between 0 and 1).
static constexpr double CUMULATIVE_CUT_LOWER
Default cumulative cut lower limit.
Qgis::RasterRangeAccuracy statAccuracy() const
Returns the raster statistic accuracy.
Qgis::RasterRangeLimit limits() const
Returns the raster limits.
void setStatAccuracy(Qgis::RasterRangeAccuracy accuracy)
Sets the statistics accuracy.
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)