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;
104 Q_ENUM( ResolutionMethod )
117 void collectErrors(
const QMap<QString, QgsFeaturePool *> &featurePools, QList<QgsGeometryCheckError *> &errors, QStringList &messages,
QgsFeedback *feedback,
const LayerFeatureIds &ids = LayerFeatureIds() )
const override;
118 void fixError(
const QMap<QString, QgsFeaturePool *> &featurePools,
QgsGeometryCheckError *error,
int method,
const QMap<QString, int> &mergeAttributeIndices, Changes &changes )
const override;
119 Q_DECL_DEPRECATED QStringList resolutionMethods()
const override;
121 QList<QgsGeometryCheckResolutionMethod> availableResolutionMethods()
const override;
124 QString id()
const override;
125 QgsGeometryCheck::Flags flags()
const override;
129 static QString factoryDescription()
SIP_SKIP;
130 static QString factoryId()
SIP_SKIP;
144 bool mergeWithNeighbor(
const QMap<QString, QgsFeaturePool *> &featurePools,
147 const double mGapThresholdMapUnits;
149 std::unique_ptr<QgsVectorLayerFeatureSource> mAllowedGapsSource;
150 double mAllowedGapsBuffer = 0;
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Base configuration for geometry checks.
This represents an error reported by a geometry check.
virtual QMap< QString, QgsFeatureIds > involvedFeatures() const
Returns a list of involved features.
virtual void update(const QgsGeometryCheckError *other)
Update this error with the information from other.
virtual QString description() const
The error description.
virtual bool isEqual(QgsGeometryCheckError *other) const
Check if this error is equal to other.
virtual bool closeMatch(QgsGeometryCheckError *) const
Check if this error is almost equal to other.
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.
virtual bool handleChanges(const QgsGeometryCheck::Changes &changes)
Apply a list of changes.
virtual QgsRectangle contextBoundingBox() const
The context of the error.
This class implements a geometry check.
QMap< QString, QMap< QgsFeatureId, QList< QgsGeometryCheck::Change > > > Changes
A collection of changes.
CheckType
The type of a check.
An error produced by a QgsGeometryGapCheck.
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.
const QMap< QString, QgsFeatureIds > & neighbors() const
A map of layers and feature ids of the neighbors of the gap.
Checks for gaps between neighbouring polygons.
QList< QgsWkbTypes::GeometryType > compatibleGeometryTypes() const override
A list of geometry types for which this check can be performed.
QgsGeometryCheck::CheckType checkType() const override
Returns the check type.
ResolutionMethod
Resolution methods for geometry gap checks.
@ CreateNewFeature
Create a new feature with the gap geometry.
@ AddToAllowedGaps
Add gap geometry to allowed gaps layer.
@ MergeLongestEdge
Merge the gap with the polygon with the longest shared edge.
@ NoChange
Do not handle the error.
@ MergeLargestArea
Merge with neighbouring polygon with largest area.
A geometry is the spatial representation of a feature.
A rectangle specified with double values.
Represents a vector layer which manages a vector based data sets.
Handles storage of information regarding WKB types and their properties.
CORE_EXPORT QgsMeshVertex centroid(const QgsMeshFace &face, const QVector< QgsMeshVertex > &vertices)
Returns the centroid of the face.
QPointer< QgsMapLayer > QgsWeakMapLayerPointer
Weak pointer for QgsMapLayer.
Utility class for identifying a unique vertex within a geometry.