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 thelayerFeature
pair at theerrorLocation
. Optionally the vertex can be specified viavixd
and avalue
with itsvalue
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 parentcheck
and for the layer withlayerId
andfeatureId
. Thegeometry
of the error and theerrorLocation
need to be specified in map coordinates. Optionally the vertex can be specified viavixd
and avalue
with itsvalue
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
check (QgsGeometryCheck) –
layerFeature (QgsGeometryCheckerUtils.LayerFeature) –
errorLocation (QgsPointXY) –
vidx (
QgsVertexId
= QgsVertexId()) –value (Any = None) –
valueType –
-
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
-
check
(self) → QgsGeometryCheck¶ The geometry check that created this error.
- Return type
-
closeMatch
(self, QgsGeometryCheckError) → bool¶ Check if this error is almost equal to
other
. If this returnsTrue
, 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
-
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
-
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
-
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
-
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
- Return type
Any
-
valueType
(self) → QgsGeometryCheckError.ValueType¶ 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