You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -176,17 +185,34 @@ class CORE_EXPORT QgsProcessingContext
176
185
{
177
186
mInvalidGeometryCheck = check;
178
187
179
-
if ( mInvalidGeometryCheck == QgsFeatureRequest::GeometryAbortOnInvalid )
188
+
switch ( mInvalidGeometryCheck )
180
189
{
181
-
auto callback = []( const QgsFeature & feature )
190
+
case QgsFeatureRequest::GeometryAbortOnInvalid:
191
+
{
192
+
auto callback = []( const QgsFeature & feature )
193
+
{
194
+
throwQgsProcessingException( QObject::tr( "Feature (%1) has invalid geometry. Please fix the geometry or change the Processing setting to the \"Ignore invalid input features\" option." ).arg( feature.id() ) );
195
+
};
196
+
mInvalidGeometryCallback = callback;
197
+
break;
198
+
}
199
+
200
+
case QgsFeatureRequest::GeometrySkipInvalid:
182
201
{
183
-
throwQgsProcessingException( QObject::tr( "Feature (%1) has invalid geometry. Please fix the geometry or change the Processing setting to the \"Ignore invalid input features\" option." ).arg( feature.id() ) );
mFeedback->reportError( QObject::tr( "Feature (%1) has invalid geometry and has been skipped. Please fix the geometry or change the Processing setting to the \"Ignore invalid input features\" option." ).arg( feature.id() ) );
206
+
};
207
+
mInvalidGeometryCallback = callback;
208
+
break;
209
+
}
210
+
211
+
default:
212
+
break;
186
213
}
187
214
}
188
215
189
-
190
216
/**
191
217
* Sets a callback function to use when encountering an invalid geometry and
192
218
* invalidGeometryCheck() is set to GeometryAbortOnInvalid. This function will be
@@ -268,6 +294,22 @@ class CORE_EXPORT QgsProcessingContext
0 commit comments