User Tools

Site Tools


api:dk11:java:tatukgis.jdk.tgis_statisticsabstract

TGIS_StatisticsAbstract class

DK11 for Java | tatukgis.jdk.TGIS_StatisticsAbstract | Classes | Methods | Properties

General statistics class. Must be derived.

Available also on: Delphi | .NET | ActiveX.

Syntax

// Java
public class TGIS_StatisticsAbstract extends TGIS_Object {
};
// Oxygene
type
  TGIS_StatisticsAbstract = public class( TGIS_Object )
  end;

Inheritance

→ TGIS_Object

Methods

Inherited Overrides Protected
Name Visibility Description
Add(java.lang.String) public Add statistics result definition.
Add(java.lang.String, TGIS_StatisticalFunction, Variant[], Variant) public Add statistics result definition.
Add(java.lang.String, TGIS_StatisticalFunctions) public Add statistics result definition.
Add(java.lang.String, TGIS_StatisticalFunctions, Variant) public Add statistics result definition.
AddAll public Add statistics result definitions for all available datasets.
AddAll(TGIS_StatisticalFunctions) public Add statistics result definitions for all available datasets.
Calculate public Calculate requested statistics from the entire layer.
Calculate(TGIS_Extent, TGIS_ShapeAbstract, java.lang.String, bool) public Calculate requested statistics from filtered elements of the layer.
doCreate protected "private constructor"
Get public Get statistics result by name.
LoadFromFile public Parse TTKSTATS file and load all information into parent layer
LoadFromFile(java.lang.String) public Parse TTKSTATS file and load all information into parent layer
Reset public Reset statistics object to initial state.
ResetModified public Undo changes in requested statistics definitions.
SaveToFile public Save layer statistics into TTKSTATS file.
SaveToFile(java.lang.String) public Save layer statistics into TTKSTATS file.

Properties

Inherited Protected
Name Visibility Description
Age public Age of the statistics.
AvailableResults public List of available results names; read-only.
DefinedResults public List of already defined results names; read-only.
FastStatistics public Determines the state if "Fast Statistics" was computed; read-only.
Modified public True if requested statistics have changed.
Obsolete public Check validity of statistics.
UseBesselCorrection public If True, statistics class will use Bessel's correction.

Remarks

This class provide access to generating, saving and loading layer's statistics.

TGIS_StatisticalFunction enum contains list of available statistical functions which are implemented. They are also presented in table below.

Function name Basic Standard All Description
Average + + + The average value (arithmetic mean) of dataset.
Count + + + Number of valid elements in dataset (not empty, not null).
CountMissings + + Number of empty or null elements in dataset.
Max + + + The maximum value in dataset.
Majority + The value that occurs most often in dataset.
Median + + The median (middle value) of dataset.
Min + + + The minimum value in dataset.
Minority + The value that occurs least often in dataset.
Range + + The difference between maximum and minimum values in dataset.
StandardDeviation + + The standard deviation of dataset.
Sum + + + The sum of values in dataset.
Variance + + The variance of dataset.
Variety + The number of unique values in dataset.
Unique + Extracting unique values from dataset.

TGIS_StatisticalFunctions is used to define requested statistics. Predefined groups can be used:

  • EmptyStatistics,
  • BasicStatistics,
  • StandardStatistics (this is default),
  • AllStatistics.

Statistics results can be narrowed by setting Extent, Shape, Relation properties.

By default statistics engine calculate population standard deviation and variance (divider equals “N”). Sample variance and standard deviation (divider equals “N-1”) can be calculated by setting UseBesselCorrection to True.

See:

Example

Pseudocode:

// add all fields from vector layer or bands from pixel layer
layer.Statistics.AddAll(TGIS_StatisticalFunctions.BasicStatistics);

layer.Statistics.Calculate;

// demand a result
stats_result = layer.Statistics.Get(<valid_name>);

Valid names are listed in stats.AvailableResults list.

// check calculated values
average = stats_result.Average.Value;
count = stats_result.Count.Value;
min = stats_result.Min.Value;
max = stats_result.Max.Value;
sum = stats_result.Sum.Value;

References

2019/06/26 01:12