Skip to content
Permalink
Browse files

Make QgsGeometryCheck::CheckType available in factory

  • Loading branch information
m-kuhn committed Sep 30, 2018
1 parent cf0b3e9 commit 81cfc36c1f07da144842e9a72e0b42ada11a0791
@@ -70,6 +70,12 @@ class ANALYSIS_EXPORT QgsGeometryDuplicateCheck : public QgsGeometryCheck
static QString factoryId();
static QgsGeometryCheck::CheckType factoryCheckType();

static QList<QgsWkbTypes::GeometryType> factoryCompatibleGeometryTypes() {return {QgsWkbTypes::PointGeometry, QgsWkbTypes::LineGeometry, QgsWkbTypes::PolygonGeometry}; }
static bool factoryIsCompatible( QgsVectorLayer *layer ) SIP_SKIP { return factoryCompatibleGeometryTypes().contains( layer->geometryType() ); }
static QString factoryDescription() { return tr( "Duplicate" ); }
static QString factoryId();
static QgsGeometryCheck::CheckType factoryCheckType();

enum ResolutionMethod { NoChange, RemoveDuplicates };
};

@@ -925,7 +925,6 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
functionProfile( &QgisApp::initLayouts, this, QStringLiteral( "Initialize layouts support" ) );

startProfile( QStringLiteral( "Geometry validation" ) );
QgsAnalysis::instance()->geometryCheckRegistry()->initialize();

mGeometryValidationService = qgis::make_unique<QgsGeometryValidationService>( QgsProject::instance() );
connect( mGeometryValidationService.get(), &QgsGeometryValidationService::warning, this, [this]( const QString & message )
@@ -136,7 +136,7 @@ void QgsGeometryValidationService::enableLayerChecks( QgsVectorLayer *layer )

const QStringList activeChecks = layer->geometryOptions()->geometryChecks();

const QList<QgsGeometryCheckFactory *> singleCheckFactories = checkRegistry->geometryCheckFactories( layer, QgsGeometryCheck::SingleGeometryCheck );
const QList<QgsGeometryCheckFactory *> singleCheckFactories = checkRegistry->geometryCheckFactories( layer, QgsGeometryCheck::FeatureNodeCheck, QgsGeometryCheck::AvailableInValidation );

for ( QgsGeometryCheckFactory *factory : singleCheckFactories )
{
@@ -159,7 +159,7 @@ void QgsGeometryValidationService::enableLayerChecks( QgsVectorLayer *layer )

// Topology checks
QList<QgsGeometryCheck *> topologyChecks;
const QList<QgsGeometryCheckFactory *> topologyCheckFactories = checkRegistry->geometryCheckFactories( layer, QgsGeometryCheck::SingleLayerTopologyCheck );
const QList<QgsGeometryCheckFactory *> topologyCheckFactories = checkRegistry->geometryCheckFactories( layer, QgsGeometryCheck::LayerCheck, QgsGeometryCheck::AvailableInValidation );

for ( QgsGeometryCheckFactory *factory : topologyCheckFactories )
{

0 comments on commit 81cfc36

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