Class: QgsGeometryCheckContext

Base configuration for geometry checks.

Note

This class is a technology preview and unstable API.

Added in version 3.4.

Methods

project

The project can be used to resolve additional layers.

Attributes

mapCrs

reducedTolerance

tolerance

transformContext

uniqueIdFieldIndex

class qgis.analysis.QgsGeometryCheckContext[source]

Bases: object

__init__(precision: int, mapCrs: QgsCoordinateReferenceSystem, transformContext: QgsCoordinateTransformContext, mProject: QgsProject | None = None, uniqueIdFieldIndex: int = -1)

Creates a new QgsGeometryCheckContext.

Parameters:
  • precision (int) – The precision used to define gemetry check tolerance. Tolerance is calculated as pow(10, -precision)

  • mapCrs (QgsCoordinateReferenceSystem) – The coordinate system in which calculations should be done

  • transformContext (QgsCoordinateTransformContext) – The coordinate transform context

  • mProject (Optional[QgsProject] = None) – The project used to resolve additional layers

  • uniqueIdFieldIndex (int = -1) – The index of the unique ID field used to identify features. If set to valid field index, geometry checker will fail if this field is not unique (since QGIS 4.0)

mapCrs
project(self) QgsProject | None[source]

The project can be used to resolve additional layers.

This must only be accessed from the main thread (i.e. do not access from the collectError method)

Added in version 3.10.

Return type:

Optional[QgsProject]

reducedTolerance
tolerance
transformContext
uniqueIdFieldIndex