QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
18 #ifndef QGS_GEOMETRY_GAP_CHECK_H
19 #define QGS_GEOMETRY_GAP_CHECK_H
42 const QString &layerId,
44 const QMap<QString, QgsFeatureIds> &neighbors,
49 , mNeighbors( neighbors )
50 , mGapAreaBBox( gapAreaBBox )
51 , mContextBoundingBox( contextArea )
60 const QMap<QString, QgsFeatureIds> &
neighbors()
const {
return mNeighbors; }
74 QIcon
icon()
const override;
77 QMap<QString, QgsFeatureIds> mNeighbors;
102 Q_ENUM( ResolutionMethod )
115 void collectErrors(
const QMap<QString, QgsFeaturePool *> &featurePools, QList<QgsGeometryCheckError *> &errors, QStringList &messages,
QgsFeedback *feedback,
const LayerFeatureIds &ids = LayerFeatureIds() )
const override;
116 void fixError(
const QMap<QString, QgsFeaturePool *> &featurePools,
QgsGeometryCheckError *error,
int method,
const QMap<QString, int> &mergeAttributeIndices, Changes &changes )
const override;
122 QString
id()
const override;
123 QgsGeometryCheck::Flags
flags()
const override;
127 static QString factoryDescription()
SIP_SKIP;
128 static QString factoryId()
SIP_SKIP;
142 bool mergeWithNeighbor(
const QMap<QString, QgsFeaturePool *> &featurePools,
145 const double mGapThresholdMapUnits;
147 std::unique_ptr<QgsVectorLayerFeatureSource> mAllowedGapsSource;
148 double mAllowedGapsBuffer = 0;
152 #endif // QGS_GEOMETRY_GAP_CHECK_H
virtual void prepare(const QgsGeometryCheckContext *context, const QVariantMap &configuration)
Will be run in the main thread before collectErrors is called (which may be run from a background thr...
virtual QgsRectangle contextBoundingBox() const
The context of the error.
virtual bool closeMatch(QgsGeometryCheckError *) const
Check if this error is almost equal to other.
const QMap< QString, QgsFeatureIds > & neighbors() const
A map of layers and feature ids of the neighbors of the gap.
@ AddToAllowedGaps
Add gap geometry to allowed gaps layer.
QList< QgsWkbTypes::GeometryType > compatibleGeometryTypes() const override
A list of geometry types for which this check can be performed.
QMap< QString, QMap< QgsFeatureId, QList< QgsGeometryCheck::Change > > > Changes
A collection of changes.
virtual QString description() const =0
Returns a human readable description for this check.
virtual Q_DECL_DEPRECATED QStringList resolutionMethods() const
Returns a list of descriptions for available resolutions for errors.
virtual void collectErrors(const QMap< QString, QgsFeaturePool * > &featurePools, QList< QgsGeometryCheckError * > &errors, QStringList &messages, QgsFeedback *feedback, const LayerFeatureIds &ids=QgsGeometryCheck::LayerFeatureIds()) const =0
The main worker method.
@ CreateNewFeature
Create a new feature with the gap geometry.
QgsGeometryGapCheckError(const QgsGeometryCheck *check, const QString &layerId, const QgsGeometry &geometry, const QMap< QString, QgsFeatureIds > &neighbors, double area, const QgsRectangle &gapAreaBBox, const QgsRectangle &contextArea)
Create a new gap check error produced by check on the layer layerId.
virtual QgsGeometryCheck::Flags flags() const
Flags for this geometry check.
virtual void fixError(const QMap< QString, QgsFeaturePool * > &featurePools, QgsGeometryCheckError *error, int method, const QMap< QString, int > &mergeAttributeIndices, Changes &changes) const
Fixes the error error with the specified method.
virtual QString id() const =0
Returns an id for this check.
@ NoChange
Do not handle the error.
virtual QgsRectangle affectedAreaBBox() const
The bounding box of the affected area of the error.
virtual bool handleChanges(const QgsGeometryCheck::Changes &changes)
Apply a list of changes.
virtual QList< QgsGeometryCheckResolutionMethod > availableResolutionMethods() const
Returns a list of available resolution methods.
@ MergeLongestEdge
Merge the gap with the polygon with the longest shared edge.
QPointer< QgsMapLayer > QgsWeakMapLayerPointer
Weak pointer for QgsMapLayer.
virtual bool isEqual(QgsGeometryCheckError *other) const
Check if this error is equal to other.
@ MergeLargestArea
Merge with neighbouring polygon with largest area.
QgsGeometryCheck::CheckType checkType() const override
Returns the check type.
CheckType
The type of a check.
Utility class for identifying a unique vertex within a geometry.
virtual void update(const QgsGeometryCheckError *other)
Update this error with the information from other.
Handles storage of information regarding WKB types and their properties.
ResolutionMethod
Resolution methods for geometry gap checks.
virtual QIcon icon() const
Returns an icon that should be shown for this kind of error.
virtual QMap< QString, QgsFeatureIds > involvedFeatures() const
Returns a list of involved features.