QgsGeometryCheckError class
This represents an error reported by a geometry check.
Contents
Derived classes
- class QgsGeometryCheckErrorSingle
- Wraps a QgsSingleGeometryError into a standard QgsGeometryCheckError.
- class QgsGeometryGapCheckError
- An error produced by a QgsGeometryGapCheck.
- class QgsGeometryOverlapCheckError
- An error of a QgsGeometryOverlapCheck.
Public types
- enum Status { StatusPending, StatusFixFailed, StatusFixed, StatusObsolete }
- The status of an error.
- enum ValueType { ValueLength, ValueArea, ValueOther }
- Describes the type of an error value.
Constructors, destructors, conversion operators
-
QgsGeometryCheckError(const QgsGeometryCheck* check,
const QgsGeometryCheckerUtils::
LayerFeature& layerFeature, const QgsPointXY& errorLocation, QgsVertexId vidx = QgsVertexId(), const QVariant& value = QVariant(), ValueType valueType = ValueOther) - Create a new geometry check error with the parent check and for the layerFeature pair at the errorLocation.
- QgsGeometryCheckError(const QgsGeometryCheck* check, const QString& layerId, QgsFeatureId featureId, const QgsGeometry& geometry, const QgsPointXY& errorLocation, QgsVertexId vidx = QgsVertexId(), const QVariant& value = QVariant(), ValueType valueType = ValueOther) protected
- Create a new geometry check error with the parent check and for the layer with layerId and featureId.
Public functions
- auto affectedAreaBBox() const -> QgsRectangle virtual
- The bounding box of the affected area of the error.
- auto check() const -> const QgsGeometryCheck*
- The geometry check that created this error.
- auto closeMatch(QgsGeometryCheckError*) const -> bool virtual
- Check if this error is almost equal to other.
- auto description() const -> QString virtual
- The error description.
- auto featureId() const -> QgsFeatureId
- The id of the feature on which this error has been detected.
- auto geometry() const -> QgsGeometry
- The geometry of the error in map units.
-
auto handleChanges(const QgsGeometryCheck::
Changes& changes) -> bool virtual - Apply a list of changes.
- auto isEqual(QgsGeometryCheckError* other) const -> bool virtual
- Check if this error is equal to other.
- auto layerId() const -> const QString&
- The id of the layer on which this error has been detected.
- auto location() const -> const QgsPointXY&
- The location of the error in map units.
- auto resolutionMessage() const -> QString
- A message with details, how the error has been resolved.
- void setFixed(int method)
- Set the status to fixed and specify the method that has been used to fix the error.
- void setFixFailed(const QString& reason)
- Set the error status to failed and specify the reason for failure.
- void setObsolete()
- Set the error status to obsolete.
- auto status() const -> Status
- The status of the error.
- void update(const QgsGeometryCheckError* other) virtual
- Update this error with the information from other.
- auto value() const -> QVariant
- An additional value for the error.
- auto valueType() const -> ValueType
- The type of the value.
- auto vidx() const -> const QgsVertexId&
- The id of the affected vertex.
Enum documentation
enum QgsGeometryCheckError:: Status
The status of an error.
| Enumerators | |
|---|---|
| StatusPending |
The error is detected and pending to be handled. |
| StatusFixFailed |
A fix has been tried on the error but failed. |
| StatusFixed |
The error is fixed. |
| StatusObsolete |
The error is obsolete because of other modifications. |
enum QgsGeometryCheckError:: ValueType
Describes the type of an error value.
| Enumerators | |
|---|---|
| ValueLength |
The value is a length. |
| ValueArea |
The value is an area. |
| ValueOther |
The value if of another type. |
Function documentation
QgsGeometryCheckError:: QgsGeometryCheckError(const QgsGeometryCheck* check,
const QgsGeometryCheckerUtils:: LayerFeature& layerFeature,
const QgsPointXY& errorLocation,
QgsVertexId vidx = QgsVertexId(),
const QVariant& value = QVariant(),
ValueType valueType = ValueOther)
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:: QgsGeometryCheckError(const QgsGeometryCheck* check,
const QString& layerId,
QgsFeatureId featureId,
const QgsGeometry& geometry,
const QgsPointXY& errorLocation,
QgsVertexId vidx = QgsVertexId(),
const QVariant& value = QVariant(),
ValueType valueType = ValueOther) protected
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.
bool QgsGeometryCheckError:: closeMatch(QgsGeometryCheckError*) const virtual
Check if this error is almost equal to other.
If this returns true, it can be used to update existing errors after re-checking.
QString QgsGeometryCheckError:: description() const virtual
The error description.
By default the description of the parent check will be returned.
bool QgsGeometryCheckError:: isEqual(QgsGeometryCheckError* other) const virtual
Check if this error is equal to other.
Is reimplemented by subclasses with additional information, comparison of base information is done in parent class.
void QgsGeometryCheckError:: update(const QgsGeometryCheckError* other) virtual
Update this error with the information from other.
Will be used to update existing errors whenever they are re-checked.
QVariant QgsGeometryCheckError:: value() const
An additional value for the error.
Lengths and areas are provided in map units.
const QgsVertexId& QgsGeometryCheckError:: vidx() const
The id of the affected vertex.
May be valid or not, depending on the check.