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 const QStringList methods = QStringList() << tr(
"No action" );
Abstract base class for all geometries.
virtual int ringCount(int part=0) const =0
Returns the number of rings of which this geometry is built.
virtual int vertexCount(int part=0, int ring=0) const =0
Returns the number of vertices of which this geometry is built.
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.
const double tolerance
The tolerance to allow for in geometry checks.
This represents an error reported by a geometry check.
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.
QMap< QString, QMap< QgsFeatureId, QList< QgsGeometryCheck::Change > > > Changes
A collection of changes.
const QgsGeometryCheckContext * mContext
CheckType
The type of a check.
@ FeatureNodeCheck
The check controls individual nodes.
static double sqrDistance2D(const QgsPoint &pt1, const QgsPoint &pt2)
Returns the squared 2D distance between two points.
static QgsPoint projectPointOnSegment(const QgsPoint &p, const QgsPoint &s1, const QgsPoint &s2)
Project the point on a segment.
A geometry is the spatial representation of a feature.
const QgsAbstractGeometry * constGet() const
Returns a non-modifiable (const) reference to the underlying abstract geometry primitive.
Point geometry type, with support for z-dimension and m-values.
QgsPoint * clone() const override
Clones the geometry by performing a deep copy.
An error from a QgsSingleGeometryCheck.
Utility class for identifying a unique vertex within a geometry.