QGIS API Documentation 3.41.0-Master (af5edcb665c)
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 <QDomDocument>
22#include "qgis_sip.h"
23#include <QDomElement>
24
25#include "qgis_core.h"
26#include "qgis.h"
27
33class CORE_EXPORT QgsRasterMinMaxOrigin
34{
35
36 public:
37
39 static constexpr double CUMULATIVE_CUT_LOWER = 0.02;
40
42 static constexpr double CUMULATIVE_CUT_UPPER = 0.98;
43
45 static constexpr double DEFAULT_STDDEV_FACTOR = 2.0;
46
48
49 bool operator ==( const QgsRasterMinMaxOrigin &other ) const;
50
52
54 Qgis::RasterRangeLimit limits() const { return mLimits; }
55
57 Qgis::RasterRangeExtent extent() const { return mExtent; }
58
60 Qgis::RasterRangeAccuracy statAccuracy() const { return mAccuracy; }
61
63 double cumulativeCutLower() const { return mCumulativeCutLower; }
64
66 double cumulativeCutUpper() const { return mCumulativeCutUpper; }
67
69 double stdDevFactor() const { return mStdDevFactor; }
70
72
74 void setLimits( Qgis::RasterRangeLimit limits ) { mLimits = limits; }
75
77 void setExtent( Qgis::RasterRangeExtent extent ) { mExtent = extent; }
78
80 void setStatAccuracy( Qgis::RasterRangeAccuracy accuracy ) { mAccuracy = accuracy; }
81
83 void setCumulativeCutLower( double val ) { mCumulativeCutLower = val; }
84
86 void setCumulativeCutUpper( double val ) { mCumulativeCutUpper = val; }
87
89 void setStdDevFactor( double val ) { mStdDevFactor = val; }
90
92
94 void writeXml( QDomDocument &doc, QDomElement &parentElem ) const;
95
97 void readXml( const QDomElement &elem );
98
100
102 static QString limitsString( Qgis::RasterRangeLimit limits );
103
105 static Qgis::RasterRangeLimit limitsFromString( const QString &limits );
106
108 static QString extentString( Qgis::RasterRangeExtent extent );
109
111 static Qgis::RasterRangeExtent extentFromString( const QString &extent );
112
114 static QString statAccuracyString( Qgis::RasterRangeAccuracy accuracy );
115
117 static Qgis::RasterRangeAccuracy statAccuracyFromString( const QString &accuracy );
118
119 private:
120
124 double mCumulativeCutLower;
125 double mCumulativeCutUpper;
126 double mStdDevFactor;
127};
128
129#endif // QGSRASTERMINMAXORIGIN_H
RasterRangeLimit
Describes the limits used to compute raster ranges (min/max values).
Definition qgis.h:1454
@ NotSet
User defined.
RasterRangeAccuracy
Describes the accuracy used to compute raster ranges (min/max values).
Definition qgis.h:1485
@ Estimated
Approximated statistics.
RasterRangeExtent
Describes the extent used to compute raster ranges (min/max values).
Definition qgis.h:1470
@ WholeRaster
Whole raster is used to compute statistics.
This class describes the origin of min/max values.
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)