User Tools

Site Tools


api:dk11:delphi:gisstatistics.tgis_statisticspixel

TGIS_StatisticsPixel class

DK11 for Delphi | GisStatistics.TGIS_StatisticsPixel | Classes | Constructors | Methods | Properties

Statistics class for raster layers.

Available also on: .NET | Java | ActiveX.

Syntax

// Delphi
type
  TGIS_StatisticsPixel = class( TGIS_StatisticsLayer )
  end;
// C++ Builder
class PASCALIMPLEMENTATION TGIS_StatisticsPixel : public TGIS_StatisticsLayer
{
};

Inheritance

Constructors

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

Methods

Inherited Overrides Protected
Name Visibility Description
Add public Add statistics result definition.
(Inherited from TGIS_StatisticsAbstract)
AddAll public Add statistics result definitions for all available datasets.
AddAll(TGIS_StatisticalFunctions) public
AddAllBands public Add statistics result definitions for all bands from pixel layer;
AddAllBands(TGIS_StatisticalFunctions) public Add 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 TTKSTATS file and load all information into parent layer
(Inherited from TGIS_StatisticsAbstract)
Reset public Reset 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 TTKSTATS file.
(Inherited from TGIS_StatisticsAbstract)

Properties

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)

Remarks

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

See TGIS_StatisticsAbstract class.

Example

Pseudocode:

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

// add all bands from pixel layer
stats.AddAllBands(TGIS_StatisticalFunctions.BasicStatistics);

stats.Calculate;

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

2019/06/26 01:09