User Tools

Site Tools


TGIS_StatisticsResult class

DK11 for ActiveX | TatukGIS_XDK11.TGIS_StatisticsResult | Classes | Methods | Properties

Container for statistics results.

Available also on: Delphi | .NET | Java.


// C#
public class TGIS_StatisticsResult : ITGIS_StatisticsResult, IConnectionPointContainer, ITGIS_StatisticsResultEvents 
' VisualBasic
Public Class TGIS_StatisticsResult
  Implements ITGIS_StatisticsResult
  Implements IConnectionPointContainer
  Implements ITGIS_StatisticsResultEvents
End Class
// Oxygene
  TGIS_StatisticsResult = public class



Inherited Overrides Protected
Name Visibility Description
AttachDelphiObj public Only for internal use of TatukGIS.
(Inherited from ITBaseObject)
BusyEvent public
(Inherited from ITGIS_StatisticsResultEvents)
Complete public Finalize and compute all requested statistics.
Create_ public Create an object.
DelphiObj public Only for internal use of TatukGIS.
(Inherited from ITBaseObject)
Update public Adds value to dataset from which statistics will be computed.


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.
Variance public The variance of dataset.
Variety public The number of unique values in dataset.


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.



// 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

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

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


2021/02/05 01:05

Page Tools