25 QMap<QString, QSet<QVariant>> uniqueIds;
35 if (
context()->uniqueIdFieldIndex != -1 )
45 for (
const auto error : singleErrors )
46 errors.append( convertToGeometryCheckError( error, layerFeature ) );
80 return mCheck->description();
Base class for feedback objects to be used for cancellation of something running in a worker thread.
bool isCanceled() const
Tells whether the operation has been canceled already.
Wraps a QgsSingleGeometryError into a standard QgsGeometryCheckError.
QgsGeometryCheckErrorSingle(QgsSingleGeometryCheckError *singleError, const QgsGeometryCheckerUtils::LayerFeature &layerFeature)
Creates a new error for a QgsSingleGeometryCheck.
bool handleChanges(const QgsGeometryCheck::Changes &changes) override
Apply a list of changes.
QgsSingleGeometryCheckError * singleError() const
The underlying single error.
QgsFeatureId featureId() const
The id of the feature on which this error has been detected.
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...
QVariant value() const
An additional value for the error.
const QgsGeometryCheck * check() const
The geometry check that created this error.
const QString & layerId() const
The id of the layer on which this error has been detected.
virtual bool handleChanges(const QgsGeometryCheck::Changes &changes)
Apply a list of changes.
QMap< QString, QMap< QgsFeatureId, QList< QgsGeometryCheck::Change > > > Changes
A collection of changes.
const QgsGeometryCheckContext * mContext
QMap< QString, QgsFeatureIds > allLayerFeatureIds(const QMap< QString, QgsFeaturePool * > &featurePools) const
Returns all layers and feature ids.
Result checkUniqueId(const QgsGeometryCheckerUtils::LayerFeature layerFeature, QMap< QString, QSet< QVariant > > &uniqueIds) const
Checks that there are no duplicated unique IDs.
Result
Result of the geometry checker operation.
@ Canceled
User canceled calculation.
@ Success
Operation completed successfully.
virtual QList< Qgis::GeometryType > compatibleGeometryTypes() const =0
A list of geometry types for which this check can be performed.
const QgsGeometryCheckContext * context() const
Returns the context.
A layer feature combination to uniquely identify and access a feature in a set of layers.
Contains a set of layers and feature ids in those layers to pass to a geometry check.
A geometry is the spatial representation of a feature.
An error from a QgsSingleGeometryCheck.
QgsGeometry errorLocation() const
The exact location of the error.
const QgsSingleGeometryCheck * mCheck
virtual bool isEqual(const QgsSingleGeometryCheckError *other) const
Check if this error is equal to other.
virtual QString description() const
A human readable description of this error.
QgsSingleGeometryCheckError(const QgsSingleGeometryCheck *check, const QgsGeometry &geometry, const QgsGeometry &errorLocation, const QgsVertexId &vertexId=QgsVertexId())
Creates a new single geometry check error.
QgsGeometry mErrorLocation
virtual bool handleChanges(const QList< QgsGeometryCheck::Change > &changes)
Apply a list of changes.
const QgsSingleGeometryCheck * check() const
The check that created this error.
QgsVertexId vertexId() const
The vertex id of the error.
virtual void update(const QgsSingleGeometryCheckError *other)
Update this error with the information from other.
Base class for geometry checks for a single geometry without any context of the layer or other layers...
QgsGeometryCheck::Result collectErrors(const QMap< QString, QgsFeaturePool * > &featurePools, QList< QgsGeometryCheckError * > &errors, QStringList &messages, QgsFeedback *feedback=nullptr, const QgsGeometryCheck::LayerFeatureIds &ids=QgsGeometryCheck::LayerFeatureIds()) const final
The main worker method.
virtual QList< QgsSingleGeometryCheckError * > processGeometry(const QgsGeometry &geometry) const =0
Check the geometry for errors.
A list of layers and feature ids for each of these layers.
QMap< QString, QgsFeatureIds > toMap() const
Utility class for identifying a unique vertex within a geometry.