ArcEngine 获取HDF文件中的子文件
HDF格式,為影像常用的格式。里面有許多的子文件,在用AE打開(kāi)影像的時(shí)候,按照AE常規(guī)的方式打開(kāi)影像的方式是行不通的。先把HDF中需要的文件,提出來(lái),再按常規(guī)的打開(kāi)影像的方式打開(kāi)。下面代碼為提出HFD文件中的子集:
?
?
public IRasterDataset HDFSubdataset(IRasterDataset rasterDataset, int subsetID)
{
? //Some raster formats can contain multiple subdatasets inside a single file, for example the HDF format.
? //This sample code shows how one can retrieve the HDF subdatasets using the IRasterDatasetJukebox interface.
? //rasterDataset: represents a raster dataset from a HDF4 file
? IRasterDatasetJukebox hdfDataset= (IRasterDatasetJukebox)rasterDataset;
? IRasterDataset subDatasset;
? int datasetCount = hdfDataset.SubdatasetCount;
? if (subsetID < datasetCount)
??? {
???? hdfDataset.Subdataset = subsetID;
???? subDatasset = (IRasterDataset)hdfDataset;
???? return subDatasset;
??? }
? else { return rasterDataset; }
}
?
然后就打開(kāi)subDataset就可以了。。
轉(zhuǎn)載于:https://www.cnblogs.com/myyouthlife/archive/2012/03/07/2383492.html
總結(jié)
以上是生活随笔為你收集整理的ArcEngine 获取HDF文件中的子文件的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: C++的沉迷与爱恋——侯捷
- 下一篇: 推送通知服务【WP7学习札记之十三】