Skip to content

Commit 3661bc3

Browse files
committed
[Processing] bugfix: intersection QGIS algorithm
fixing this by testing int_com. ``` Traceback (most recent call last): File "C:/PROGRA~1/QGIS2~1.17/apps/qgis/./python/plugins\processing\core\GeoAlgorithm.py", line 203, in execute self.processAlgorithm(progress) File "C:/PROGRA~1/QGIS2~1.17/apps/qgis/./python/plugins\processing\algs\qgis\Intersection.py", line 100, in processAlgorithm int_geom = QgsGeometry(int_com.difference(int_sym)) ``` AttributeError: 'NoneType' object has no attribute 'difference'
1 parent f5ffbbf commit 3661bc3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

python/plugins/processing/algs/qgis/Intersection.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,10 @@ def processAlgorithm(self, progress):
9696
int_geom = QgsGeometry(geom.intersection(tmpGeom))
9797
if int_geom.wkbType() == QgsWkbTypes.Unknown or QgsWkbTypes.flatType(int_geom.geometry().wkbType()) == QgsWkbTypes.GeometryCollection:
9898
int_com = geom.combine(tmpGeom)
99-
int_sym = geom.symDifference(tmpGeom)
100-
int_geom = QgsGeometry(int_com.difference(int_sym))
99+
int_geom = QgsGeometry()
100+
if int_com:
101+
int_sym = geom.symDifference(tmpGeom)
102+
int_geom = QgsGeometry(int_com.difference(int_sym))
101103
if int_geom.isGeosEmpty() or not int_geom.isGeosValid():
102104
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
103105
self.tr('GEOS geoprocessing error: One or '

0 commit comments

Comments
 (0)