Skip to content

Commit

Permalink
[processing] stop algorithm execution if geometry/feature error occured
Browse files Browse the repository at this point in the history
(fix #11986)
  • Loading branch information
alexbruy committed May 13, 2017
1 parent 512f5d5 commit 6feed19
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions python/plugins/processing/algs/qgis/Intersection.py
Expand Up @@ -92,11 +92,10 @@ def processAlgorithm(self, progress):
int_sym = geom.symDifference(tmpGeom)
int_geom = QgsGeometry(int_com.difference(int_sym))
if int_geom.isGeosEmpty() or not int_geom.isGeosValid():
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
self.tr('GEOS geoprocessing error: One or '
'more input features have invalid '
'geometry.'))
break
raise GeoAlgorithmExecutionException(
self.tr('GEOS geoprocessing error: One or '
'more input features have invalid '
'geometry.'))
try:
if int_geom.wkbType() in wkbTypeGroups[wkbTypeGroups[int_geom.wkbType()]]:
outFeat.setGeometry(int_geom)
Expand All @@ -106,8 +105,8 @@ def processAlgorithm(self, progress):
outFeat.setAttributes(attrs)
writer.addFeature(outFeat)
except:
ProcessingLog.addToLog(ProcessingLog.LOG_INFO,
self.tr('Feature geometry error: One or more output features ignored due to invalid geometry.'))
continue
raise GeoAlgorithmExecutionException(
self.tr('Feature geometry error: One or more '
'output features ignored due to invalid geometry.'))

del writer

0 comments on commit 6feed19

Please sign in to comment.