QGIS API Documentation
3.20.0-Odense (decaadbb31)
|
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. More... | |
virtual | ~QgsGeometryCheckError ()=default |
virtual QgsRectangle | affectedAreaBBox () const |
The bounding box of the affected area of the error. More... | |
const QgsGeometryCheck * | check () const |
The geometry check that created this error. More... | |
virtual bool | closeMatch (QgsGeometryCheckError *) const |
Check if this error is almost equal to other. More... | |
virtual QgsRectangle | contextBoundingBox () const |
The context of the error. More... | |
virtual QString | description () const |
The error description. More... | |
QgsFeatureId | featureId () const |
The id of the feature on which this error has been detected. More... | |
QgsGeometry | geometry () const |
The geometry of the error in map units. More... | |
virtual bool | handleChanges (const QgsGeometryCheck::Changes &changes) |
Apply a list of changes. More... | |
virtual QIcon | icon () const |
Returns an icon that should be shown for this kind of error. More... | |
virtual QMap< QString, QgsFeatureIds > | involvedFeatures () const |
Returns a list of involved features. More... | |
virtual bool | isEqual (QgsGeometryCheckError *other) const |
Check if this error is equal to other. More... | |
const QString & | layerId () const |
The id of the layer on which this error has been detected. More... | |
const QgsPointXY & | location () const |
The location of the error in map units. More... | |
const QgsGeometryCheckError & | operator= (const QgsGeometryCheckError &)=delete |
QString | resolutionMessage () const |
A message with details, how the error has been resolved. More... | |
void | setFixed (int method) |
Set the status to fixed and specify the method that has been used to fix the error. More... | |
void | setFixFailed (const QString &reason) |
Set the error status to failed and specify the reason for failure. More... | |
void | setObsolete () |
Set the error status to obsolete. More... | |
Status | status () const |
The status of the error. More... | |
virtual void | update (const QgsGeometryCheckError *other) |
Update this error with the information from other. More... | |
QVariant | value () const |
An additional value for the error. More... | |
ValueType | valueType () const |
The type of the value. More... | |
const QgsVertexId & | vidx () const |
The id of the affected vertex. More... | |
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. More... | |
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 42 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 53 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 40 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 QgsGeometryMissingVertexCheckError, and QgsGeometryGapCheckError.
Definition at line 93 of file qgsgeometrycheckerror.cpp.
|
inline |
The geometry check that created this error.
Definition at line 80 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 QgsGeometryOverlapCheckError, and QgsGeometryGapCheckError.
Definition at line 123 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 88 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 116 of file qgsgeometrycheckerror.h.
|
inline |
The id of the feature on which this error has been detected.
Definition at line 90 of file qgsgeometrycheckerror.h.
QgsGeometry QgsGeometryCheckError::geometry | ( | ) | const |
The geometry of the error in map units.
Definition at line 83 of file qgsgeometrycheckerror.cpp.
|
virtual |
Apply a list of changes.
Reimplemented in QgsGeometryCheckErrorSingle, QgsGeometryOverlapCheckError, and QgsGeometryGapCheckError.
Definition at line 128 of file qgsgeometrycheckerror.cpp.
|
virtual |
Returns an icon that should be shown for this kind of error.
Reimplemented in QgsGeometryOverlapCheckError, QgsGeometryMissingVertexCheckError, and QgsGeometryGapCheckError.
Definition at line 199 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 QgsGeometryOverlapCheckError, QgsGeometryMissingVertexCheckError, and QgsGeometryGapCheckError.
Definition at line 194 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 QgsGeometryOverlapCheckError, QgsGeometryGapCheckError, QgsGeometryDuplicateCheckError, and QgsGeometryContainedCheckError.
Definition at line 115 of file qgsgeometrycheckerror.cpp.
|
inline |
The id of the layer on which this error has been detected.
Definition at line 85 of file qgsgeometrycheckerror.h.
|
inline |
The location of the error in map units.
Definition at line 121 of file qgsgeometrycheckerror.h.
|
delete |
|
inline |
A message with details, how the error has been resolved.
Definition at line 150 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 98 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 109 of file qgsgeometrycheckerror.cpp.
|
inline |
Set the error status to obsolete.
Definition at line 166 of file qgsgeometrycheckerror.h.
|
inline |
The status of the error.
Definition at line 145 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 207 of file qgsgeometrycheckerror.cpp.
|
inline |
An additional value for the error.
Lengths and areas are provided in map units.
Definition at line 128 of file qgsgeometrycheckerror.h.
|
inline |
|
inline |
The id of the affected vertex.
May be valid or not, depending on the check.
Definition at line 140 of file qgsgeometrycheckerror.h.
|
protected |
Definition at line 226 of file qgsgeometrycheckerror.h.
|
protected |
Definition at line 230 of file qgsgeometrycheckerror.h.
|
protected |
Definition at line 228 of file qgsgeometrycheckerror.h.
|
protected |
Definition at line 229 of file qgsgeometrycheckerror.h.
|
protected |
Definition at line 227 of file qgsgeometrycheckerror.h.
|
protected |
Definition at line 235 of file qgsgeometrycheckerror.h.
|
protected |
Definition at line 234 of file qgsgeometrycheckerror.h.
|
protected |
Definition at line 232 of file qgsgeometrycheckerror.h.
|
protected |
Definition at line 233 of file qgsgeometrycheckerror.h.
|
protected |
Definition at line 231 of file qgsgeometrycheckerror.h.