File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
python/plugins/processing/algs/qgis Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -85,12 +85,16 @@ def processAlgorithm(self, progress):
8585 for current , inFeatA in enumerate (selectionA ):
8686 progress .setPercentage (int (current * total ))
8787 geom = QgsGeometry (inFeatA .geometry ())
88+ if not geom .isGeosValid ():
89+ raise GeoAlgorithmExecutionException (
90+ self .tr ('Input layer A contains invalid geometries. Unable to complete intersection algorithm.' ))
8891 atMapA = inFeatA .attributes ()
8992 intersects = index .intersects (geom .boundingBox ())
90- for i in intersects :
91- request = QgsFeatureRequest ().setFilterFid (i )
92- inFeatB = vlayerB .getFeatures (request ).next ()
93+ for inFeatB in vlayerB .getFeatures (QgsFeatureRequest ().setFilterFids (intersects )):
9394 tmpGeom = QgsGeometry (inFeatB .geometry ())
95+ if not tmpGeom .isGeosValid ():
96+ raise GeoAlgorithmExecutionException (
97+ self .tr ('Input layer B contains invalid geometries. Unable to complete intersection algorithm.' ))
9498 if geom .intersects (tmpGeom ):
9599 atMapB = inFeatB .attributes ()
96100 int_geom = QgsGeometry (geom .intersection (tmpGeom ))
You can’t perform that action at this time.
0 commit comments