QGIS API Documentation 3.43.0-Master (c67cf405802)
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 <QDomDocument>
22#include "qgis_sip.h"
23#include <QDomElement>
24
25#include "qgis_core.h"
26#include "qgis.h"
27
34class CORE_EXPORT QgsRasterMinMaxOrigin
35{
36
37 public:
38
40 static constexpr double CUMULATIVE_CUT_LOWER = 0.02;
41
43 static constexpr double CUMULATIVE_CUT_UPPER = 0.98;
44
46 static constexpr double DEFAULT_STDDEV_FACTOR = 2.0;
47
49
50 bool operator ==( const QgsRasterMinMaxOrigin &other ) const;
51
53
55 Qgis::RasterRangeLimit limits() const { return mLimits; }
56
58 Qgis::RasterRangeExtent extent() const { return mExtent; }
59
61 Qgis::RasterRangeAccuracy statAccuracy() const { return mAccuracy; }
62
64 double cumulativeCutLower() const { return mCumulativeCutLower; }
65
67 double cumulativeCutUpper() const { return mCumulativeCutUpper; }
68
70 double stdDevFactor() const { return mStdDevFactor; }
71
73
75 void setLimits( Qgis::RasterRangeLimit limits ) { mLimits = limits; }
76
78 void setExtent( Qgis::RasterRangeExtent extent ) { mExtent = extent; }
79
81 void setStatAccuracy( Qgis::RasterRangeAccuracy accuracy ) { mAccuracy = accuracy; }
82
84 void setCumulativeCutLower( double val ) { mCumulativeCutLower = val; }
85
87 void setCumulativeCutUpper( double val ) { mCumulativeCutUpper = val; }
88
90 void setStdDevFactor( double val ) { mStdDevFactor = val; }
91
93
95 void writeXml( QDomDocument &doc, QDomElement &parentElem ) const;
96
98 void readXml( const QDomElement &elem );
99
101
103 static QString limitsString( Qgis::RasterRangeLimit limits );
104
106 static Qgis::RasterRangeLimit limitsFromString( const QString &limits );
107
109 static QString extentString( Qgis::RasterRangeExtent extent );
110
112 static Qgis::RasterRangeExtent extentFromString( const QString &extent );
113
115 static QString statAccuracyString( Qgis::RasterRangeAccuracy accuracy );
116
118 static Qgis::RasterRangeAccuracy statAccuracyFromString( const QString &accuracy );
119
120 private:
121
125 double mCumulativeCutLower;
126 double mCumulativeCutUpper;
127 double mStdDevFactor;
128};
129
130#endif // QGSRASTERMINMAXORIGIN_H
RasterRangeLimit
Describes the limits used to compute raster ranges (min/max values).
Definition qgis.h:1507
@ NotSet
User defined.
RasterRangeAccuracy
Describes the accuracy used to compute raster ranges (min/max values).
Definition qgis.h:1538
@ Estimated
Approximated statistics.
RasterRangeExtent
Describes the extent used to compute raster ranges (min/max values).
Definition qgis.h:1523
@ WholeRaster
Whole raster is used to compute statistics.
Describes the origin of minimum and maximum values in a raster.
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.
double stdDevFactor() const
Returns the factor f so that the min/max range is [ mean - f * stddev , mean + f * stddev ].
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).
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)