23 QList<QgsSingleGeometryCheckError *> errors;
25 for (
int iPart = 0, nParts = geom->
partCount(); iPart < nParts; ++iPart )
27 for (
int iRing = 0, nRings = geom->
ringCount( iPart ); iRing < nRings; ++iRing )
35 QVector<QgsPoint> ring;
38 for (
int i = 1; i < n; ++i )
52 if ( !ring.empty() && isClosed )
54 vtxMap.append( n - 1 );
55 ring.append( ring.front() );
60 for (
int iVert = 0, nVerts = n - isClosed; iVert < nVerts; ++iVert )
63 for (
int i = 0, j = 1; j < n; i = j++ )
65 if ( iVert == i || iVert == j || ( isClosed && iVert == 0 && j == n - 1 ) )
86 Q_UNUSED( featurePools )
99 static QStringList methods = QStringList() << tr(
"No action" );
CheckType
The type of a check.
A geometry is the spatial representation of a feature.
void setFixFailed(const QString &reason)
Set the error status to failed and specify the reason for failure.
Utility class for identifying a unique vertex within a geometry.
QgsPoint * clone() const override
Clones the geometry by performing a deep copy.
virtual int ringCount(int part=0) const =0
Returns the number of rings of which this geometry is built.
Abstract base class for all geometries.
const QgsGeometryCheckContext * mContext
Point geometry type, with support for z-dimension and m-values.
An error from a QgsSingleGeometryCheck.
const QgsAbstractGeometry * constGet() const
Returns a non-modifiable (const) reference to the underlying abstract geometry primitive.
static double sqrDistance2D(const QgsPoint &pt1, const QgsPoint &pt2)
Returns the squared 2D distance between two points.
QMap< QString, QMap< QgsFeatureId, QList< QgsGeometryCheck::Change > > > Changes
A collection of changes.
const double tolerance
The tolerance to allow for in geometry checks.
void setFixed(int method)
Set the status to fixed and specify the method that has been used to fix the error.
virtual int vertexCount(int part=0, int ring=0) const =0
Returns the number of vertices of which this geometry is built.
static QgsPoint projectPointOnSegment(const QgsPoint &p, const QgsPoint &s1, const QgsPoint &s2)
Project the point on a segment.
This represents an error reported by a geometry check.
virtual QgsPoint vertexAt(QgsVertexId id) const =0
Returns the point corresponding to a specified vertex id.
virtual int partCount() const =0
Returns count of parts contained in the geometry.
The check controls individual nodes.