ラスター レイヤーの数値分類

ラスタの数値分類で設定する閾値はIRasterClassifyColorRampRenderer::Breakを使用する。閾値の範囲の下側の値を設定する。

.NET http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/d/000100000267000000.htm

Sub UsingRasterClassifyColorRampRenderer()
    'Get Map
    Dim pMxDoc As IMxDocument
    Set pMxDoc = ThisDocument
    Dim pMap As IMap
    Set pMap = pMxDoc.FocusMap
    
    'Get raster input from layer
    Dim pRLayer As IRasterLayer
    Set pRLayer = pMap.Layer(0)
    Dim pRaster As IRaster
    Set pRaster = pRLayer.Raster
    
    'Create classfy renderer and QI RasterRenderer interface
    Dim pClassRen As IRasterClassifyColorRampRenderer
    Set pClassRen = New RasterClassifyColorRampRenderer
    Dim pRasRen As IRasterRenderer
    Set pRasRen = pClassRen
    
    'Set raster for the render and update
    Set pRasRen.Raster = pRaster
    pClassRen.ClassCount = 3
    pRasRen.Update
    
    'Create a color ramp to use
    Dim pRamp As IAlgorithmicColorRamp
    Set pRamp = New AlgorithmicColorRamp
    pRamp.size = 3
    pRamp.CreateRamp True
    
    'Create symbol for the classes
    Dim pFSymbol As IFillSymbol
    Set pFSymbol = New SimpleFillSymbol
    
    'loop through the classes and apply the color and label
    Dim I As Integer
    For I = 0 To pClassRen.ClassCount - 1
        pFSymbol.Color = pRamp.Color(I)
        pClassRen.Symbol(I) = pFSymbol
        pClassRen.Label(I) = "Class" & CStr(I)
    Next I
    
    Dim pColor As IColor
    Set pColor = New RgbColor
    pColor.NullColor = True
    
    pFSymbol.Color = pColor
    pClassRen.Symbol(0) = pFSymbol
    
    pClassRen.Break(0) = -57
    pClassRen.Break(1) = 0
    pClassRen.Break(2) = 39
    
    'Update the renderer and plug into layer
    pRasRen.Update
    Set pRLayer.Renderer = pClassRen
    pMxDoc.ActiveView.Refresh
    pMxDoc.UpdateContents
    
    'Release memeory
    Set pMxDoc = Nothing
    Set pMap = Nothing
    Set pRLayer = Nothing
    Set pRaster = Nothing
    Set pRasRen = Nothing
    Set pClassRen = Nothing
    Set pRamp = Nothing
    Set pFSymbol = Nothing
End Sub