File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
python/plugins/processing/algs/qgis Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -124,14 +124,14 @@ def processAlgorithm(self, progress):
124
124
current = 0
125
125
total = 100.0 / len (means )
126
126
for (clazz , values ) in means .iteritems ():
127
- outFeat = QgsFeature ()
128
- cx = values [ 0 ] / values [ 2 ]
129
- cy = values [1 ] / values [2 ]
130
- meanPoint = QgsPoint ( cx , cy )
131
-
132
- outFeat .setGeometry (QgsGeometry .fromPoint (meanPoint ))
133
- outFeat .setAttributes ([cx , cy , clazz ])
134
- writer .addFeature (outFeat )
127
+ if values [ 2 ]:
128
+ outFeat = QgsFeature ()
129
+ cx = values [0 ] / values [2 ]
130
+ cy = values [ 1 ] / values [ 2 ]
131
+ meanPoint = QgsPoint ( cx , cy )
132
+ outFeat .setGeometry (QgsGeometry .fromPoint (meanPoint ))
133
+ outFeat .setAttributes ([cx , cy , clazz ])
134
+ writer .addFeature (outFeat )
135
135
current += 1
136
136
progress .setPercentage (int (current * total ))
137
137
You can’t perform that action at this time.
0 commit comments