[ArcGIS Engine]栅格数据处理 RasterDataset RasterLayer Raster RasterBandCollection

时间:2022-05-25 18:44:12

原文 http://www.cnblogs.com/zoe-j/archive/2012/03/22/2412403.html

1.由RasterLayer 得到RasterDataset

[ArcGIS Engine]栅格数据处理 RasterDataset RasterLayer Raster RasterBandCollection
  IRasterLayer myrasterlayer = MapControl.Map.Layer[index] as IRasterLayer;
IRaster myRaster = myrasterlayer.Raster;
IRasterBandCollection myRasterBandCollection = myRaster as IRasterBandCollection;
IRasterBand myRasterBand = myRasterBandCollection.Item();
IRasterDataset myRasterDataset = myRasterBand as IRasterDataset;
[ArcGIS Engine]栅格数据处理 RasterDataset RasterLayer Raster RasterBandCollection

2.由RasterDataset 到RasterLayer

  IRasterLayer pRasterLayer = new RasterLayerClass(); 

             pRasterLayer.CreateFromDataset(pRasterDataset); 

             axMapControl1.Map.AddLayer(pRasterLayer as ILayer); ;