Skip to content
Permalink
Browse files

Merge pull request #8692 from m-kuhn/fixSingleLayerErrors

Allow saving a layer after fixing invalid geometries
  • Loading branch information
m-kuhn committed Dec 18, 2018
2 parents 7c0b68a + 0cb2900 commit 1e34e75de554fe629ca37e0e9feaa26b9312e97c
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/app/qgsgeometryvalidationservice.cpp
@@ -145,6 +145,10 @@ void QgsGeometryValidationService::onFeatureDeleted( QgsVectorLayer *layer, QgsF

void QgsGeometryValidationService::onBeforeCommitChanges( QgsVectorLayer *layer )
{
if ( mLayerChecks[layer].topologyChecks.empty() && !layer->allowCommit() )
{
showMessage( tr( "Geometry errors have been found. Please fix the errors before saving the layer." ) );
}
if ( !mBypassChecks && !mLayerChecks[layer].topologyChecks.empty() )
{
if ( !layer->allowCommit() )
@@ -359,6 +363,8 @@ void QgsGeometryValidationService::processFeature( QgsVectorLayer *layer, QgsFea

if ( !mLayerChecks[layer].singleFeatureCheckErrors.empty() )
layer->setAllowCommit( false );
else if ( mLayerChecks[layer].topologyChecks.empty() )
layer->setAllowCommit( true );

emit geometryCheckCompleted( layer, fid, allErrors );
}

0 comments on commit 1e34e75

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