QGIS API Documentation 4.1.0-Master (60fea48833c)
Loading...
Searching...
No Matches
qgsgeometrymissingvertexcheck.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsgeometrymissingvertexcheck.h
3 ---------------------
4 begin : September 2018
5 copyright : (C) 2018 Matthias Kuhn
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
17#ifndef QGSGEOMETRYMISSINGVERTEXCHECK_H
18#define QGSGEOMETRYMISSINGVERTEXCHECK_H
19
20#include "qgsgeometrycheck.h"
22
23#define SIP_NO_FILE
24
25class QgsCurvePolygon;
26
39{
40 public:
46 const QgsGeometryCheckerUtils::LayerFeature &layerFeature,
47 const QgsPointXY &errorLocation,
49 const QVariant &value = QVariant(),
51 );
52
53 QgsRectangle affectedAreaBBox() const override;
54
61
62 QMap<QString, QgsFeatureIds> involvedFeatures() const override;
63
70 void setInvolvedFeatures( const QMap<QString, QgsFeatureIds> &involvedFeatures );
71
72 QIcon icon() const override;
73
74 private:
75 QgsRectangle mAffectedAreaBBox;
76 QMap<QString, QgsFeatureIds> mInvolvedFeatures;
77};
78
89class ANALYSIS_EXPORT QgsGeometryMissingVertexCheck : public QgsGeometryCheck
90{
91 Q_GADGET
92 Q_DECLARE_TR_FUNCTIONS( QgsGeometryMissingVertexCheck )
93
94 public:
103 Q_ENUM( ResolutionMethod )
104
105
108 explicit QgsGeometryMissingVertexCheck( const QgsGeometryCheckContext *context, const QVariantMap &geometryCheckConfiguration );
110 const QMap<QString, QgsFeaturePool *> &featurePools, QList<QgsGeometryCheckError *> &errors, QStringList &messages, QgsFeedback *feedback, const LayerFeatureIds &ids = LayerFeatureIds()
111 ) const override;
112 void fixError( const QMap<QString, QgsFeaturePool *> &featurePools, QgsGeometryCheckError *error, int method, const QMap<QString, int> &mergeAttributeIndices, Changes &changes ) const override;
113 Q_DECL_DEPRECATED QStringList resolutionMethods() const override;
114
115 QString description() const override;
116 QString id() const override;
117 QList<Qgis::GeometryType> compatibleGeometryTypes() const override;
118 QgsGeometryCheck::Flags flags() const override;
119 QgsGeometryCheck::CheckType checkType() const override;
120
122 static QList<Qgis::GeometryType> factoryCompatibleGeometryTypes() SIP_SKIP;
123 static bool factoryIsCompatible( QgsVectorLayer *layer ) SIP_SKIP;
124 static QString factoryDescription() SIP_SKIP;
125 static QString factoryId() SIP_SKIP;
126 static QgsGeometryCheck::Flags factoryFlags() SIP_SKIP;
127 static QgsGeometryCheck::CheckType factoryCheckType() SIP_SKIP;
129
130 private:
131 void processPolygon(
132 const QgsCurvePolygon *polygon, QgsFeaturePool *featurePool, QList<QgsGeometryCheckError *> &errors, const QgsGeometryCheckerUtils::LayerFeature &layerFeature, QgsFeedback *feedback
133 ) const;
134
135 QgsRectangle contextBoundingBox( const QgsCurvePolygon *polygon, const QgsVertexId &vertexId, const QgsPoint &point ) const;
136};
137
138
139#endif // QGSGEOMETRYMISSINGVERTEXCHECK_H
Curve polygon geometry type.
A feature pool is based on a vector layer and caches features.
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition qgsfeedback.h:44
Base configuration for geometry checks.
This represents an error reported by a geometry check.
ValueType
Describes the type of an error value.
@ ValueOther
The value if of another type.
virtual QMap< QString, QgsFeatureIds > involvedFeatures() const
Returns a list of involved features.
const QgsVertexId & vidx() const
The id of the affected vertex.
virtual QString description() const
The error description.
QgsGeometryCheckError(const QgsGeometryCheck *check, const QgsGeometryCheckerUtils::LayerFeature &layerFeature, const QgsPointXY &errorLocation, QgsVertexId vidx=QgsVertexId(), const QVariant &value=QVariant(), ValueType valueType=ValueOther)
Create a new geometry check error with the parent check and for the layerFeature pair at the errorLoc...
ValueType valueType() const
The type of the value.
QVariant value() const
An additional value for the error.
const QgsGeometryCheck * check() const
The geometry check that created this error.
virtual QgsRectangle affectedAreaBBox() const
The bounding box of the affected area of the error.
virtual QIcon icon() const
Returns an icon that should be shown for this kind of error.
Base class for geometry checks.
QFlags< Flag > Flags
CheckType
The type of a check.
Result
Result of the geometry checker operation.
QgsGeometryCheck(const QgsGeometryCheckContext *context, const QVariantMap &configuration)
Create a new geometry check.
A layer feature combination to uniquely identify and access a feature in a set of layers.
Contains utilities required for geometry checks.
QgsGeometryMissingVertexCheckError(const QgsGeometryCheck *check, const QgsGeometryCheckerUtils::LayerFeature &layerFeature, const QgsPointXY &errorLocation, QgsVertexId vidx=QgsVertexId(), const QVariant &value=QVariant(), ValueType valueType=ValueOther)
Create a new missing vertex check error.
void setAffectedAreaBBox(const QgsRectangle &affectedAreaBBox)
Set the bounding box of the affected area.
void setInvolvedFeatures(const QMap< QString, QgsFeatureIds > &involvedFeatures)
The two involved features, that share a common boundary but not all common vertices on this boundary.
QMap< QString, QgsFeatureIds > involvedFeatures() const override
Returns a list of involved features.
QgsRectangle affectedAreaBBox() const override
The bounding box of the affected area of the error.
A topology check for missing vertices.
ResolutionMethod
The available resolutions for missing vertex check.
QgsGeometryMissingVertexCheck(const QgsGeometryCheckContext *context, const QVariantMap &geometryCheckConfiguration)
Creates a new missing vertex geometry check with context and the provided geometryCheckConfiguration.
Represents a 2D point.
Definition qgspointxy.h:62
Point geometry type, with support for z-dimension and m-values.
Definition qgspoint.h:53
A rectangle specified with double values.
Represents a vector layer which manages a vector based dataset.
#define SIP_SKIP
Definition qgis_sip.h:133
void CPL_STDCALL collectErrors(CPLErr, int, const char *msg)
Utility class for identifying a unique vertex within a geometry.
Definition qgsvertexid.h:34