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;
114 void fixError(
const QMap<QString, QgsFeaturePool *> &featurePools,
QgsGeometryCheckError *error,
int method,
const QMap<QString, int> &mergeAttributeIndices,
Changes &changes )
const override;
118 QString
id()
const override;
119 QgsGeometryCheck::Flags
flags()
const override;
123 static QString factoryDescription()
SIP_SKIP;
124 static QString factoryId()
SIP_SKIP;
125 static QgsGeometryCheck::Flags factoryFlags()
SIP_SKIP;
126 static QList<QgsWkbTypes::GeometryType> factoryCompatibleGeometryTypes()
SIP_SKIP;
132 bool mergeWithNeighbor(
const QMap<QString, QgsFeaturePool *> &featurePools,
135 const double mGapThresholdMapUnits;
137 std::unique_ptr<QgsVectorLayerFeatureSource> mAllowedGapsSource;
138 double mAllowedGapsBuffer;
142 #endif // QGS_GEOMETRY_GAP_CHECK_H A rectangle specified with double values.
QList< QgsWkbTypes::GeometryType > compatibleGeometryTypes() const override
A list of geometry types for which this check can be performed.
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 void update(const QgsGeometryCheckError *other)
Update this error with the information from other.
Checks for gaps between neighbouring polygons.
virtual QgsRectangle contextBoundingBox() const
The context of the error.
virtual bool closeMatch(QgsGeometryCheckError *) const
Check if this error is almost equal to other.
Base configuration for geometry checks.
CheckType
The type of a check.
A geometry is the spatial representation of a feature.
QPointer< QgsMapLayer > QgsWeakMapLayerPointer
Weak pointer for QgsMapLayer.
Base class for feedback objects to be used for cancellation of something running in a worker thread...
An error produced by a QgsGeometryGapCheck.
Utility class for identifying a unique vertex within a geometry.
virtual QString id() const =0
Returns an id for this check.
This class implements a geometry check.
ResolutionMethod
Resolution methods for geometry gap checks.
QgsGeometryCheck::CheckType checkType() const override
Returns the check type.
A list of layers and feature ids for each of these layers.
virtual QIcon icon() const
Returns an icon that should be shown for this kind of error.
const QMap< QString, QgsFeatureIds > & neighbors() const
A map of layers and feature ids of the neighbors of the gap.
virtual QMap< QString, QgsFeatureIds > involvedFeatures() const
Returns a list of involved features.
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 QgsRectangle affectedAreaBBox() const
The bounding box of the affected area of the error.
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 bool handleChanges(const QgsGeometryCheck::Changes &changes)
Apply a list of changes.
virtual QStringList resolutionMethods() const =0
Returns a list of descriptions for available resolutions for errors.
virtual QgsGeometryCheck::Flags flags() const
Flags for this geometry check.
This represents an error reported by a geometry check.
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.
Represents a vector layer which manages a vector based data sets.
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 bool isEqual(QgsGeometryCheckError *other) const
Check if this error is equal to other.
Merge the gap with the polygon with the longest shared edge.