Skip to content
Permalink
Browse files

[processing] Use unary union in dissolve (much faster for many

complex geometry inputs)
  • Loading branch information
nyalldawson authored and alexbruy committed Apr 10, 2016
1 parent 510f602 commit f412187d65f46d6327cb8e81c74b712fbdd9a01f
Showing with 5 additions and 12 deletions.
  1. +5 −12 python/plugins/processing/algs/qgis/Dissolve.py
@@ -128,18 +128,11 @@ def processAlgorithm(self, progress):
for key, value in myDict.items():
nElement += 1
progress.setPercentage(int(nElement * 100 / nFeat))
for i in range(len(value)):
tmpInGeom = value[i]

if i == 0:
tmpOutGeom = tmpInGeom
else:
try:
tmpOutGeom = QgsGeometry(
tmpOutGeom.combine(tmpInGeom))
except:
raise GeoAlgorithmExecutionException(
self.tr('Geometry exception while dissolving'))
try:
tmpOutGeom = QgsGeometry.unaryUnion(value)
except:
raise GeoAlgorithmExecutionException(
self.tr('Geometry exception while dissolving'))
outFeat.setGeometry(tmpOutGeom)
outFeat.setAttributes(attrDict[key])
writer.addFeature(outFeat)

0 comments on commit f412187

Please sign in to comment.
You can’t perform that action at this time.