Skip to content
Permalink
Browse files

Drop the ugly hack in favor of sourceFlags

  • Loading branch information
elpaso committed Dec 21, 2018
1 parent f4d7506 commit 40fb2ce93d000d6e4b4c4f6ee2ecbc7ee9c94b67
Showing with 7 additions and 3 deletions.
  1. +7 −3 python/plugins/processing/gui/AlgorithmExecutor.py
@@ -34,6 +34,7 @@
QgsMessageLog,
QgsProcessingException,
QgsProcessingFeatureSourceDefinition,
QgsProcessingFeatureSource,
QgsProcessingParameters,
QgsProject,
QgsFeatureRequest,
@@ -94,9 +95,12 @@ def execute_in_place_run(alg, parameters, context=None, feedback=None, raise_exc
if context is None:
context = dataobjects.createContext(feedback)

# Ugly hack: the only invalid policy option that makes sense for fixgeometries is to not check
if alg.name() in ('fixgeometries', ):
context.setInvalidGeometryCheck(QgsFeatureRequest.GeometryNoCheck)
# Only feature based algs have sourceFlags
try:
if alg.sourceFlags() & QgsProcessingFeatureSource.FlagSkipGeometryValidityChecks:
context.setInvalidGeometryCheck(QgsFeatureRequest.GeometryNoCheck)
except AttributeError:
pass

active_layer = parameters['INPUT']

0 comments on commit 40fb2ce

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