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.double
getMean()
mean value generated when calcualting standard deviationint
int
Returns 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.void
init
(SimpleFeatureCollection collection) void
reset()
void
void
Visit the provided feature.void
visit
(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:FeatureAttributeVisitor
List of expressions used by visitor.- Specified by:
getExpressions
in interfaceFeatureAttributeVisitor
-
getResultType
Description copied from interface:FeatureAttributeVisitor
Returns the expected output type given the input type.- Specified by:
getResultType
in interfaceFeatureAttributeVisitor
- Parameters:
inputTypes
- The type of the input expressions
-
getResult
Description copied from interface:FeatureCalc
Returns the result of the calculation as a handy object which can be merged and modified.- Specified by:
getResult
in interfaceFeatureCalc
- Returns:
- the results of the calculation
-
visit
-
visit
Description copied from interface:FeatureVisitor
Visit 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:
visit
in 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
-