Skip to content
Permalink
Browse files

[Geometry checker] Add a first series of fixError tests

  • Loading branch information
manisandro committed Oct 16, 2017
1 parent 8f343a9 commit 4a6cdbe36b226f9f4e0c935a52b44149c3dad90d
@@ -32,8 +32,10 @@ class ANALYSIS_EXPORT QgsGeometryAngleCheck : public QgsGeometryCheck
QStringList getResolutionMethods() const override;
QString errorDescription() const override { return tr( "Minimal angle" ); }
QString errorName() const override { return QStringLiteral( "QgsGeometryAngleCheck" ); }
private:

enum ResolutionMethod { DeleteNode, NoChange };

private:
double mMinAngle;
};

@@ -34,9 +34,10 @@ class ANALYSIS_EXPORT QgsGeometryAreaCheck : public QgsGeometryCheck
QStringList getResolutionMethods() const override;
QString errorDescription() const override { return tr( "Minimal area" ); }
QString errorName() const override { return QStringLiteral( "QgsGeometryAreaCheck" ); }
private:
enum ResolutionMethod { MergeLongestEdge, MergeLargestArea, MergeIdenticalAttribute, Delete, NoChange };

private:

virtual bool checkThreshold( double layerToMapUnits, const QgsAbstractGeometry *geom, double &value ) const;
bool mergeWithNeighbor( const QString &layerId, QgsFeature &feature, int partIdx, int method, int mergeAttributeIndex, Changes &changes, QString &errMsg ) const;

@@ -60,6 +60,10 @@ class ANALYSIS_EXPORT QgsGeometryCheck : public QObject
ChangeWhat what;
ChangeType type;
QgsVertexId vidx;
bool operator==( const Change &other )
{
return what == other.what && type == other.type && vidx == other.vidx;
}
};

typedef QMap<QString, QMap<QgsFeatureId, QList<Change>>> Changes;
@@ -56,7 +56,7 @@ class ANALYSIS_EXPORT QgsGeometryContainedCheck : public QgsGeometryCheck
QStringList getResolutionMethods() const override;
QString errorDescription() const override { return tr( "Within" ); }
QString errorName() const override { return QStringLiteral( "QgsGeometryContainedCheck" ); }
private:

enum ResolutionMethod { Delete, NoChange };
};

@@ -31,7 +31,7 @@ class ANALYSIS_EXPORT QgsGeometryDangleCheck : public QgsGeometryCheck
QStringList getResolutionMethods() const override;
QString errorDescription() const override { return tr( "Dangle" ); }
QString errorName() const override { return QStringLiteral( "QgsGeometryDangleCheck" ); }
private:

enum ResolutionMethod { NoChange };
};

@@ -31,8 +31,8 @@ class ANALYSIS_EXPORT QgsGeometryDegeneratePolygonCheck : public QgsGeometryChec
QString errorDescription() const override { return tr( "Polygon with less than three nodes" ); }
QString errorName() const override { return QStringLiteral( "QgsGeometryDegeneratePolygonCheck" ); }

private:
enum ResolutionMethod { DeleteRing, NoChange };
private:
};

#endif // QGS_GEOMETRY_DEGENERATEPOLYGON_CHECK_H
@@ -58,7 +58,6 @@ class ANALYSIS_EXPORT QgsGeometryDuplicateCheck : public QgsGeometryCheck
QString errorDescription() const override { return tr( "Duplicate" ); }
QString errorName() const override { return QStringLiteral( "QgsGeometryDuplicateCheck" ); }

private:
enum ResolutionMethod { NoChange, RemoveDuplicates };
};

@@ -31,7 +31,6 @@ class ANALYSIS_EXPORT QgsGeometryDuplicateNodesCheck : public QgsGeometryCheck
QString errorDescription() const override { return tr( "Duplicate node" ); }
QString errorName() const override { return QStringLiteral( "QgsGeometryDuplicateNodesCheck" ); }

private:
enum ResolutionMethod { RemoveDuplicates, NoChange };
};

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 4a6cdbe

Please sign in to comment.
You can’t perform that action at this time.