@@ -92,6 +92,9 @@ def processAlgorithm(self, progress):
92
92
for i , clip_geom in enumerate (clip_geoms ):
93
93
input_features = [f for f in vector .features (source_layer , QgsFeatureRequest ().setFilterRect (clip_geom .boundingBox ()))]
94
94
95
+ if not input_features :
96
+ continue
97
+
95
98
if single_clip_feature :
96
99
total = 100.0 / len (input_features )
97
100
else :
@@ -116,11 +119,16 @@ def processAlgorithm(self, progress):
116
119
if new_geom .wkbType () == QgsWkbTypes .Unknown or QgsWkbTypes .flatType (new_geom .geometry ().wkbType ()) == QgsWkbTypes .GeometryCollection :
117
120
int_com = in_feat .geometry ().combine (new_geom )
118
121
int_sym = in_feat .geometry ().symDifference (new_geom )
119
- new_geom = int_com .difference (int_sym )
120
- if new_geom .isGeosEmpty () or not new_geom .isGeosValid ():
122
+ if not int_com or not int_sym :
121
123
ProcessingLog .addToLog (ProcessingLog .LOG_ERROR ,
122
124
self .tr ('GEOS geoprocessing error: One or more '
123
125
'input features have invalid geometry.' ))
126
+ else :
127
+ new_geom = int_com .difference (int_sym )
128
+ if new_geom .isGeosEmpty () or not new_geom .isGeosValid ():
129
+ ProcessingLog .addToLog (ProcessingLog .LOG_ERROR ,
130
+ self .tr ('GEOS geoprocessing error: One or more '
131
+ 'input features have invalid geometry.' ))
124
132
else :
125
133
# clip geometry totally contains feature geometry, so no need to perform intersection
126
134
new_geom = in_feat .geometry ()
0 commit comments