public class StandardDeviationVisitor extends Object implements FeatureCalc, FeatureAttributeVisitor
----------------------------
| 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
| Modifier and Type | Class and Description |
|---|---|
static class |
StandardDeviationVisitor.Result |
| Constructor and Description |
|---|
StandardDeviationVisitor(Expression expr)
Constructs a standard deviation visitor based on the specified expression
|
| Modifier and Type | Method and Description |
|---|---|
Expression |
getExpression() |
List<Expression> |
getExpressions()
List of expressions used by visitor.
|
double |
getMean()
mean value generated when calcualting standard deviation
|
int |
getNaNCount() |
int |
getNullCount() |
CalcResult |
getResult()
Returns the result of the calculation as a handy object which can be merged and modified.
|
Optional<List<Class>> |
getResultType(List<Class> inputTypes)
Returns the expected output type given the input type.
|
void |
init(SimpleFeatureCollection collection) |
void |
reset() |
void |
setValue(Object value) |
void |
visit(Feature feature)
Visit the provided feature.
|
void |
visit(SimpleFeature feature) |
public StandardDeviationVisitor(Expression expr)
public void init(SimpleFeatureCollection collection)
public Expression getExpression()
public void setValue(Object value)
public List<Expression> getExpressions()
FeatureAttributeVisitorgetExpressions in interface FeatureAttributeVisitorpublic Optional<List<Class>> getResultType(List<Class> inputTypes)
FeatureAttributeVisitorgetResultType in interface FeatureAttributeVisitorinputTypes - The type of the input expressionspublic CalcResult getResult()
FeatureCalcgetResult in interface FeatureCalcpublic void visit(SimpleFeature feature)
public void visit(Feature feature)
FeatureVisitorPlease consult the documentation for the FeatureCollection you are visiting to learn more - the provided feature may be invalid, or read only.
visit in interface FeatureVisitorpublic void reset()
public double getMean()
public int getNaNCount()
public int getNullCount()
Copyright © 1996–2021 Geotools. All rights reserved.