User Tools

Site Tools


api:dk11:net:tatukgis.ndk.tgis_statisticsresult

TGIS_StatisticsResult class

DK11 for .NET | TatukGIS.NDK.TGIS_StatisticsResult | Classes | Constructors | Methods | Properties | Events

Container for statistics results.

Available also on: Delphi | Java | ActiveX.

Syntax

// C#
public class TGIS_StatisticsResult : TGIS_Object
{
}
' VisualBasic
Public Class TGIS_StatisticsResult
  Inherits TGIS_Object
End Class
// Oxygene
type
  TGIS_StatisticsResult = public class( TGIS_Object )
  end;

Inheritance

→ TGIS_Object

Constructors

Inherited Overrides Protected
Name Visibility Description
TGIS_StatisticsResult() public Create an object.

Methods

Inherited Overrides Protected
Name Visibility Description
Complete public Finalize and compute all requested statistics.
Update public Add value to dataset from which statistics will be computed.

Properties

Inherited Protected
Name Visibility Description
AvailableStatistics public List of calculated statistics (only requested).
Average public The average value (arithmetic mean) of dataset.
Count public Number of valid elements in dataset (not empty, not null).
CountMissings public Number of empty or null elements in dataset.
DatasetType public Dataset type; read-only.
IgnoreValue public Value from dataset which is ignored in statistics; read-only.
Majority public The value that occurs most often in dataset.
Max public The maximum value in dataset.
Median public The median (middle value) of dataset.
Min public The minimum value in dataset.
Minority public The value that occurs least often in dataset.
Name public Name of statistics result; read-only.
Percentile public Percentiles calculated for requested percentages.
Range public The difference between maximum and minimum values in dataset.
Sample public Sample values from dataset.
StandardDeviation public The standard deviation of dataset.
Sum public The sum of values in dataset.
Unique public Unique values from dataset.
UseBesselCorrection public True if statistics class uses Bessel's correction; read-only.
Variance public The variance of dataset.
Variety public The number of unique values in dataset.

Events

Inherited Protected
Name Visibility Description
BusyEvent public Event fired upon progress of statistics calculations.

Remarks

This class is strongly linked with TGIS_StatisticsAbstract class but it can be also used independently for creating statistics from custom dataset (not layers).

Statistics are calculated for all data types, like numbers, booleans, dates and strings whereby:

  • Boolean value True is converted to 1 and False to 0.
  • Strings are used directly for functions: Majority, Minority, Variety and Unique. The rest of functions take string length into account.

Use IgnoreValue property to omit specific value in statistics calculations. For pixel layers NoDataValue is used.

The example below shows how quickly calculate statistics from list of values.

Example

Pseudocode:

// create an instance of TGIS_StatisticsResult
stats_result = TGIS_StatisticsResult.Create(
  TGIS_FieldType.Float,                       // type of dataset
  'my_stats',                                 // name for result
  TGIS_StatisticalFunctions.BasicStatistics,  // use predefined set with basic statistical functions 
  0                                           // ignore value
);
  
// collect data (send values to statistics engine) 
for value in data
  stats_result.Update(value);

// finalize (calculate statistics & fill properties)
stats_result.Complete ;

//check values
if stats_result.Count.Calculated
  count = stats_result.Count.Value;    

References

2019/06/26 01:16