Public Function GetEqualIntervalBreaks _ (ClassifyLayer As ITable, FieldName As String, NumClasses As Long) As Double() ' 分類するための新規TableHistogramの作成 Dim pTableHistogram As ITableHistogram Dim pHistogram As IHistogram Set pTableHistogram = New TableHistogram Set pHistogram = pTableHistogram ' テーブルとフィールド・プロパティの割り当て Set pTableHistogram.Table = ClassifyLayer 'FeatureLayer:ITableをサポート pTableHistogram.Field = FieldName ' TableHistogramオブジェクトに値と頻度を設定 Dim vFrequency As Variant Dim vValues As Variant pHistogram.GetHistogram vValues, vFrequency ' 等間隔分類(EqualInterval)内の値を使用 Dim pClassify As IClassify Set pClassify = New EqualInterval pClassify.SetHistogramData vValues, vFrequency ' クラスの作成 pClassify.Classify NumClasses GetEqualIntervalBreaks = pClassify.ClassBreaks End Function
等間隔分類
2016/9/1 (木)