zoukankan      html  css  js  c++  java
  • ArcEngine 获取HDF文件中的子文件

    HDF格式,为影像常用的格式。里面有许多的子文件,在用AE打开影像的时候,按照AE常规的方式打开影像的方式是行不通的。先把HDF中需要的文件,提出来,再按常规的打开影像的方式打开。下面代码为提出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; }
    }

    然后就打开subDataset就可以了。。

  • 相关阅读:
    聪明人 & 普通人
    13种模型及方法论
    面向大规模商业系统的数据库设计和实践
    分治算法
    软件架构
    隐含前提思维模型
    Git回滚代码到某个commit
    使用arthas排查 test 问题
    Arthas
    docker 操作入门
  • 原文地址:https://www.cnblogs.com/myyouthlife/p/2383492.html
Copyright © 2011-2022 走看看