Skip to content
Permalink
Browse files

Fix iteration of features

  • Loading branch information
ahuarte47 committed Nov 10, 2016
1 parent 10648df commit dc800dbab7d797a740f6802f5a80b4e802461224
Showing with 4 additions and 10 deletions.
  1. +4 −10 python/plugins/processing/algs/qgis/SinglePartsToMultiparts.py
@@ -70,7 +70,6 @@ def processAlgorithm(self, progress):
writer = self.getOutputFromName(self.OUTPUT).getVectorWriter(
layer.fields().toList(), geomType, layer.crs())

inFeat = QgsFeature()
outFeat = QgsFeature()
inGeom = QgsGeometry()

@@ -80,23 +79,18 @@ def processAlgorithm(self, progress):
collection_attrs = {}

features = vector.features(layer)
current = 0
total = 100.0 / (len(features))

features = vector.features(layer)
for inFeat in features:
atMap = inFeat.attributes()
total = 100.0 / len(features)
for current, feature in enumerate(features):
atMap = feature.attributes()
idVar = atMap[index]
key = str(idVar).strip()
if not key in collection_geom:
collection_geom[key] = []
collection_attrs[key] = atMap

inGeom = inFeat.geometry()
vType = inGeom.type()
inGeom = feature.geometry()
collection_geom[key].append(inGeom)

current += 1
progress.setPercentage(int(current * total))

for key, geoms in collection_geom.items():

0 comments on commit dc800db

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