Bug report #17132

Errors when running QGIS algorithms with inputs with geometry errors

Added by Giovanni Manghi 13 days ago. Updated 13 days ago.

Assignee:Victor Olaya
Affected QGIS version:master Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No


Tested on QGIS master and with this https://github.com/qgis/QGIS/pull/5099 patched version of Processing (that backports some fixes/enhancements from master).

As sample project/dataset it can be used the first one contained here


running tools (tested union and intersection) with the "AreaA" and "areaB" inputs (that have some geometry issues, auto-intersections) then on master the following is thrown:

Algorithm 'Union' starting...
Input parameters: {'INPUT': <QgsProcessingFeatureSourceDefinition {'source':AreaA20170911213135765, 'selectedFeaturesOnly': False}

, 'OUTPUT': <QgsProcessingOutputLayerDefinition {'sink':memory:, 'createOptions': {'fileEncoding': 'System'}}>, 'OVERLAY': <QgsProcessingFeatureSourceDefinition

{'source':AreaB20170911213135757, 'selectedFeaturesOnly': False}


Traceback (most recent call last): File "C:/OSGEO4~1/apps/qgis-dev/./python/plugins\processing\algs\qgis\Union.py", line 101, in processAlgorithm indexB = QgsSpatialIndex(sourceB.getFeatures(QgsFeatureRequest().setSubsetOfAttributes([]).setDestinationCrs(sourceA.sourceCrs())), feedback) Exception: unknown
Execution failed after 0.04 seconds

on 2.18.12 the intersection operation is blocked with a clear message

GEOS geoprocessing error: One or more input features have invalid geometry.

while the union it is not (not even a message in the log), and a wrong results is produced and added to the project.


#1 Updated by Giovanni Manghi 13 days ago

  • Description updated (diff)

Also available in: Atom PDF