Skip to content
Permalink
Browse files

Merge pull request #7647 from m-kuhn/geomCheckerCodingConventions

Geometry checker code adjustments
  • Loading branch information
m-kuhn committed Aug 21, 2018
2 parents bc6ea8c + 50acde0 commit b6251d235f0e8868efa1fe3a0c42699f84bd3fe7
Showing with 123 additions and 142 deletions.
  1. +24 −23 src/analysis/CMakeLists.txt
  2. +1 −1 src/analysis/vector/geometry_checker/qgsgeometryanglecheck.cpp
  3. +1 −3 src/analysis/vector/geometry_checker/qgsgeometryanglecheck.h
  4. +1 −1 src/analysis/vector/geometry_checker/qgsgeometryareacheck.cpp
  5. +1 −3 src/analysis/vector/geometry_checker/qgsgeometryareacheck.h
  6. +1 −1 src/analysis/vector/geometry_checker/qgsgeometrycheck.cpp
  7. +29 −10 src/analysis/vector/geometry_checker/qgsgeometrycheck.h
  8. +6 −6 src/analysis/vector/geometry_checker/qgsgeometrychecker.cpp
  9. +1 −1 src/analysis/vector/geometry_checker/qgsgeometrycheckerutils.cpp
  10. +6 −6 src/analysis/vector/geometry_checker/qgsgeometrycheckerutils.h
  11. +1 −1 src/analysis/vector/geometry_checker/qgsgeometrycontainedcheck.cpp
  12. +1 −3 src/analysis/vector/geometry_checker/qgsgeometrycontainedcheck.h
  13. +1 −1 src/analysis/vector/geometry_checker/qgsgeometrydanglecheck.cpp
  14. +1 −3 src/analysis/vector/geometry_checker/qgsgeometrydanglecheck.h
  15. +1 −1 src/analysis/vector/geometry_checker/qgsgeometrydegeneratepolygoncheck.cpp
  16. +1 −3 src/analysis/vector/geometry_checker/qgsgeometrydegeneratepolygoncheck.h
  17. +1 −1 src/analysis/vector/geometry_checker/qgsgeometryduplicatecheck.cpp
  18. +2 −4 src/analysis/vector/geometry_checker/qgsgeometryduplicatecheck.h
  19. +1 −1 src/analysis/vector/geometry_checker/qgsgeometryduplicatenodescheck.cpp
  20. +1 −3 src/analysis/vector/geometry_checker/qgsgeometryduplicatenodescheck.h
  21. +1 −1 src/analysis/vector/geometry_checker/qgsgeometryfollowboundariescheck.cpp
  22. +1 −3 src/analysis/vector/geometry_checker/qgsgeometryfollowboundariescheck.h
  23. +9 −6 src/analysis/vector/geometry_checker/qgsgeometrygapcheck.cpp
  24. +2 −4 src/analysis/vector/geometry_checker/qgsgeometrygapcheck.h
  25. +1 −1 src/analysis/vector/geometry_checker/qgsgeometryholecheck.cpp
  26. +1 −3 src/analysis/vector/geometry_checker/qgsgeometryholecheck.h
  27. +1 −1 src/analysis/vector/geometry_checker/qgsgeometrylineintersectioncheck.cpp
  28. +1 −3 src/analysis/vector/geometry_checker/qgsgeometrylineintersectioncheck.h
  29. +1 −1 src/analysis/vector/geometry_checker/qgsgeometrylinelayerintersectioncheck.cpp
  30. +1 −3 src/analysis/vector/geometry_checker/qgsgeometrylinelayerintersectioncheck.h
  31. +1 −1 src/analysis/vector/geometry_checker/qgsgeometrymultipartcheck.cpp
  32. +1 −3 src/analysis/vector/geometry_checker/qgsgeometrymultipartcheck.h
  33. +3 −3 src/analysis/vector/geometry_checker/qgsgeometryoverlapcheck.cpp
  34. +3 −5 src/analysis/vector/geometry_checker/qgsgeometryoverlapcheck.h
  35. +1 −1 src/analysis/vector/geometry_checker/qgsgeometrypointcoveredbylinecheck.cpp
  36. +1 −3 src/analysis/vector/geometry_checker/qgsgeometrypointcoveredbylinecheck.h
  37. +1 −1 src/analysis/vector/geometry_checker/qgsgeometrypointinpolygoncheck.cpp
  38. +1 −3 src/analysis/vector/geometry_checker/qgsgeometrypointinpolygoncheck.h
  39. +1 −1 src/analysis/vector/geometry_checker/qgsgeometrysegmentlengthcheck.cpp
  40. +1 −3 src/analysis/vector/geometry_checker/qgsgeometrysegmentlengthcheck.h
  41. +1 −1 src/analysis/vector/geometry_checker/qgsgeometryselfcontactcheck.cpp
  42. +1 −3 src/analysis/vector/geometry_checker/qgsgeometryselfcontactcheck.h
  43. +1 −1 src/analysis/vector/geometry_checker/qgsgeometryselfintersectioncheck.cpp
  44. +1 −3 src/analysis/vector/geometry_checker/qgsgeometryselfintersectioncheck.h
  45. +0 −2 src/analysis/vector/geometry_checker/qgsgeometrysliverpolygoncheck.h
  46. +1 −1 src/analysis/vector/geometry_checker/qgsgeometrytypecheck.cpp
  47. +1 −3 src/analysis/vector/geometry_checker/qgsgeometrytypecheck.h
  48. +1 −1 src/plugins/geometry_checker/qgsgeometrycheckerresulttab.cpp
  49. +1 −1 src/plugins/geometry_checker/qgsgeometrycheckfixdialog.cpp
@@ -170,29 +170,6 @@ SET(QGIS_ANALYSIS_MOC_HDRS
processing/qgsalgorithmfiledownloader.h

vector/geometry_checker/qgsgeometrychecker.h
vector/geometry_checker/qgsgeometryanglecheck.h
vector/geometry_checker/qgsgeometryareacheck.h
vector/geometry_checker/qgsgeometrychecker.h
vector/geometry_checker/qgsgeometrycheck.h
vector/geometry_checker/qgsgeometrycontainedcheck.h
vector/geometry_checker/qgsgeometrydanglecheck.h
vector/geometry_checker/qgsgeometrydegeneratepolygoncheck.h
vector/geometry_checker/qgsgeometryduplicatecheck.h
vector/geometry_checker/qgsgeometryduplicatenodescheck.h
vector/geometry_checker/qgsgeometryfollowboundariescheck.h
vector/geometry_checker/qgsgeometrygapcheck.h
vector/geometry_checker/qgsgeometryholecheck.h
vector/geometry_checker/qgsgeometrylineintersectioncheck.h
vector/geometry_checker/qgsgeometrylinelayerintersectioncheck.h
vector/geometry_checker/qgsgeometrymultipartcheck.h
vector/geometry_checker/qgsgeometryoverlapcheck.h
vector/geometry_checker/qgsgeometrypointcoveredbylinecheck.h
vector/geometry_checker/qgsgeometrypointinpolygoncheck.h
vector/geometry_checker/qgsgeometrysegmentlengthcheck.h
vector/geometry_checker/qgsgeometryselfcontactcheck.h
vector/geometry_checker/qgsgeometryselfintersectioncheck.h
vector/geometry_checker/qgsgeometrysliverpolygoncheck.h
vector/geometry_checker/qgsgeometrytypecheck.h
)

INCLUDE_DIRECTORIES(SYSTEM ${SPATIALITE_INCLUDE_DIR})
@@ -281,6 +258,30 @@ SET(QGIS_ANALYSIS_HDRS
network/qgsnetworkdistancestrategy.h
network/qgsgraphanalyzer.h
network/qgsvectorlayerdirector.h

vector/geometry_checker/qgsgeometryanglecheck.h
vector/geometry_checker/qgsgeometryareacheck.h
vector/geometry_checker/qgsgeometrychecker.h
vector/geometry_checker/qgsgeometrycheck.h
vector/geometry_checker/qgsgeometrycontainedcheck.h
vector/geometry_checker/qgsgeometrydanglecheck.h
vector/geometry_checker/qgsgeometrydegeneratepolygoncheck.h
vector/geometry_checker/qgsgeometryduplicatecheck.h
vector/geometry_checker/qgsgeometryduplicatenodescheck.h
vector/geometry_checker/qgsgeometryfollowboundariescheck.h
vector/geometry_checker/qgsgeometrygapcheck.h
vector/geometry_checker/qgsgeometryholecheck.h
vector/geometry_checker/qgsgeometrylineintersectioncheck.h
vector/geometry_checker/qgsgeometrylinelayerintersectioncheck.h
vector/geometry_checker/qgsgeometrymultipartcheck.h
vector/geometry_checker/qgsgeometryoverlapcheck.h
vector/geometry_checker/qgsgeometrypointcoveredbylinecheck.h
vector/geometry_checker/qgsgeometrypointinpolygoncheck.h
vector/geometry_checker/qgsgeometrysegmentlengthcheck.h
vector/geometry_checker/qgsgeometryselfcontactcheck.h
vector/geometry_checker/qgsgeometryselfintersectioncheck.h
vector/geometry_checker/qgsgeometrysliverpolygoncheck.h
vector/geometry_checker/qgsgeometrytypecheck.h
)

INCLUDE_DIRECTORIES(
@@ -147,7 +147,7 @@ void QgsGeometryAngleCheck::fixError( QgsGeometryCheckError *error, int method,
}
}

QStringList QgsGeometryAngleCheck::getResolutionMethods() const
QStringList QgsGeometryAngleCheck::resolutionMethods() const
{
static QStringList methods = QStringList() << tr( "Delete node with small angle" ) << tr( "No action" );
return methods;
@@ -22,16 +22,14 @@

class ANALYSIS_EXPORT QgsGeometryAngleCheck : public QgsGeometryCheck
{
Q_OBJECT

public:
QgsGeometryAngleCheck( QgsGeometryCheckerContext *context, double minAngle )
: QgsGeometryCheck( FeatureNodeCheck, {QgsWkbTypes::LineGeometry, QgsWkbTypes::PolygonGeometry}, context )
, mMinAngle( minAngle )
{}
void collectErrors( QList<QgsGeometryCheckError *> &errors, QStringList &messages, QAtomicInt *progressCounter = nullptr, const QMap<QString, QgsFeatureIds> &ids = QMap<QString, QgsFeatureIds>() ) const override;
void fixError( QgsGeometryCheckError *error, int method, const QMap<QString, int> &mergeAttributeIndices, Changes &changes ) const override;
QStringList getResolutionMethods() const override;
QStringList resolutionMethods() const override;
QString errorDescription() const override { return tr( "Minimal angle" ); }
QString errorName() const override { return QStringLiteral( "QgsGeometryAngleCheck" ); }

@@ -199,7 +199,7 @@ bool QgsGeometryAreaCheck::mergeWithNeighbor( const QString &layerId, QgsFeature
return true;
}

QStringList QgsGeometryAreaCheck::getResolutionMethods() const
QStringList QgsGeometryAreaCheck::resolutionMethods() const
{
static QStringList methods = QStringList()
<< tr( "Merge with neighboring polygon with longest shared edge" )
@@ -24,16 +24,14 @@ class QgsSurface;

class ANALYSIS_EXPORT QgsGeometryAreaCheck : public QgsGeometryCheck
{
Q_OBJECT

public:
QgsGeometryAreaCheck( QgsGeometryCheckerContext *context, double thresholdMapUnits )
: QgsGeometryCheck( FeatureCheck, {QgsWkbTypes::PolygonGeometry}, context )
, mThresholdMapUnits( thresholdMapUnits )
{}
void collectErrors( QList<QgsGeometryCheckError *> &errors, QStringList &messages, QAtomicInt *progressCounter = nullptr, const QMap<QString, QgsFeatureIds> &ids = QMap<QString, QgsFeatureIds>() ) const override;
void fixError( QgsGeometryCheckError *error, int method, const QMap<QString, int> &mergeAttributeIndices, Changes &changes ) const override;
QStringList getResolutionMethods() const override;
QStringList resolutionMethods() const override;
QString errorDescription() const override { return tr( "Minimal area" ); }
QString errorName() const override { return QStringLiteral( "QgsGeometryAreaCheck" ); }
enum ResolutionMethod { MergeLongestEdge, MergeLargestArea, MergeIdenticalAttribute, Delete, NoChange };
@@ -97,7 +97,7 @@ bool QgsGeometryCheckError::handleChanges( const QgsGeometryCheck::Changes &chan
// If the check is checking the feature at geometry nodes level, the
// error almost certainly invalid after a geometry change. In the other
// cases, it might likely still be valid.
return mCheck->getCheckType() != QgsGeometryCheck::FeatureNodeCheck;
return mCheck->checkType() != QgsGeometryCheck::FeatureNodeCheck;
}
}
else if ( change.what == QgsGeometryCheck::ChangePart )
@@ -41,14 +41,32 @@ struct ANALYSIS_EXPORT QgsGeometryCheckerContext
const QMap<QString, QgsFeaturePool *> featurePools;
};

class ANALYSIS_EXPORT QgsGeometryCheck : public QObject
class ANALYSIS_EXPORT QgsGeometryCheck
{
Q_OBJECT
Q_DECLARE_TR_FUNCTIONS()

public:
enum ChangeWhat { ChangeFeature, ChangePart, ChangeRing, ChangeNode };
enum ChangeType { ChangeAdded, ChangeRemoved, ChangeChanged };
enum CheckType { FeatureNodeCheck, FeatureCheck, LayerCheck };
enum ChangeWhat
{
ChangeFeature,
ChangePart,
ChangeRing,
ChangeNode
};

enum ChangeType
{
ChangeAdded,
ChangeRemoved,
ChangeChanged
};

enum CheckType
{
FeatureNodeCheck,
FeatureCheck,
LayerCheck
};

struct Change
{
@@ -74,14 +92,15 @@ class ANALYSIS_EXPORT QgsGeometryCheck : public QObject
, mCompatibleGeometryTypes( compatibleGeometryTypes )
, mContext( context )
{}
virtual ~QgsGeometryCheck() = default;
virtual void collectErrors( QList<QgsGeometryCheckError *> &errors, QStringList &messages, QAtomicInt *progressCounter = nullptr, const QMap<QString, QgsFeatureIds> &ids = QMap<QString, QgsFeatureIds>() ) const = 0;
virtual void fixError( QgsGeometryCheckError *error, int method, const QMap<QString, int> &mergeAttributeIndices, Changes &changes ) const = 0;
virtual QStringList getResolutionMethods() const = 0;
virtual QStringList resolutionMethods() const = 0;
virtual QString errorDescription() const = 0;
virtual QString errorName() const = 0;
CheckType getCheckType() const { return mCheckType; }
bool getCompatibility( QgsWkbTypes::GeometryType type ) const { return mCompatibleGeometryTypes.contains( type ); }
QgsGeometryCheckerContext *getContext() const { return mContext; }
CheckType checkType() const { return mCheckType; }
bool isCompatible( QgsWkbTypes::GeometryType type ) const { return mCompatibleGeometryTypes.contains( type ); }
QgsGeometryCheckerContext *context() const { return mContext; }

protected:
QMap<QString, QgsFeatureIds> allLayerFeatureIds() const;
@@ -133,7 +152,7 @@ class ANALYSIS_EXPORT QgsGeometryCheckError
void setFixed( int method )
{
mStatus = StatusFixed;
const QStringList methods = mCheck->getResolutionMethods();
const QStringList methods = mCheck->resolutionMethods();
mResolutionMessage = methods[method];
}
void setFixFailed( const QString &reason )
@@ -65,9 +65,9 @@ QFuture<void> QgsGeometryChecker::execute( int *totalSteps )
{
for ( auto it = mContext->featurePools.constBegin(); it != mContext->featurePools.constEnd(); ++it )
{
if ( check->getCheckType() <= QgsGeometryCheck::FeatureCheck )
if ( check->checkType() <= QgsGeometryCheck::FeatureCheck )
{
*totalSteps += check->getCompatibility( it.value()->getLayer()->geometryType() ) ? it.value()->getFeatureIds().size() : 0;
*totalSteps += check->isCompatible( it.value()->getLayer()->geometryType() ) ? it.value()->getFeatureIds().size() : 0;
}
else
{
@@ -170,7 +170,7 @@ bool QgsGeometryChecker::fixError( QgsGeometryCheckError *error, int method, boo
// - Determine extent to recheck for gaps
for ( QgsGeometryCheckError *err : qgis::as_const( mCheckErrors ) )
{
if ( err->check()->getCheckType() == QgsGeometryCheck::LayerCheck )
if ( err->check()->checkType() == QgsGeometryCheck::LayerCheck )
{
if ( err->affectedAreaBBox().intersects( recheckArea ) )
{
@@ -191,7 +191,7 @@ bool QgsGeometryChecker::fixError( QgsGeometryCheckError *error, int method, boo
QList<QgsGeometryCheckError *> recheckErrors;
for ( const QgsGeometryCheck *check : qgis::as_const( mChecks ) )
{
if ( check->getCheckType() == QgsGeometryCheck::LayerCheck )
if ( check->checkType() == QgsGeometryCheck::LayerCheck )
{
if ( !recheckAreaFeatures.isEmpty() )
{
@@ -246,9 +246,9 @@ bool QgsGeometryChecker::fixError( QgsGeometryCheckError *error, int method, boo
// changes weren't handled
!handled ||
// or if it is a FeatureNodeCheck or FeatureCheck error whose feature was rechecked
( err->check()->getCheckType() <= QgsGeometryCheck::FeatureCheck && recheckFeatures[err->layerId()].contains( err->featureId() ) ) ||
( err->check()->checkType() <= QgsGeometryCheck::FeatureCheck && recheckFeatures[err->layerId()].contains( err->featureId() ) ) ||
// or if it is a LayerCheck error within the rechecked area
( err->check()->getCheckType() == QgsGeometryCheck::LayerCheck && recheckArea.contains( err->affectedAreaBBox() ) )
( err->check()->checkType() == QgsGeometryCheck::LayerCheck && recheckArea.contains( err->affectedAreaBBox() ) )
)
)
{
@@ -47,7 +47,7 @@ namespace QgsGeometryCheckerUtils

/////////////////////////////////////////////////////////////////////////////

LayerFeatures::iterator::iterator( const QList<QString>::iterator &layerIt, LayerFeatures *parent )
LayerFeatures::iterator::iterator( const QStringList::const_iterator &layerIt, const LayerFeatures *parent )
: mLayerIt( layerIt )
, mFeatureIt( QgsFeatureIds::const_iterator() )
, mParent( parent )
@@ -66,7 +66,7 @@ namespace QgsGeometryCheckerUtils
class iterator
{
public:
iterator( const QList<QString>::iterator &layerIt, LayerFeatures *parent );
iterator( const QList<QString>::const_iterator &layerIt, const LayerFeatures *parent );
~iterator();
const iterator &operator++();
iterator operator++( int ) { iterator tmp( *this ); ++*this; return tmp; }
@@ -77,14 +77,14 @@ namespace QgsGeometryCheckerUtils
bool nextLayerFeature( bool begin );
bool nextLayer( bool begin );
bool nextFeature( bool begin );
QList<QString>::iterator mLayerIt;
QList<QString>::const_iterator mLayerIt;
QgsFeatureIds::const_iterator mFeatureIt;
LayerFeatures *mParent;
LayerFeature *mCurrentFeature = nullptr;
const LayerFeatures *mParent;
const LayerFeature *mCurrentFeature = nullptr;
};

iterator begin() { return iterator( mLayerIds.begin(), this ); }
iterator end() { return iterator( mLayerIds.end(), this ); }
iterator begin() const { return iterator( mLayerIds.constBegin(), this ); }
iterator end() const { return iterator( mLayerIds.end(), this ); }
private:
QMap<QString, QgsFeaturePool *> mFeaturePools;
QMap<QString, QgsFeatureIds> mFeatureIds;
@@ -103,7 +103,7 @@ void QgsGeometryContainedCheck::fixError( QgsGeometryCheckError *error, int meth
}
}

QStringList QgsGeometryContainedCheck::getResolutionMethods() const
QStringList QgsGeometryContainedCheck::resolutionMethods() const
{
static QStringList methods = QStringList()
<< tr( "Delete feature" )
@@ -48,14 +48,12 @@ class ANALYSIS_EXPORT QgsGeometryContainedCheckError : public QgsGeometryCheckEr

class ANALYSIS_EXPORT QgsGeometryContainedCheck : public QgsGeometryCheck
{
Q_OBJECT

public:
explicit QgsGeometryContainedCheck( QgsGeometryCheckerContext *context )
: QgsGeometryCheck( FeatureCheck, {QgsWkbTypes::PointGeometry, QgsWkbTypes::LineGeometry, QgsWkbTypes::PolygonGeometry}, context ) {}
void collectErrors( QList<QgsGeometryCheckError *> &errors, QStringList &messages, QAtomicInt *progressCounter = nullptr, const QMap<QString, QgsFeatureIds> &ids = QMap<QString, QgsFeatureIds>() ) const override;
void fixError( QgsGeometryCheckError *error, int method, const QMap<QString, int> &mergeAttributeIndices, Changes &changes ) const override;
QStringList getResolutionMethods() const override;
QStringList resolutionMethods() const override;
QString errorDescription() const override { return tr( "Within" ); }
QString errorName() const override { return QStringLiteral( "QgsGeometryContainedCheck" ); }

@@ -102,7 +102,7 @@ void QgsGeometryDangleCheck::fixError( QgsGeometryCheckError *error, int method,
}
}

QStringList QgsGeometryDangleCheck::getResolutionMethods() const
QStringList QgsGeometryDangleCheck::resolutionMethods() const
{
static QStringList methods = QStringList() << tr( "No action" );
return methods;
@@ -22,15 +22,13 @@

class ANALYSIS_EXPORT QgsGeometryDangleCheck : public QgsGeometryCheck
{
Q_OBJECT

public:
QgsGeometryDangleCheck( QgsGeometryCheckerContext *context )
: QgsGeometryCheck( FeatureNodeCheck, {QgsWkbTypes::LineGeometry}, context )
{}
void collectErrors( QList<QgsGeometryCheckError *> &errors, QStringList &messages, QAtomicInt *progressCounter = nullptr, const QMap<QString, QgsFeatureIds> &ids = QMap<QString, QgsFeatureIds>() ) const override;
void fixError( QgsGeometryCheckError *error, int method, const QMap<QString, int> &mergeAttributeIndices, Changes &changes ) const override;
QStringList getResolutionMethods() const override;
QStringList resolutionMethods() const override;
QString errorDescription() const override { return tr( "Dangle" ); }
QString errorName() const override { return QStringLiteral( "QgsGeometryDangleCheck" ); }

@@ -80,7 +80,7 @@ void QgsGeometryDegeneratePolygonCheck::fixError( QgsGeometryCheckError *error,
}
}

QStringList QgsGeometryDegeneratePolygonCheck::getResolutionMethods() const
QStringList QgsGeometryDegeneratePolygonCheck::resolutionMethods() const
{
static QStringList methods = QStringList() << tr( "Delete feature" ) << tr( "No action" );
return methods;
@@ -22,14 +22,12 @@

class ANALYSIS_EXPORT QgsGeometryDegeneratePolygonCheck : public QgsGeometryCheck
{
Q_OBJECT

public:
explicit QgsGeometryDegeneratePolygonCheck( QgsGeometryCheckerContext *context )
: QgsGeometryCheck( FeatureNodeCheck, {QgsWkbTypes::PolygonGeometry}, context ) {}
void collectErrors( QList<QgsGeometryCheckError *> &errors, QStringList &messages, QAtomicInt *progressCounter = nullptr, const QMap<QString, QgsFeatureIds> &ids = QMap<QString, QgsFeatureIds>() ) const override;
void fixError( QgsGeometryCheckError *error, int method, const QMap<QString, int> &mergeAttributeIndices, Changes &changes ) const override;
QStringList getResolutionMethods() const override;
QStringList resolutionMethods() const override;
QString errorDescription() const override { return tr( "Polygon with less than three nodes" ); }
QString errorName() const override { return QStringLiteral( "QgsGeometryDegeneratePolygonCheck" ); }

@@ -132,7 +132,7 @@ void QgsGeometryDuplicateCheck::fixError( QgsGeometryCheckError *error, int meth
}
}

QStringList QgsGeometryDuplicateCheck::getResolutionMethods() const
QStringList QgsGeometryDuplicateCheck::resolutionMethods() const
{
static QStringList methods = QStringList()
<< tr( "No action" )
@@ -27,7 +27,7 @@ class ANALYSIS_EXPORT QgsGeometryDuplicateCheckError : public QgsGeometryCheckEr
const QgsGeometryCheckerUtils::LayerFeature &layerFeature,
const QgsPointXY &errorLocation,
const QMap<QString, QList<QgsFeatureId>> &duplicates )
: QgsGeometryCheckError( check, layerFeature, errorLocation, QgsVertexId(), duplicatesString( check->getContext()->featurePools, duplicates ) )
: QgsGeometryCheckError( check, layerFeature, errorLocation, QgsVertexId(), duplicatesString( check->context()->featurePools, duplicates ) )
, mDuplicates( duplicates )
{ }
QMap<QString, QList<QgsFeatureId>> duplicates() const { return mDuplicates; }
@@ -49,14 +49,12 @@ class ANALYSIS_EXPORT QgsGeometryDuplicateCheckError : public QgsGeometryCheckEr

class ANALYSIS_EXPORT QgsGeometryDuplicateCheck : public QgsGeometryCheck
{
Q_OBJECT

public:
explicit QgsGeometryDuplicateCheck( QgsGeometryCheckerContext *context )
: QgsGeometryCheck( FeatureCheck, {QgsWkbTypes::PointGeometry, QgsWkbTypes::LineGeometry, QgsWkbTypes::PolygonGeometry}, context ) {}
void collectErrors( QList<QgsGeometryCheckError *> &errors, QStringList &messages, QAtomicInt *progressCounter = nullptr, const QMap<QString, QgsFeatureIds> &ids = QMap<QString, QgsFeatureIds>() ) const override;
void fixError( QgsGeometryCheckError *error, int method, const QMap<QString, int> &mergeAttributeIndices, Changes &changes ) const override;
QStringList getResolutionMethods() const override;
QStringList resolutionMethods() const override;
QString errorDescription() const override { return tr( "Duplicate" ); }
QString errorName() const override { return QStringLiteral( "QgsGeometryDuplicateCheck" ); }

@@ -104,7 +104,7 @@ void QgsGeometryDuplicateNodesCheck::fixError( QgsGeometryCheckError *error, int
}
}

QStringList QgsGeometryDuplicateNodesCheck::getResolutionMethods() const
QStringList QgsGeometryDuplicateNodesCheck::resolutionMethods() const
{
static QStringList methods = QStringList() << tr( "Delete duplicate node" ) << tr( "No action" );
return methods;

0 comments on commit b6251d2

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