Skip to content

Commit fb2c167

Browse files
rldhontalexbruy
authored andcommitted
[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' (cherry picked from commit 3661bc3) (cherry picked from commit 5b57317)
1 parent a465b0e commit fb2c167

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
@@ -87,8 +87,10 @@ def processAlgorithm(self, progress):
8787
int_geom = QgsGeometry(geom.intersection(tmpGeom))
8888
if int_geom.wkbType() == QGis.WKBUnknown or QgsWKBTypes.flatType(int_geom.geometry().wkbType()) == QgsWKBTypes.GeometryCollection:
8989
int_com = geom.combine(tmpGeom)
90-
int_sym = geom.symDifference(tmpGeom)
91-
int_geom = QgsGeometry(int_com.difference(int_sym))
90+
int_geom = QgsGeometry()
91+
if int_com is not None:
92+
int_sym = geom.symDifference(tmpGeom)
93+
int_geom = QgsGeometry(int_com.difference(int_sym))
9294
if int_geom.isGeosEmpty() or not int_geom.isGeosValid():
9395
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
9496
self.tr('GEOS geoprocessing error: One or '

0 commit comments

Comments
 (0)