DK11 for .NET | TatukGIS.NDK.TGIS_StatisticsResult | Classes | Constructors | Methods | Properties | Events
Container for statistics results.
// 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;
→ TGIS_Object
Name | Visibility | Description | |
---|---|---|---|
TGIS_StatisticsResult() | public | Create an object. _{} | |
Name | Visibility | Description | |
---|---|---|---|
Complete | public | Finalize and compute all requested statistics. _{ } | |
Update | public | Add value to dataset from which statistics will be computed. _{ } | |
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. _{} | |
Name | Visibility | Description | |
---|---|---|---|
BusyEvent | public | Event fired upon progress of statistics calculations. _{} | |
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:
True
is converted to 1 and False
to 0.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.
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;