Skip to content

Commit 62a571d

Browse files
committed
[processing] skip invalid geometries when dissolving (fix #13752)
1 parent d2c1668 commit 62a571d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,14 @@ def processAlgorithm(self, progress):
7171
if first:
7272
attrs = inFeat.attributes()
7373
tmpInGeom = QgsGeometry(inFeat.geometry())
74+
if tmpInGeom.isGeosEmpty() or not tmpInGeom.isGeosValid():
75+
continue
7476
outFeat.setGeometry(tmpInGeom)
7577
first = False
7678
else:
7779
tmpInGeom = QgsGeometry(inFeat.geometry())
80+
if tmpInGeom.isGeosEmpty() or not tmpInGeom.isGeosValid():
81+
continue
7882
tmpOutGeom = QgsGeometry(outFeat.geometry())
7983
try:
8084
tmpOutGeom = QgsGeometry(tmpOutGeom.combine(tmpInGeom))
@@ -100,6 +104,8 @@ def processAlgorithm(self, progress):
100104
attrs = inFeat.attributes()
101105
tempItem = attrs[fieldIdx]
102106
tmpInGeom = QgsGeometry(inFeat.geometry())
107+
if tmpInGeom.isGeosEmpty() or not tmpInGeom.isGeosValid():
108+
continue
103109

104110
if attrDict[unicode(tempItem).strip()] == None:
105111
# keep attributes of first feature

0 commit comments

Comments
 (0)