Package org.geotools.feature.visitor
Class StandardDeviationVisitor
Object
StandardDeviationVisitor
- All Implemented Interfaces:
FeatureVisitor,FeatureAttributeVisitor,FeatureCalc
public class StandardDeviationVisitor
extends Object
implements FeatureCalc, FeatureAttributeVisitor
Determines the standard deviation.
----------------------------
| 1 ---
Std dev = | ___ \ ( x - mean ) ^ 2
\| N /__
aka std dev = sqrt((sum((x-mean)^2))/N) where N is the number of samples.
It uses the rolling variance algorithm described here: http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#On-line_algorithm
- Author:
- Cory Horner, Refractions Research Inc., Andrea Aime, GeoSolutions
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a standard deviation visitor based on the specified expression -
Method Summary
Modifier and TypeMethodDescriptionList of expressions used by visitor.doublegetMean()mean value generated when calcualting standard deviationintintReturns the result of the calculation as a handy object which can be merged and modified.getResultType(List<Class> inputTypes) Returns the expected output type given the input type.voidinit(SimpleFeatureCollection collection) voidreset()voidvoidVisit the provided feature.voidvisit(SimpleFeature feature)
-
Constructor Details
-
StandardDeviationVisitor
Constructs a standard deviation visitor based on the specified expression
-
-
Method Details
-
init
-
getExpression
-
setValue
-
getExpressions
Description copied from interface:FeatureAttributeVisitorList of expressions used by visitor.- Specified by:
getExpressionsin interfaceFeatureAttributeVisitor
-
getResultType
Description copied from interface:FeatureAttributeVisitorReturns the expected output type given the input type.- Specified by:
getResultTypein interfaceFeatureAttributeVisitor- Parameters:
inputTypes- The type of the input expressions
-
getResult
Description copied from interface:FeatureCalcReturns the result of the calculation as a handy object which can be merged and modified.- Specified by:
getResultin interfaceFeatureCalc- Returns:
- the results of the calculation
-
visit
-
visit
Description copied from interface:FeatureVisitorVisit the provided feature.Please consult the documentation for the FeatureCollection you are visiting to learn more - the provided feature may be invalid, or read only.
- Specified by:
visitin interfaceFeatureVisitor
-
reset
public void reset() -
getMean
public double getMean()mean value generated when calcualting standard deviation -
getNaNCount
public int getNaNCount()- Returns:
- the number of features which returned a NaN
-
getNullCount
public int getNullCount()- Returns:
- the number of features which returned a null
-