DK11 for Delphi | GisStatistics.TGIS_StatisticsResult | Classes | Constructors | Methods | Properties | Events
Container for statistics results.
// Delphi type TGIS_StatisticsResult = class( TGIS_Object ) end;
// C++ Builder class PASCALIMPLEMENTATION TGIS_StatisticsResult : public TGIS_Object { };
→ TObject → TGIS_Object
Name | Visibility | Description | |
---|---|---|---|
Create | public | Create an object. _{} | |
Name | Visibility | Description | |
---|---|---|---|
Complete | public | Finalize and compute all requested statistics. _{ } | |
Update | public | Adds 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. _{} | |
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;