Class: QgsGeometryCheckError¶
This represents an error reported by a geometry check.
Note
This class is a technology preview and unstable API.
Added in version 3.4.
Class Hierarchy¶
Subclasses¶
Wraps a |
- class qgis.analysis.QgsGeometryCheckError[source]¶
Bases:
object- __init__(check: QgsGeometryCheck | None, layerFeature: QgsGeometryCheckerUtils.LayerFeature, errorLocation: QgsPointXY, vidx: QgsVertexId = QgsVertexId(), value: Any = None, valueType: QgsGeometryCheckError.ValueType = QgsGeometryCheckError.ValueOther)
Create a new geometry check error with the parent
checkand for thelayerFeaturepair at theerrorLocation. Optionally the vertex can be specified viavixdand avaluewith itsvalueType for additional information.- Parameters:
check (Optional[QgsGeometryCheck])
layerFeature (QgsGeometryCheckerUtils.LayerFeature)
errorLocation (QgsPointXY)
vidx (
QgsVertexId= QgsVertexId())value (Any = None)
valueType (QgsGeometryCheckError.ValueType = QgsGeometryCheckError.ValueOther)
- __init__(check: QgsGeometryCheck | None, layerId: str | None, 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
checkand for the layer withlayerIdandfeatureId. Thegeometryof the error and theerrorLocationneed to be specified in map coordinates. Optionally the vertex can be specified viavixdand avaluewith itsvalueType for additional information.- Parameters:
check (Optional[QgsGeometryCheck])
layerId (Optional[str])
featureId (int)
geometry (QgsGeometry)
errorLocation (QgsPointXY)
vidx (
QgsVertexId= QgsVertexId())value (Any = None)
valueType (QgsGeometryCheckError.ValueType = QgsGeometryCheckError.ValueOther)
- __init__(a0: QgsGeometryCheckError)
- Parameters:
- class Status¶
Bases:
int
- StatusFixFailed = 1¶
- StatusFixed = 2¶
- StatusObsolete = 3¶
- StatusPending = 0¶
- ValueArea = 1¶
- ValueLength = 0¶
- ValueOther = 2¶
- class ValueType¶
Bases:
int
- virtual affectedAreaBBox(self) QgsRectangle[source]¶
The bounding box of the affected area of the error.
- Return type:
- check(self) QgsGeometryCheck | None[source]¶
The geometry check that created this error.
- Return type:
Optional[QgsGeometryCheck]
- virtual closeMatch(self, a0: QgsGeometryCheckError | None) bool[source]¶
Check if this error is almost equal to
other. If this returnsTrue, it can be used to update existing errors after re-checking.- Parameters:
a0 (Optional[QgsGeometryCheckError])
- Return type:
bool
- virtual contextBoundingBox(self) QgsRectangle[source]¶
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.
Added in version 3.10.
- Return type:
- virtual description(self) str[source]¶
The error description. By default the description of the parent check will be returned.
- Return type:
str
- featureId(self) int[source]¶
The id of the feature on which this error has been detected.
- Return type:
int
- geometry(self) QgsGeometry[source]¶
The geometry of the error in map units.
- Return type:
- virtual icon(self) QIcon[source]¶
Returns an icon that should be shown for this kind of error.
Added in version 3.8.
- Return type:
QIcon
- virtual isEqual(self, other: QgsGeometryCheckError | None) bool[source]¶
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 (Optional[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:
- resolutionMessage(self) str[source]¶
A message with details, how the error has been resolved.
- Return type:
str
- setFixFailed(self, reason: str | None)[source]¶
Set the error status to failed and specify the
reasonfor failure.- Parameters:
reason (Optional[str])
- setFixed(self, method: int)[source]¶
Set the status to fixed and specify the
methodthat has been used to fix the error.- Parameters:
method (int)
- status(self) QgsGeometryCheckError.Status[source]¶
The status of the error.
- Return type:
- virtual update(self, other: QgsGeometryCheckError | None)[source]¶
Update this error with the information from
other. Will be used to update existing errors whenever they are re-checked.- Parameters:
other (Optional[QgsGeometryCheckError])
- value(self) Any[source]¶
An additional value for the error. Lengths and areas are provided in map units.
See also
- Return type:
- valueType(self) QgsGeometryCheckError.ValueType[source]¶
The type of the value.
See also
- Return type:
- vidx(self) QgsVertexId¶
The id of the affected vertex. May be valid or not, depending on the check.
- Return type: