Skip to content
Permalink
Browse files

[ftools] Several fixes

Fix #8107 Mean coordinates
Fix #8105 Basic statistics
Fix #8104 Unique values
  • Loading branch information
m-kuhn committed Jun 18, 2013
1 parent 59fd5e0 commit 5e4a9dff6b4374e448307482baecab4688868fb8
Showing with 6 additions and 6 deletions.
  1. +5 −4 python/plugins/fTools/tools/doMeanCoords.py
  2. +1 −2 python/plugins/fTools/tools/doVisual.py
@@ -134,6 +134,7 @@ def compute(self, inName, outName, weightField="", times=1, uniqueField=""):
fieldList.append( QgsField("UID", QVariant.String) )
writer = QgsVectorFileWriter(self.shapefileName, self.encoding, fieldList, QGis.WKBPoint, sRs)
outfeat = QgsFeature()
outfeat.setFields( fieldList )
points = []
weights = []
nFeat = provider.featureCount() * len(uniqueValues)
@@ -150,16 +151,16 @@ def compute(self, inName, outName, weightField="", times=1, uniqueField=""):
nElement += 1
self.progressBar.setValue(nElement)
if single:
check = j.strip()
check = unicode(j).strip()
else:
check = feat.attributes()[uniqueIndex].strip()
if check == j.strip():
check = unicode(feat[uniqueIndex]).strip()
if check == unicode(j).strip():
cx = 0.00
cy = 0.00
if weightIndex == -1:
weight = 1.00
else:
weight = float(feat.attributes()[weightIndex])
weight = float(feat[weightIndex])
geom = QgsGeometry(feat.geometry())
geom = ftools_utils.extractPoints(geom)
for i in geom:
@@ -245,7 +245,7 @@ def list_unique_values( self, vlayer, myField ):
for item in unique:
nElement += 1
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), nElement )
lstUnique.append(item.strip())
lstUnique.append(unicode(item).strip())
lstCount = len( unique )
return ( lstUnique, lstCount )

@@ -412,7 +412,6 @@ def nearest_neighbour_analysis( self, vlayer ):
A = vlayer.extent()
A = float( A.width() * A.height() )
index = ftools_utils.createIndex( vprovider )
vprovider.rewind()
nFeat = vprovider.featureCount()
nElement = 0
if nFeat > 0:

0 comments on commit 5e4a9df

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