QGIS API Documentation  3.8.0-Zanzibar (11aff65)
qgsgeometryisvalidcheck.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsgeometryisvalidcheck.h
3  --------------------------------------
4 Date : 7.9.2018
5 Copyright : (C) 2018 by Matthias Kuhn
6 email : [email protected]
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSGEOMETRYISVALIDCHECK_H
17 #define QGSGEOMETRYISVALIDCHECK_H
18 
19 #define SIP_NO_FILE
20 
21 #include "qgssinglegeometrycheck.h"
22 
32 {
33  public:
34 
38  QgsGeometryIsValidCheckError( const QgsSingleGeometryCheck *check, const QgsGeometry &geometry, const QgsGeometry &errorLocation, const QString &errorDescription );
39 
40  QString description() const override;
41 
42  private:
43  QString mDescription;
44 };
45 
54 class ANALYSIS_EXPORT QgsGeometryIsValidCheck : public QgsSingleGeometryCheck
55 {
56  public:
57 
61  explicit QgsGeometryIsValidCheck( const QgsGeometryCheckContext *context, const QVariantMap &configuration );
62 
63  QList<QgsWkbTypes::GeometryType> compatibleGeometryTypes() const override;
64  QList<QgsSingleGeometryCheckError *> processGeometry( const QgsGeometry &geometry ) const override;
65  QStringList resolutionMethods() const override;
66  QString description() const override { return factoryDescription(); }
67  QString id() const override { return factoryId(); }
68  QgsGeometryCheck::CheckType checkType() const override { return factoryCheckType(); }
69 
71  static QList<QgsWkbTypes::GeometryType> factoryCompatibleGeometryTypes() SIP_SKIP;
72  static bool factoryIsCompatible( QgsVectorLayer *layer ) SIP_SKIP;
73  static QString factoryDescription() SIP_SKIP;
74  static QString factoryId() SIP_SKIP;
75  static QgsGeometryCheck::Flags factoryFlags() SIP_SKIP;
76  static QgsGeometryCheck::CheckType factoryCheckType() SIP_SKIP;
78 };
79 
80 #endif // QGSGEOMETRYISVALIDCHECK_H
CheckType
The type of a check.
An error for a QgsGeometryIsValid check.
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:111
Base class for geometry checks for a single geometry without any context of the layer or other layers...
virtual QList< QgsWkbTypes::GeometryType > compatibleGeometryTypes() const =0
A list of geometry types for which this check can be performed.
Base configuration for geometry checks.
QgsGeometryCheck::CheckType checkType() const override
Returns the check type.
QString description() const override
Returns a human readable description for this check.
#define SIP_SKIP
Definition: qgis_sip.h:119
QString id() const override
Returns an id for this check.
An error from a QgsSingleGeometryCheck.
virtual QString description() const
A human readable description of this error.
virtual QList< QgsSingleGeometryCheckError * > processGeometry(const QgsGeometry &geometry) const =0
Check the geometry for errors.
virtual QStringList resolutionMethods() const =0
Returns a list of descriptions for available resolutions for errors.
Represents a vector layer which manages a vector based data sets.
Checks if geometries are valid using the backend configured in the QGIS settings. ...