User Tools

Site Tools


api:dk11:delphi:gisclassification.tgis_classificationvector

TGIS_ClassificationVector class

DK11 for Delphi | GisClassification.TGIS_ClassificationVector | Classes | Constructors | Methods | Properties

Class that enables performing advanced vector data classification in the process of creating choropleth (thematic) maps.

Available also on: .NET | Java | ActiveX | Python.

Syntax

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

Inheritance

Constructors

Inherited Overrides Protected
Name Visibility Description
Create public

Methods

Inherited Overrides Protected
Name Visibility Description
AddClassBreak public Adds a new class break.
(Inherited from TGIS_ClassificationAbstract)
Classify public Performs the classification.
(Inherited from TGIS_ClassificationAbstract)
Classify(TGIS_ParamsList) public Performs the classification and applies to defined ParamsList.
(Inherited from TGIS_ClassificationAbstract)
doCreate protected Internal constructor.
(Inherited from TGIS_ClassificationAbstract)
EstimateNumClasses public Performs the pre-classification and sets NumClasses property.
(Inherited from TGIS_ClassificationAbstract)
MustCalculateStatistics public If True, statistics from layer assigned to classification need to be calculated.
(Inherited from TGIS_ClassificationAbstract)

Properties

Inherited Protected
Name Visibility Description
ClassBreaks public Computed class breaks.
(Inherited from TGIS_ClassificationAbstract)
ClassIdField public If not empty, the attribute field of the specified name will be populated with the class id values.
ColorRamp public The color ramp that is used to assign colors for class breaks.
(Inherited from TGIS_ClassificationAbstract)
ColorRampName public The name of the built-in color ramp that is used to assign colors for class breaks.
(Inherited from TGIS_ClassificationAbstract)
EndColor public Ending color used to generate ramp for class breaks.
(Inherited from TGIS_ClassificationAbstract)
EndSize public Ending size or width for generating Params section; default is black.
Field public Numeric field with values to be used in classification.
ForceStatisticsCalculation public Forces the calculation of layer statistics.
(Inherited from TGIS_ClassificationAbstract)
Interval public Class interval size; default is 1.
(Inherited from TGIS_ClassificationAbstract)
Layer public Layer assigned to object.
(Inherited from TGIS_ClassificationAbstract)
Method public Classification method; NaturalBreaks by default.
(Inherited from TGIS_ClassificationAbstract)
NumClasses public Number of classes; default is 5, max is 30.
(Inherited from TGIS_ClassificationAbstract)
RenderType public Visual property which will be affected during classification.
ShowLegend public If True, features will be shown in legend panel.
(Inherited from TGIS_ClassificationAbstract)
StartColor public Starting color used to generate ramp for class breaks.
(Inherited from TGIS_ClassificationAbstract)
StartSize public Starting size or width for generating Params section; default is white.
Target public Indicates the data to be used for classification.
(Inherited from TGIS_ClassificationAbstract)

Remarks

Example

Pseudocode:

// while 'lyr' is opened vector layer with added empty 'CLASS_ID' field
classifier = new TGIS_Classification( lyr );

// select one of available classification methods
classifier.Method = TGIS_ClassificationMethod.NaturalBreaks;

// specify number of classes
classifier.NumClasses = 5;

// specify attribute field with numerical values
classifier.Field = 'POPULATION';

// select visual property to be affected
classifier.RenderType = TGIS_ClassificationRenderBy.Color;

// write class ids to existing layer's field
classifier.ClassIdField = 'CLASS_ID';

// check if layer's statistics require recalculation
if classifier.MustCalculateStatistics then
  lyr.Statistics.Calculate ;

// run classification process, visual properties will be applied automatically
classifier.Classify ;

// check generated class breaks values
// class breaks count equals NumClasses + 1
for i from 0 to classifier.NumClasses
  value = classifier.ClassBreaks[i];

References

2024/05/31 20:42

Page Tools