There is an indentation error in the Dissolve.py script that writes out the intermediate object on every merge with an input feature rather than just once at the end of the processing. This results in very large output file sizes.

I have also edited the defineCharacteristics function to allow the tool input to accept polyline features as well as polygons, in line with the fTools UI.
This commit is contained in:
unknown 2014-03-12 10:49:54 +00:00
parent cc9a48734e
commit ed5f7781ba

View File

@ -85,8 +85,8 @@ class Dissolve(GeoAlgorithm):
except:
raise GeoAlgorithmExecutionException(
'Geometry exception while dissolving')
outFeat.setAttributes(attrs)
writer.addFeature(outFeat)
outFeat.setAttributes(attrs)
writer.addFeature(outFeat)
else:
unique = vector.getUniqueValues(vlayerA, int(field))
nFeat = nFeat * len(unique)
@ -125,7 +125,8 @@ class Dissolve(GeoAlgorithm):
self.name = 'Dissolve'
self.group = 'Vector geometry tools'
self.addParameter(ParameterVector(Dissolve.INPUT, 'Input layer',
[ParameterVector.VECTOR_TYPE_POLYGON]))
[ParameterVector.VECTOR_TYPE_POLYGON,
ParameterVector.VECTOR_TYPE_LINE]))
self.addParameter(ParameterBoolean(Dissolve.DISSOLVE_ALL,
'Dissolve all (do not use field)', True))
self.addParameter(ParameterTableField(Dissolve.FIELD, 'Unique ID field'