This document is archived and information here might be outdated. Recommended version. |
ArcObjects namespaces > System > ESRI.ArcGIS.esriSystem > Interfaces > IC > IClassifyGEN Interface > IClassifyGEN.Classify Method (ArcObjects .NET 10.4 SDK) |
Classifies histogram data (array of values (doubles) and a paired array of frequencies (longs)) into the specified number of classes.
[Visual Basic .NET] Public Sub Classify ( _ ByVal doubleArrayValues As Object, _ ByVal longArrayFrequencies As Object, _ ByRef numClasses As Integer _ )
[C#] public void Classify ( object doubleArrayValues, object longArrayFrequencies, ref int numClasses );
[C++]
HRESULT Classify(
VARIANT doubleArrayValues,
VARIANT longArrayFrequencies,
long* numClasses
);
[C++]
Parameters doubleArrayValues [in] doubleArrayValues is a parameter of type VARIANT longArrayFrequencies [in] longArrayFrequencies is a parameter of type VARIANT numClasses [in, out] numClasses is a parameter of type long
Classify generates the ClassBreaks based upon the numeric data passed and the number of classes specified.
Pass two safe arrays to the Classify method that must have the same number of elements and an index of zero for their first element. The first array (doubeArrayValues) is the numeric data values, defined as an array of double. This array must be sorted in increasing value order. The second array (longArrayFrequencies) represents the frequency of occurrence of the values, that is, an integer count of the number of times a value occurs.
For example, if the two arrays were called DataValues and DataFrequency, the lowest value would be stored in DataValue(0), and the number of times this value occurred would be stored in DataFrequency(0).
You could populate these arrays in code yourself, but if the data is available through the attribute field of a table, you can utilize the TableHistogram object to gather the data values and frequencies for you.
You must supply the number of desired classes as a variable defined as a Long. Some classification algorithms will return a different number of class breaks to what you specified. The number of classes will be written back to the variable you supplied, so it is always best to recheck the number of class breaks after calling Classify.