QGIS API Documentation 3.41.0-Master (cea29feecf2)
|
This represents an error reported by a geometry check. More...
#include <qgsgeometrycheckerror.h>
Public Types | |
enum | Status { StatusPending , StatusFixFailed , StatusFixed , StatusObsolete } |
The status of an error. More... | |
enum | ValueType { ValueLength , ValueArea , ValueOther } |
Describes the type of an error value. More... | |
Public Member Functions | |
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. | |
virtual | ~QgsGeometryCheckError ()=default |
virtual QgsRectangle | affectedAreaBBox () const |
The bounding box of the affected area of the error. | |
const QgsGeometryCheck * | check () const |
The geometry check that created this error. | |
virtual bool | closeMatch (QgsGeometryCheckError *) const |
Check if this error is almost equal to other. | |
virtual QgsRectangle | contextBoundingBox () const |
The context of the error. | |
virtual QString | description () const |
The error description. | |
QgsFeatureId | featureId () const |
The id of the feature on which this error has been detected. | |
QgsGeometry | geometry () const |
The geometry of the error in map units. | |
virtual bool | handleChanges (const QgsGeometryCheck::Changes &changes) |
Apply a list of changes. | |
virtual QIcon | icon () const |
Returns an icon that should be shown for this kind of error. | |
virtual QMap< QString, QgsFeatureIds > | involvedFeatures () const |
Returns a list of involved features. | |
virtual bool | isEqual (QgsGeometryCheckError *other) const |
Check if this error is equal to other. | |
const QString & | layerId () const |
The id of the layer on which this error has been detected. | |
const QgsPointXY & | location () const |
The location of the error in map units. | |
const QgsGeometryCheckError & | operator= (const QgsGeometryCheckError &)=delete |
QString | resolutionMessage () const |
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. | |
Status | status () const |
The status of the error. | |
virtual void | update (const QgsGeometryCheckError *other) |
Update this error with the information from other. | |
QVariant | value () const |
An additional value for the error. | |
ValueType | valueType () const |
The type of the value. | |
const QgsVertexId & | vidx () const |
The id of the affected vertex. | |
Protected Member Functions | |
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) | |
Create a new geometry check error with the parent check and for the layer with layerId and featureId. | |
Protected Attributes | |
const QgsGeometryCheck * | mCheck = nullptr |
QgsPointXY | mErrorLocation |
QgsFeatureId | mFeatureId |
QgsGeometry | mGeometry |
QString | mLayerId |
QString | mResolutionMessage |
Status | mStatus |
QVariant | mValue |
ValueType | mValueType |
QgsVertexId | mVidx |
This represents an error reported by a geometry check.
Definition at line 35 of file qgsgeometrycheckerror.h.
The status of an error.
Definition at line 41 of file qgsgeometrycheckerror.h.
Describes the type of an error value.
Enumerator | |
---|---|
ValueLength | The value is a length. |
ValueArea | The value is an area. |
ValueOther | The value if of another type. |
Definition at line 52 of file qgsgeometrycheckerror.h.
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.
Definition at line 34 of file qgsgeometrycheckerror.cpp.
|
virtualdefault |
|
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.
Definition at line 21 of file qgsgeometrycheckerror.cpp.
|
virtual |
The bounding box of the affected area of the error.
Reimplemented in QgsGeometryGapCheckError, and QgsGeometryMissingVertexCheckError.
Definition at line 78 of file qgsgeometrycheckerror.cpp.
|
inline |
The geometry check that created this error.
Definition at line 74 of file qgsgeometrycheckerror.h.
|
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.
Reimplemented in QgsGeometryGapCheckError, and QgsGeometryOverlapCheckError.
Definition at line 105 of file qgsgeometrycheckerror.cpp.
|
virtual |
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.
Reimplemented in QgsGeometryGapCheckError.
Definition at line 73 of file qgsgeometrycheckerror.cpp.
|
inlinevirtual |
The error description.
By default the description of the parent check will be returned.
Reimplemented in QgsGeometryOverlapCheckError.
Definition at line 110 of file qgsgeometrycheckerror.h.
|
inline |
The id of the feature on which this error has been detected.
Definition at line 84 of file qgsgeometrycheckerror.h.
QgsGeometry QgsGeometryCheckError::geometry | ( | ) | const |
The geometry of the error in map units.
Definition at line 68 of file qgsgeometrycheckerror.cpp.
|
virtual |
Apply a list of changes.
Reimplemented in QgsGeometryGapCheckError, QgsGeometryOverlapCheckError, and QgsGeometryCheckErrorSingle.
Definition at line 110 of file qgsgeometrycheckerror.cpp.
|
virtual |
Returns an icon that should be shown for this kind of error.
Reimplemented in QgsGeometryGapCheckError, QgsGeometryMissingVertexCheckError, and QgsGeometryOverlapCheckError.
Definition at line 181 of file qgsgeometrycheckerror.cpp.
|
virtual |
Returns a list of involved features.
By default returns an empty map. The map keys are layer ids, the map value is a set of feature ids.
Reimplemented in QgsGeometryGapCheckError, QgsGeometryMissingVertexCheckError, and QgsGeometryOverlapCheckError.
Definition at line 176 of file qgsgeometrycheckerror.cpp.
|
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.
Reimplemented in QgsGeometryContainedCheckError, QgsGeometryDuplicateCheckError, QgsGeometryGapCheckError, and QgsGeometryOverlapCheckError.
Definition at line 100 of file qgsgeometrycheckerror.cpp.
|
inline |
The id of the layer on which this error has been detected.
Definition at line 79 of file qgsgeometrycheckerror.h.
|
inline |
The location of the error in map units.
Definition at line 115 of file qgsgeometrycheckerror.h.
|
delete |
|
inline |
A message with details, how the error has been resolved.
Definition at line 144 of file qgsgeometrycheckerror.h.
void QgsGeometryCheckError::setFixed | ( | int | method | ) |
Set the status to fixed and specify the method that has been used to fix the error.
Definition at line 83 of file qgsgeometrycheckerror.cpp.
void QgsGeometryCheckError::setFixFailed | ( | const QString & | reason | ) |
Set the error status to failed and specify the reason for failure.
Definition at line 94 of file qgsgeometrycheckerror.cpp.
|
inline |
Set the error status to obsolete.
Definition at line 160 of file qgsgeometrycheckerror.h.
|
inline |
The status of the error.
Definition at line 139 of file qgsgeometrycheckerror.h.
|
virtual |
Update this error with the information from other.
Will be used to update existing errors whenever they are re-checked.
Reimplemented in QgsGeometryGapCheckError.
Definition at line 189 of file qgsgeometrycheckerror.cpp.
|
inline |
An additional value for the error.
Lengths and areas are provided in map units.
Definition at line 122 of file qgsgeometrycheckerror.h.
|
inline |
|
inline |
The id of the affected vertex.
May be valid or not, depending on the check.
Definition at line 134 of file qgsgeometrycheckerror.h.
|
protected |
Definition at line 213 of file qgsgeometrycheckerror.h.
|
protected |
Definition at line 217 of file qgsgeometrycheckerror.h.
|
protected |
Definition at line 215 of file qgsgeometrycheckerror.h.
|
protected |
Definition at line 216 of file qgsgeometrycheckerror.h.
|
protected |
Definition at line 214 of file qgsgeometrycheckerror.h.
|
protected |
Definition at line 222 of file qgsgeometrycheckerror.h.
|
protected |
Definition at line 221 of file qgsgeometrycheckerror.h.
|
protected |
Definition at line 219 of file qgsgeometrycheckerror.h.
|
protected |
Definition at line 220 of file qgsgeometrycheckerror.h.
|
protected |
Definition at line 218 of file qgsgeometrycheckerror.h.