Class: QgsGeometryCheckError

class qgis.analysis.QgsGeometryCheckError(check: QgsGeometryCheck, layerFeature: QgsGeometryCheckerUtils.LayerFeature, errorLocation: QgsPointXY, vidx: QgsVertexId = QgsVertexId(), value: Any = None, valueType: QgsGeometryCheckError.ValueType = QgsGeometryCheckError.ValueOther)

Bases: sip.wrapper

Create a new geometry check error with the parent check and for the layerFeature pair at the errorLocation. Optionally the vertex can be specified via vixd and a value with its value Type for additional information.

QgsGeometryCheckError(check: QgsGeometryCheck, layerId: str, featureId: int, geometry: QgsGeometry, errorLocation: QgsPointXY, vidx: QgsVertexId = QgsVertexId(), value: Any = None, valueType: QgsGeometryCheckError.ValueType = QgsGeometryCheckError.ValueOther) Create a new geometry check error with the parent check and for the layer with layerId and featureId. The geometry of the error and the errorLocation need to be specified in map coordinates. Optionally the vertex can be specified via vixd and a value with its value Type for additional information.

QgsGeometryCheckError(QgsGeometryCheckError)

This represents an error reported by a geometry check.

Note

This class is a technology preview and unstable API.

New in version 3.4.

Parameters
class Status

Bases: int

StatusFixFailed = 1
StatusFixed = 2
StatusObsolete = 3
StatusPending = 0
ValueArea = 1
ValueLength = 0
ValueOther = 2
class ValueType

Bases: int

affectedAreaBBox(self) → QgsRectangle

The bounding box of the affected area of the error.

Return type

QgsRectangle

check(self) → QgsGeometryCheck

The geometry check that created this error.

Return type

QgsGeometryCheck

closeMatch(self, QgsGeometryCheckError) → bool

Check if this error is almost equal to other. If this returns True, it can be used to update existing errors after re-checking.

Return type

bool

contextBoundingBox(self) → QgsRectangle

The context of the error. For topology checks like gap checks this returns the context of an error and the involved features. May be a NULL rectangle.

New in version 3.10.

Return type

QgsRectangle

description(self) → str

The error description. By default the description of the parent check will be returned.

Return type

str

featureId(self) → int

The id of the feature on which this error has been detected.

Return type

int

geometry(self) → QgsGeometry

The geometry of the error in map units.

Return type

QgsGeometry

icon(self) → QIcon

Returns an icon that should be shown for this kind of error.

New in version 3.8.

Return type

QIcon

isEqual(self, other: QgsGeometryCheckError) → bool

Check if this error is equal to other. Is reimplemented by subclasses with additional information, comparison of base information is done in parent class.

Parameters

other (QgsGeometryCheckError) –

Return type

bool

layerId(self) → str

The id of the layer on which this error has been detected.

Return type

str

location(self) → QgsPointXY

The location of the error in map units.

Return type

QgsPointXY

resolutionMessage(self) → str

A message with details, how the error has been resolved.

Return type

str

setFixFailed(self, reason: str)

Set the error status to failed and specify the reason for failure.

Parameters

reason (str) –

setFixed(self, method: int)

Set the status to fixed and specify the method that has been used to fix the error.

Parameters

method (int) –

setObsolete(self)

Set the error status to obsolete.

status(self) → QgsGeometryCheckError.Status

The status of the error.

Return type

QgsGeometryCheckError.Status

update(self, other: QgsGeometryCheckError)

Update this error with the information from other. Will be used to update existing errors whenever they are re-checked.

Parameters

other (QgsGeometryCheckError) –

value(self) → Any

An additional value for the error. Lengths and areas are provided in map units.

See also

valueType()

Return type

Any

valueType(self) → QgsGeometryCheckError.ValueType

The type of the value.

See also

value()

Return type

QgsGeometryCheckError.ValueType

vidx(self) → QgsVertexId

The id of the affected vertex. May be valid or not, depending on the check.

Return type

QgsVertexId