Class: QgsSingleGeometryCheck

class qgis.analysis.QgsSingleGeometryCheck

Bases: QgsGeometryCheck

Base class for geometry checks for a single geometry without any context of the layer or other layers in the project. Classic examples are validity checks like self-intersection.

Subclasses need to implement the processGeometry method.

New in version 3.4.

QgsSingleGeometryCheck(context: QgsGeometryCheckContext, configuration: Dict[str, Any]) Creates a new single geometry check.

QgsSingleGeometryCheck(QgsSingleGeometryCheck)

Methods

collectErrors

param featurePools:

processGeometry

Check the geometry for errors.

collectErrors(self, featurePools: object, errors: Iterable[QgsGeometryCheckError], messages: Iterable[str], feedback: QgsFeedback = None, ids: QgsGeometryCheck.LayerFeatureIds = QgsGeometryCheck.LayerFeatureIds())
Parameters:
  • featurePools (object) –

  • errors (Iterable[QgsGeometryCheckError]) –

  • messages (Iterable[str]) –

  • feedback (QgsFeedback = None) –

  • ids (QgsGeometryCheck.LayerFeatureIds = QgsGeometryCheck.LayerFeatureIds()) –

processGeometry(self, geometry: QgsGeometry) List[QgsSingleGeometryCheckError]

Check the geometry for errors. It may make use of configuration options.

Returns a list of QgsSingleGeometryCheckErrors, ownership is transferred to the caller. An empty list is returned for geometries without errors.

New in version 3.4.

Parameters:

geometry (QgsGeometry) –

Return type:

List[QgsSingleGeometryCheckError]