ラスターのコンバート

 2016/9/1 (木)    

Public Sub subExportRaster()
    '変換元ラスタ
    Dim pRasterLayer As IRasterLayer
    Set pRasterLayer = pMap.Layer(0)
     
    Dim pRaster As IRaster
    Set pRaster = pRasterLayer.Raster
     
    'RasterConversionOp
    Dim pConvrsionOp As IConversionOp
    Set pConvrsionOp = New RasterConversionOp
     
    Dim pRasterAnalysisEnvironment As IRasterAnalysisEnvironment
    Set pRasterAnalysisEnvironment = pConvrsionOp
     
    pRasterAnalysisEnvironment.SetCellSize esriRasterEnvValue, 1000
    pRasterAnalysisEnvironment.OutSpatialReference = pSpatialReference  '空間参照を用意
     
    'RasterWorkspaceを作成
    Dim pWorkspaceFactory As IWorkspaceFactory
    Set pWorkspaceFactory = New RasterWorkspaceFactory
     
    Dim pRasterWorkspace As IRasterWorkspace
    Set pRasterWorkspace = pWorkspaceFactory.OpenFromFile("D:\Workspace", 0)
     
    'ラスタのコンバート
    Dim pRasterDataset As IRasterDataset
    Set pRasterDataset = pConvrsionOp.ToRasterDataset(pGeoDataset, "IMAGINE Image", pRasterWorkspace, "OutRaster")
 
End Sub

Copyright© WINGFIELD since1981 , 2018 All Rights Reserved.