Skip to content
Permalink
Browse files

[ftools] Fix basic statistics (Fix #8105)

  • Loading branch information
m-kuhn committed Jun 19, 2013
1 parent cfadfb5 commit 419d8ee5931225d672d92984f60c54b69c2f25e7
Showing with 10 additions and 8 deletions.
  1. +10 −8 python/plugins/fTools/tools/doVisual.py
@@ -271,8 +271,10 @@ def basic_statistics( self, vlayer, myField ):
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0 )
self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
for f in selection:
atMap = f.attributes()
lenVal = float( len( atMap[ index ] ) )
try:
lenVal = float( len( f[ index ] ) )
except TypeError:
lenVal = 0
if first:
minVal = lenVal
maxVal = lenVal
@@ -295,8 +297,10 @@ def basic_statistics( self, vlayer, myField ):
self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
fit = vprovider.getFeatures()
while fit.nextFeature( feat ):
atMap = feat.attributes()
lenVal = float( len( atMap[ index ] ) )
try:
lenVal = float( len( feat[ index ] ) )
except TypeError:
lenVal = 0
if first:
minVal = lenVal
maxVal = lenVal
@@ -340,8 +344,7 @@ def basic_statistics( self, vlayer, myField ):
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0 )
self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
for f in selection:
atMap = f.attributes()
value = float( atMap[ index ] )
value = float( f[ index ] )
if first:
minVal = value
maxVal = value
@@ -361,8 +364,7 @@ def basic_statistics( self, vlayer, myField ):
self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
fit = vprovider.getFeatures()
while fit.nextFeature( feat ):
atMap = feat.attributes()
value = float( atMap[ index ] )
value = float( feat[ index ] )
if first:
minVal = value
maxVal = value

0 comments on commit 419d8ee

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