zoukankan      html  css  js  c++  java
  • GDAL中文件的驱动及对应的文件格式(转) https://blog.csdn.net/haojknm/article/details/5851968

    GDALDriver * poDriver;  
    char *pszFormat=GetOutimgInfo(m_strInput);  
    poDriver = GetGDALDriverManager()->GetDriverByName(pszFormat);  
    char* GetOutimgInfo(CString& Outimg)  
    {  
        // GDAL 内部对各种格式自定义的表示符  
        char *pszFileSName[]={  
            "VRT",//: Virtual Raster  
                "GTiff",//: GeoTIFF  
                "NITF",//: National Imagery Transmission Format  
                "HFA",//: Erdas Imagine Images (.img)  
                "ELAS",//: ELAS  
                "AAIGrid",//: Arc/Info ASCII Grid  
                "DTED",//: DTED Elevation Raster  
                "PNG",//: Portable Network Graphics  
                "JPEG",//: JPEG JFIF  
                "MEM",//: In Memory Raster  
                "GIF",//: Graphics Interchange Format (.gif)  
                "BSB",//: Maptech BSB Nautical Charts  
                "XPM",//: X11 PixMap Format  
                "BMP",//: MS Windows Device Independent Bitmap  
                "PCIDSK",//: PCIDSK Database File  
                "HDF4Image",//: HDF4 Dataset  
                "PNM",//: Portable Pixmap Format (netpbm)  
                "ENVI",//: ENVI .hdr Labelled  
                "EHdr",//: ESRI .hdr Labelled  
                "PAux",//: PCI .aux Labelled  
                "MFF",//: Atlantis MFF Raster  
                "MFF2",//: Atlantis MFF2 (HKV) Raster  
                "BT",//: VTP .bt (Binary Terrain) 1.3 Format  
                "FIT",//: FIT Image  
                "OTHER"};  
              
            ///// 各种文件格式的后缀  
            char * pszFileExt[]={  
                ".vrt",//: Virtual Raster  
                    ".tif",//: GeoTIFF  
                    "????",//: National Imagery Transmission Format  
                    ".img",//: Erdas Imagine Images (.img)  
                    "????",//: ELAS  
                    "????",//: Arc/Info ASCII Grid  
                    "????",//: DTED Elevation Raster  
                    ".png",//: Portable Network Graphics  
                    ".jpg",//: JPEG JFIF  
                    "????",//: In Memory Raster  
                    ".gif",//: Graphics Interchange Format (.gif)  
                    "????",//: Maptech BSB Nautical Charts  
                    "????",//: X11 PixMap Format  
                    ".bmp",//: MS Windows Device Independent Bitmap  
                    "????",//: PCIDSK Database File  
                    ".hdf",//: HDF4 Dataset  
                    "????",//: Portable Pixmap Format (netpbm)  
                    ".hdr",//: ENVI .hdr Labelled  
                    "????",//: ESRI .hdr Labelled  
                    ".pix",//: PCI .aux Labelled  
                    "????",//: Atlantis MFF Raster  
                    "????",//: Atlantis MFF2 (HKV) Raster  
                    "????",//: VTP .bt (Binary Terrain) 1.3 Format  
                    "????",//: FIT Image  
                    ".other"};  
                  
                /// 得到字符串的最后四个字符  
                CString OutFilename = Outimg;  
                OutFilename.TrimRight();  
                CString pszExt = OutFilename.Right(4);  
                  
                char *pszFormat = "GTiff";    
                int loop=0;  
                while(strcmp(pszFileSName[loop],"OTHER") != 0)  
                {  
                    if(pszExt.CompareNoCase(pszFileExt[loop]) == 0)       
                    {  
                        pszFormat = pszFileSName[loop];  
                        break;//    
                    }  
                    loop++;  
                }  
                return pszFormat;  
    }  
    
  • 相关阅读:
    在eclipse中如何在大量项目中查找指定文件
    字体图标使用笔记
    微信扫码显示特效
    Flex 布局教程:实例篇
    Flex 布局教程:语法篇
    12月份前端资源分享
    什么样的技术能活下来?该如何筛选繁复的框架和工具
    web前端知识在乱花渐欲迷人眼的当下,如何分清主次和学习优先级呢?
    2015前端生态发展回顾(转)
    HDU1507 Uncle Tom's Inherited Land*
  • 原文地址:https://www.cnblogs.com/abella/p/9596211.html
Copyright © 2011-2022 走看看