Skip to content
Permalink
Browse files

Merge pull request #2988 from nyalldawson/dissolve

[processing] Use unary union in dissolve
  • Loading branch information
alexbruy committed Apr 10, 2016
2 parents 7d235d2 + ae59b73 commit 391e14ac961b2f2a26a2fb11e00bf40a9e4e4cb8
Showing with 5 additions and 12 deletions.
  1. +5 −12 python/plugins/processing/algs/qgis/Dissolve.py
@@ -164,18 +164,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 391e14a

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