QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
QgsClassificationStandardDeviation Class Reference

QgsClassificationCustom is an implementation of QgsClassificationMethod based on standard deviation. More...

#include <qgsclassificationstandarddeviation.h>

Inheritance diagram for QgsClassificationStandardDeviation:
Inheritance graph
[legend]

Public Member Functions

 QgsClassificationStandardDeviation ()
 
QgsClassificationMethodclone () const override
 Returns a clone of the method.
 
QIcon icon () const override
 The icon of the method.
 
QString id () const override
 The id of the method as saved in the project, must be unique in registry.
 
QString labelForRange (double lowerValue, double upperValue, ClassPosition position) const override
 Returns the label for a range.
 
QString name () const override
 The readable and translate name of the method.
 
void readXml (const QDomElement &element, const QgsReadWriteContext &context) override
 Reads extra information to apply it to the method.
 
void writeXml (QDomElement &element, const QgsReadWriteContext &context) const override
 Writes extra information about the method.
 
- Public Member Functions inherited from QgsClassificationMethod
 QgsClassificationMethod (MethodProperties properties=NoFlag, int codeComplexity=1)
 Creates a classification method.
 
virtual ~QgsClassificationMethod ()
 
Q_DECL_DEPRECATED QList< QgsClassificationRangeclasses (const QgsVectorLayer *layer, const QString &expression, int nclasses)
 This will calculate the classes for a given layer to define the classes.
 
QList< QgsClassificationRangeclasses (const QList< double > &values, int nclasses)
 This will calculate the classes for a list of values.
 
QList< QgsClassificationRangeclasses (double minimum, double maximum, int nclasses)
 This will calculate the classes for defined bounds without any values.
 
QList< QgsClassificationRangeclassesV2 (const QgsVectorLayer *layer, const QString &expression, int nclasses, QString &error)
 This will calculate the classes for a given layer to define the classes.
 
int codeComplexity () const
 Code complexity as the exponent in Big O notation.
 
QgsClassificationMethod::MethodProperties flags () const
 Returns the classification flags.
 
QString labelFormat () const
 Returns the format of the label for the classes.
 
QString labelForRange (const QgsRendererRange &range, ClassPosition position=Inner) const
 Returns the label for a range.
 
int labelPrecision () const
 Returns the precision for the formatting of the labels.
 
bool labelTrimTrailingZeroes () const
 Returns if the trailing 0 are trimmed in the label.
 
const QgsProcessingParameterDefinitionparameterDefinition (const QString &parameterName) const
 Returns the parameter from its name.
 
QgsProcessingParameterDefinitions parameterDefinitions () const
 Returns the list of parameters.
 
QVariantMap parameterValues () const
 Returns the values of the processing parameters.
 
QDomElement save (QDomDocument &doc, const QgsReadWriteContext &context) const
 Saves the method to a DOM element and return it.
 
void setLabelFormat (const QString &format)
 Defines the format of the labels for the classes, using %1 and %2 for the bounds.
 
void setLabelPrecision (int labelPrecision)
 Defines the precision for the formatting of the labels.
 
void setLabelTrimTrailingZeroes (bool trimTrailingZeroes)
 Defines if the trailing 0 are trimmed in the label.
 
void setParameterValues (const QVariantMap &values)
 Defines the values of the additional parameters.
 
void setSymmetricMode (bool enabled, double symmetryPoint=0, bool symmetryAstride=false)
 Defines if the symmetric mode is enables and configures its parameters.
 
bool symmetricModeAvailable () const
 Returns if the method supports symmetric calculation.
 
bool symmetricModeEnabled () const
 Returns if the symmetric mode is enabled.
 
bool symmetryAstride () const
 Returns if the symmetric mode is astride if true, it will remove the symmetry point break so that the 2 classes form only one.
 
double symmetryPoint () const
 Returns the symmetry point for symmetric mode.
 
virtual bool valuesRequired () const
 Returns if the method requires values to calculate the classes If not, bounds are sufficient.
 

Static Public Attributes

static const QString METHOD_ID = QStringLiteral( "StdDev" )
 
- Static Public Attributes inherited from QgsClassificationMethod
static const int MAX_PRECISION = 15
 
static const int MIN_PRECISION = -6
 

Additional Inherited Members

- Public Types inherited from QgsClassificationMethod
enum  ClassPosition { LowerBound , Inner , UpperBound }
 Defines the class position. More...
 
typedef QFlags< MethodPropertyMethodProperties
 
enum  MethodProperty { NoFlag = 0 , ValuesNotRequired = 1 << 1 , SymmetricModeAvailable = 1 << 2 , IgnoresClassCount = 1 << 3 }
 Flags for the classification method. More...
 
- Static Public Member Functions inherited from QgsClassificationMethod
static QgsClassificationMethodcreate (const QDomElement &element, const QgsReadWriteContext &context)
 Reads the DOM element and return a new classification method from it.
 
static void makeBreaksSymmetric (QList< double > &breaks, double symmetryPoint, bool astride)
 Remove the breaks that are above the existing opposite sign classes to keep colors symmetrically balanced around symmetryPoint Does not put a break on the symmetryPoint.
 
static QList< double > rangesToBreaks (const QList< QgsClassificationRange > &classes)
 Transforms a list of classes to a list of breaks.
 
- Protected Member Functions inherited from QgsClassificationMethod
void addParameter (QgsProcessingParameterDefinition *definition)
 Add a parameter to the method.
 
void copyBase (QgsClassificationMethod *c) const
 Copy the parameters (shall be used in clone implementation)
 
QString formatNumber (double value) const
 Format the number according to label properties.
 

Detailed Description

QgsClassificationCustom is an implementation of QgsClassificationMethod based on standard deviation.

Since
QGIS 3.10

Definition at line 28 of file qgsclassificationstandarddeviation.h.

Constructor & Destructor Documentation

◆ QgsClassificationStandardDeviation()

QgsClassificationStandardDeviation::QgsClassificationStandardDeviation ( )

Definition at line 25 of file qgsclassificationstandarddeviation.cpp.

Member Function Documentation

◆ clone()

QgsClassificationMethod * QgsClassificationStandardDeviation::clone ( ) const
overridevirtual

Returns a clone of the method.

Implementation can take advantage of copyBase method which copies the parameters of the base class

Implements QgsClassificationMethod.

Definition at line 41 of file qgsclassificationstandarddeviation.cpp.

◆ icon()

QIcon QgsClassificationStandardDeviation::icon ( ) const
overridevirtual

The icon of the method.

Reimplemented from QgsClassificationMethod.

Definition at line 49 of file qgsclassificationstandarddeviation.cpp.

◆ id()

QString QgsClassificationStandardDeviation::id ( ) const
overridevirtual

The id of the method as saved in the project, must be unique in registry.

Implements QgsClassificationMethod.

Definition at line 36 of file qgsclassificationstandarddeviation.cpp.

◆ labelForRange()

QString QgsClassificationStandardDeviation::labelForRange ( double  lowerValue,
double  upperValue,
QgsClassificationMethod::ClassPosition  position 
) const
overridevirtual

Returns the label for a range.

Reimplemented from QgsClassificationMethod.

Definition at line 100 of file qgsclassificationstandarddeviation.cpp.

◆ name()

QString QgsClassificationStandardDeviation::name ( ) const
overridevirtual

The readable and translate name of the method.

Implements QgsClassificationMethod.

Definition at line 31 of file qgsclassificationstandarddeviation.cpp.

◆ readXml()

void QgsClassificationStandardDeviation::readXml ( const QDomElement &  element,
const QgsReadWriteContext context 
)
overridevirtual

Reads extra information to apply it to the method.

Reimplemented from QgsClassificationMethod.

Definition at line 137 of file qgsclassificationstandarddeviation.cpp.

◆ writeXml()

void QgsClassificationStandardDeviation::writeXml ( QDomElement &  element,
const QgsReadWriteContext context 
) const
overridevirtual

Writes extra information about the method.

Reimplemented from QgsClassificationMethod.

Definition at line 129 of file qgsclassificationstandarddeviation.cpp.

Member Data Documentation

◆ METHOD_ID

const QString QgsClassificationStandardDeviation::METHOD_ID = QStringLiteral( "StdDev" )
static

Definition at line 41 of file qgsclassificationstandarddeviation.h.


The documentation for this class was generated from the following files: