QgsGeometryOverlapCheck class

Checks if geometries overlap.

Base classes

class QgsGeometryCheck
This class implements a geometry check.

Public types

enum ResolutionMethod { Subtract, NoChange }
Available resolution methods.

Constructors, destructors, conversion operators

QgsGeometryOverlapCheck(const QgsGeometryCheckContext* context, const QVariantMap& configuration)
Checks for overlapping polygons.

Public functions

auto checkType() const -> QgsGeometryCheck::CheckType override
Returns the check type.
void collectErrors(const QMap<QString, QgsFeaturePool*>& featurePools, QList<QgsGeometryCheckError*>& errors, QStringList& messages, QgsFeedback* feedback, const LayerFeatureIds& ids = LayerFeatureIds()) const override
The main worker method.
auto compatibleGeometryTypes() const -> QList<QgsWkbTypes::GeometryType> override
A list of geometry types for which this check can be performed.
auto description() const -> QString override
Returns a human readable description for this check.
void fixError(const QMap<QString, QgsFeaturePool*>& featurePools, QgsGeometryCheckError* error, int method, const QMap<QString, int>& mergeAttributeIndices, Changes& changes) const override
Fix the error error with the specified method.
auto flags() const -> QgsGeometryCheck::Flags override
Flags for this geometry check.
auto id() const -> QString override
Returns an id for this check.
auto resolutionMethods() const -> QStringList override
Returns a list of descriptions for available resolutions for errors.

Enum documentation

enum QgsGeometryOverlapCheck::ResolutionMethod

Available resolution methods.

Enumerators
Subtract

Subtract the overlap region from the polygon.

NoChange

Do not change anything.

Function documentation

QgsGeometryOverlapCheck::QgsGeometryOverlapCheck(const QgsGeometryCheckContext* context, const QVariantMap& configuration)

Checks for overlapping polygons.

In configuration a maxOverlapArea parameter can be passed. In case this parameter is set to something else than 0.0, the error will only be reported if the overlapping area is smaller than maxOverlapArea. Overlapping areas smaller than the reducedTolerance parameter of the context are ignored.

QgsGeometryCheck::CheckType QgsGeometryOverlapCheck::checkType() const override

Returns the check type.

void QgsGeometryOverlapCheck::collectErrors(const QMap<QString, QgsFeaturePool*>& featurePools, QList<QgsGeometryCheckError*>& errors, QStringList& messages, QgsFeedback* feedback, const LayerFeatureIds& ids = LayerFeatureIds()) const override

The main worker method.

Check all features available from featurePools and write errors found to errors. Other status messages can be written to messages. Progress should be reported to feedback. Only features and layers listed in ids should be checked.

QList<QgsWkbTypes::GeometryType> QgsGeometryOverlapCheck::compatibleGeometryTypes() const override

A list of geometry types for which this check can be performed.

QString QgsGeometryOverlapCheck::description() const override

Returns a human readable description for this check.

void QgsGeometryOverlapCheck::fixError(const QMap<QString, QgsFeaturePool*>& featurePools, QgsGeometryCheckError* error, int method, const QMap<QString, int>& mergeAttributeIndices, Changes& changes) const override

Fix the error error with the specified method.

QString QgsGeometryOverlapCheck::id() const override

Returns an id for this check.

QStringList QgsGeometryOverlapCheck::resolutionMethods() const override

Returns a list of descriptions for available resolutions for errors.

The index will be passed as method to