File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
python/plugins/processing/algs/qgis Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,6 @@ def processAlgorithm(self, progress):
70
70
writer = self .getOutputFromName (self .OUTPUT ).getVectorWriter (
71
71
layer .fields ().toList (), geomType , layer .crs ())
72
72
73
- inFeat = QgsFeature ()
74
73
outFeat = QgsFeature ()
75
74
inGeom = QgsGeometry ()
76
75
@@ -80,23 +79,18 @@ def processAlgorithm(self, progress):
80
79
collection_attrs = {}
81
80
82
81
features = vector .features (layer )
83
- current = 0
84
- total = 100.0 / (len (features ))
85
-
86
- features = vector .features (layer )
87
- for inFeat in features :
88
- atMap = inFeat .attributes ()
82
+ total = 100.0 / len (features )
83
+ for current , feature in enumerate (features ):
84
+ atMap = feature .attributes ()
89
85
idVar = atMap [index ]
90
86
key = str (idVar ).strip ()
91
87
if not key in collection_geom :
92
88
collection_geom [key ] = []
93
89
collection_attrs [key ] = atMap
94
90
95
- inGeom = inFeat .geometry ()
96
- vType = inGeom .type ()
91
+ inGeom = feature .geometry ()
97
92
collection_geom [key ].append (inGeom )
98
93
99
- current += 1
100
94
progress .setPercentage (int (current * total ))
101
95
102
96
for key , geoms in collection_geom .items ():
You can’t perform that action at this time.
0 commit comments