栅格数据处理 RasterDataset RasterLayer Raster RasterBandCollection

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

.由RasterLayer 得到RasterDataset

RasterLayer->RasterDataset
IRasterLayer myrasterlayer = MapControl.Map.Layer[index] as IRasterLayer;
IRaster myRaster = myrasterlayer.Raster;
IRasterBandCollection myRasterBandCollection = myRaster as IRasterBandCollection;
IRasterBand myRasterBand = myRasterBandCollection.Item(0);
IRasterDataset myRasterDataset = myRasterBand as IRasterDataset;

2.由RasterDataset 到RasterLayer

1  IRasterLayer pRasterLayer = new RasterLayerClass(); 
2
3 pRasterLayer.CreateFromDataset(pRasterDataset);
4
5 axMapControl1.Map.AddLayer(pRasterLayer as ILayer); ;
1  IRasterLayer pRasterLayer = new RasterLayerClass(); 
2
3 pRasterLayer.CreateFromDataset(pRasterDataset);
4
5 axMapControl1.Map.AddLayer(pRasterLayer as ILayer); ;
上一篇:C++编程练习(4)----“实现简单的栈的链式存储结构“


下一篇:php求数组中最大值