mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
[processing] Use unary union in dissolve (much faster for many
complex geometry inputs)
This commit is contained in:
parent
7d235d2b0c
commit
ae59b733c3
@ -164,18 +164,11 @@ class Dissolve(GeoAlgorithm):
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user