File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
python/plugins/processing/tools Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 38
38
from qgis .core import (QgsApplication ,
39
39
QgsProcessingContext ,
40
40
QgsProject )
41
+ from qgis .PyQt .QtCore import (QCoreApplication )
41
42
from processing .core .Processing import Processing
42
43
from processing .core .parameters import ParameterSelection
43
44
from processing .gui .Postprocessing import handleAlgorithmResults
44
45
from processing .core .ProcessingConfig import ProcessingConfig
46
+ from processing .core .GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
45
47
46
48
47
49
def algorithmOptions (id ):
@@ -111,4 +113,10 @@ def createContext():
111
113
invalid_features_method = ProcessingConfig .getSetting (ProcessingConfig .FILTER_INVALID_GEOMETRIES )
112
114
context .setInvalidGeometryCheck (invalid_features_method )
113
115
116
+ def raise_error (f ):
117
+ raise GeoAlgorithmExecutionException (QCoreApplication .translate ("FeatureIterator" ,
118
+ 'Features with invalid geometries found. Please fix these geometries or specify the "Ignore invalid input features" flag' ))
119
+
120
+ context .setInvalidGeometryCallback (raise_error )
121
+
114
122
return context
You can’t perform that action at this time.
0 commit comments