Class: QgsGeometryValidator

Validates geometries using the QGIS geometry validation model.

Class Hierarchy

Inheritance diagram of qgis.core.QgsGeometryValidator

Base classes

QThread

QObject

Methods

addError

stop

Static Methods

validateGeometry

Validate geometry and produce a list of geometry errors.

Signals

errorFound

Sent when an error has been found during the validation process.

validationFinished

Sent when the validation is finished.

class qgis.core.QgsGeometryValidator[source]

Bases: QThread

__init__(geometry: QgsGeometry, errors: Iterable[QgsGeometry.Error] | None = [], method: Qgis.GeometryValidationEngine = Qgis.GeometryValidationEngine.QgisInternal)

Constructor for QgsGeometryValidator.

Parameters:
  • geometry (QgsGeometry)

  • errors (Optional[Iterable[QgsGeometry.Error]] = [])

  • method (Qgis.GeometryValidationEngine = Qgis.GeometryValidationEngine.QgisInternal)

addError(self, a0: QgsGeometry.Error)[source]
Parameters:

a0 (QgsGeometry.Error)

signal errorFound(error: QgsGeometry.Error)[source]

Sent when an error has been found during the validation process.

The error contains details about the error.

Parameters:

error (QgsGeometry.Error)

stop(self)[source]
static validateGeometry(geometry: QgsGeometry, method: Qgis.GeometryValidationEngine = Qgis.GeometryValidationEngine.QgisInternal) List[QgsGeometry.Error][source]

Validate geometry and produce a list of geometry errors. This method blocks the thread until the validation is finished.

Parameters:
  • geometry (QgsGeometry)

  • method (Qgis.GeometryValidationEngine = Qgis.GeometryValidationEngine.QgisInternal)

Return type:

List[QgsGeometry.Error]

signal validationFinished(summary: str)[source]

Sent when the validation is finished.

The result is in a human readable summary, mentioning if the validation has been aborted, successfully been validated or how many errors have been found.

Added in version 3.6.

Parameters:

summary (str)