QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
30 QList<QgsSingleGeometryCheckError *> errors;
33 if ( ( mAllowedTypes & ( 1 << type ) ) == 0 )
54 if ( ( mAllowedTypes & ( 1 << type ) ) != 0 )
61 if ( method == NoChange )
65 else if ( method == Convert )
71 for (
int iPart = 1, nParts = geom->
partCount(); iPart < nParts; ++iPart )
118 if ( !geomCollection )
139 else if ( method == Delete )
153 static const QStringList methods = QStringList()
154 << tr(
"Convert to corresponding multi or single type if possible, otherwise delete feature" )
155 << tr(
"Delete feature" )
156 << tr(
"No action" );
162 return tr(
"Geometry type" );
172 return QStringLiteral(
"QgsGeometryTypeCheck" );
void setFixFailed(const QString &reason)
Set the error status to failed and specify the reason for failure.
static bool isSingleType(Type type) SIP_HOLDGIL
Returns true if the WKB type is a single type.
Descripts a change to fix a geometry.
static QgsAbstractGeometry * getGeomPart(QgsAbstractGeometry *geom, int partIdx)
static QString displayString(Type type) SIP_HOLDGIL
Returns a non-translated display string type for a WKB type, e.g., the geometry name used in WKT geom...
static QgsGeometryCheck::CheckType factoryCheckType()
@ ChangeAdded
Something has been added.
@ ChangeFeature
This change happens on feature level.
QgsGeometryCheck::CheckType checkType() const override
Returns the check type.
void fixError(const QMap< QString, QgsFeaturePool * > &featurePools, QgsGeometryCheckError *error, int method, const QMap< QString, int > &mergeAttributeIndices, Changes &changes) const override
Fixes the error error with the specified method.
static QString factoryId()
void setObsolete()
Set the error status to obsolete.
QgsFeatureId featureId() const
The id of the feature on which this error has been detected.
static Type flatType(Type type) SIP_HOLDGIL
Returns the flat type for a WKB type.
QMap< QString, QMap< QgsFeatureId, QList< QgsGeometryCheck::Change > > > Changes
A collection of changes.
virtual bool addFeature(QgsFeature &feature, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags())
Adds a single feature to the sink.
virtual QString description() const =0
Returns a human readable description for this check.
const QgsSingleGeometryCheck * mCheck
Multi line string geometry collection.
QList< QgsSingleGeometryCheckError * > processGeometry(const QgsGeometry &geometry) const override
Check the geometry for errors.
@ ChangeChanged
Something has been updated.
Type
The WKB type describes the number of dimensions a geometry has.
QString description() const override
Returns a human readable description for this check.
Multi surface geometry collection.
virtual int partCount() const =0
Returns count of parts contained in the geometry.
static Type multiType(Type type) SIP_HOLDGIL
Returns the multi type for a WKB type.
An error from a QgsSingleGeometryCheck.
bool getFeature(QgsFeatureId id, QgsFeature &feature)
Retrieves the feature with the specified id into feature.
@ ChangeRemoved
Something has been removed.
QgsWkbTypes::Type wkbType() const SIP_HOLDGIL
Returns the WKB type of the geometry.
virtual void deleteFeature(QgsFeatureId fid)=0
Removes a feature from this pool.
void setGeometry(const QgsGeometry &geometry)
Set the feature's geometry.
Multi curve geometry collection.
virtual void updateFeature(QgsFeature &feature)=0
Updates a feature in this pool.
void setFixed(int method)
Set the status to fixed and specify the method that has been used to fix the error.
virtual bool addGeometry(QgsAbstractGeometry *g)
Adds a geometry and takes ownership. Returns true in case of success.
virtual QgsAbstractGeometry * clone() const =0
Clones the geometry by performing a deep copy.
static QString factoryDescription()
Multi polygon geometry collection.
bool isEqual(const QgsSingleGeometryCheckError *other) const override
Check if this error is equal to other.
const QgsAbstractGeometry * constGet() const SIP_HOLDGIL
Returns a non-modifiable (const) reference to the underlying abstract geometry primitive.
Multi point geometry collection.
Abstract base class for all geometries.
virtual bool isEqual(const QgsSingleGeometryCheckError *other) const
Check if this error is equal to other.
A geometry is the spatial representation of a feature.
A geometry type check error.
CheckType
The type of a check.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
QString id() const override
Returns an id for this check.
const QString & layerId() const
The id of the layer on which this error has been detected.
void setAttributes(const QgsAttributes &attrs)
Sets the feature's attributes.
@ FeatureCheck
The check controls geometries as a whole.
static bool isMultiType(Type type) SIP_HOLDGIL
Returns true if the WKB type is a multi type.
static Type singleType(Type type) SIP_HOLDGIL
Returns the single type for a WKB type.
This represents an error reported by a geometry check.
Q_DECL_DEPRECATED QStringList resolutionMethods() const override
Returns a list of descriptions for available resolutions for errors.
A feature pool is based on a vector layer and caches features.
QString description() const override
A human readable description of this error.