User Tools

Site Tools


TGIS_StatisticsPixel class

DK11 for .NET | TatukGIS.NDK.TGIS_StatisticsPixel | Classes | Constructors | Methods | Properties

Statistics class for raster layers.

Available also on: Delphi | Java | ActiveX.


// C#
public class TGIS_StatisticsPixel : TGIS_StatisticsLayer
' VisualBasic
Public Class TGIS_StatisticsPixel
  Inherits TGIS_StatisticsLayer
End Class
// Oxygene
  TGIS_StatisticsPixel = public class( TGIS_StatisticsLayer )


→ TGIS_BaseObjectDisposable → TGIS_StatisticsAbstractTGIS_StatisticsLayer


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


Inherited Overrides Protected
Name Visibility Description
Add public Adds statistics result definition.
(Inherited from TGIS_StatisticsAbstract)
AddAll public Adds statistics result definitions for all available datasets.
AddAll(TGIS_StatisticalFunctions) public
AddAllBands public Adds statistics result definitions for all bands from pixel layer;
AddAllBands(TGIS_StatisticalFunctions) public Adds statistics result definitions for all bands from pixel layer;
Calculate public Calculate requested statistics from the entire layer.
(Inherited from TGIS_StatisticsAbstract)
doCreate protected "private constructor"
(Inherited from TGIS_StatisticsAbstract)
Get public Get statistics result by name.
(Inherited from TGIS_StatisticsAbstract)
LoadFromFile public Parse statistics file and load all information into parent layer.
LoadFromFile(string) public
Reset public Resets statistics object to initial state.
(Inherited from TGIS_StatisticsAbstract)
ResetModified public Undo changes in requested statistics definitions.
(Inherited from TGIS_StatisticsAbstract)
SaveToFile public Save layer statistics into auxiliary file.
(Inherited from TGIS_StatisticsAbstract)


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


This class inherits from TGIS_StatisticsAbstract and is specialised for pixel layers, e.g.:

  • AddAllBands method,
  • To avoid long calculation on big images, FastStatistics property is set to True by default. It means that the statistics engine uses resampling for pixel layers greater than 2048 x 2048 cells. In this case, results are approximate with high accuracy. Set False to compute fully accurate statistics.




// layer.Statistics is an instance of TGIS_StatisticsAbstract so casting is needed
stats = TGIS_StatisticsPixel(layer.Statistics);

// add all bands from pixel layer


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

Valid names are 'A', 'R', 'G', 'B', 'H', 'S', 'L' for images and 'Value' for grid (listed in stats.AvailableResults list).

Use later like in TGIS_Abstract example.

2020/08/19 01:16

Page Tools