QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
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;
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;
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;
154 #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.
CORE_EXPORT QgsMeshVertex centroid(const QgsMeshFace &face, const QVector< QgsMeshVertex > &vertices)
Returns the centroid of the face.
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.
A rectangle specified with double values.
@ 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.
This class implements a geometry check.
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.
Base class for feedback objects to be used for cancellation of something running in a worker thread.
virtual QList< QgsGeometryCheckResolutionMethod > availableResolutionMethods() const
Returns a list of available resolution methods.
An error produced by a QgsGeometryGapCheck.
@ MergeLongestEdge
Merge the gap with the polygon with the longest shared edge.
Base configuration for geometry checks.
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.
A geometry is the spatial representation of a feature.
Represents a vector layer which manages a vector based data sets.
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.
Checks for gaps between neighbouring polygons.
Handles storage of information regarding WKB types and their properties.
ResolutionMethod
Resolution methods for geometry gap checks.
This represents an error reported by a geometry check.
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.