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;
}
GDAL中文件的驱动及对应的文件格式(转) https://blog.csdn.net/haojknm/article/details/5851968的更多相关文章
- js中index()的四种经典用法(转https://blog.csdn.net/superit401/article/details/51726826)
<!doctype html><html lang="en"> <head> <meta charset="UTF-8" ...
- 数组中&a与&a[0]的区别 转载自http://blog.csdn.net/FX677588/article/details/74857473
在探讨这个问题之前,我们首先来看一道笔试题,如下: [摘自牛客网]下列代码的结果是:(正确答案是 C) main() { int a[5]={1,2,3,4,5}; int *ptr=(int *)( ...
- 虚拟机中的CentOS7如何上网?---https://blog.csdn.net/nothing2017/article/details/61420767
虚拟机中的CentOS7如何上网?https://blog.csdn.net/nothing2017/article/details/61420767
- 向txt文件中写入内容(覆盖重写与在末尾续写+FileOutputStream与FileWriter)(转发:https://blog.csdn.net/bestcxx/article/details/51381460)
!!!! 读取txt文件中的内容 import java.io.BufferedReader; import java.io.File; import java.io.FileReader; /** ...
- 如何简单地理解Python中的if __name__ == '__main__'(https://blog.csdn.net/yjk13703623757/article/details/77918633)
1. 摘要 通俗的理解__name__ == '__main__':假如你叫小明.py,在朋友眼中,你是小明(__name__ == '小明'):在你自己眼中,你是你自己(__name__ == '_ ...
- 通信中的错误代码 (repost from https://blog.csdn.net/zzhuan_1/article/details/80066716)
• 100 - 继续.• 101 - 切换协议.• 110 重新启动标记答复.• 120 服务已就绪,在 nnn 分钟后开始.• 125 数据连接已打开,正在开始传输.• 150 文件状态正常,准备打 ...
- 比较C++中的4种类型转换方式(转自http://blog.csdn.net/hrbeuwhw/article/details/7884797)
C++的四种cast操作符的区别 Q:什么是C风格转换?什么是static_cast, dynamic_cast 以及 reinterpret_cast?区别是什么?为什么要注意? A:转换的含义是通 ...
- git中利用rebase来压缩多次提交 ----- 原文:https://blog.csdn.net/itfootball/article/details/44154121
之前我们用git merge –squash来将分支中多次提交合并到master后,只保留一次提交历史.但是有些提交到github远程仓库中的commit信息如何合并呢? 使用下面的命令,最后一个数字 ...
- golang中defer的详解 转自https://blog.csdn.net/skh2015java/article/details/77081250
Go里的defer很有用,尤其在很多执行模块化操作时,初始化时给各个需要执行的模块传入参数,但是这些参数有些事在模块执行过程中才赋值的. 这时候有了defer就不会把代码写的很凌乱. Go的defer ...
随机推荐
- 转 PV、TPS、QPS 计算方法
PV.TPS.QPS是怎么计算出来的? QPS = req/sec = 请求数/秒 [QPS计算PV和机器的方式] QPS统计方式 [一般使用 http_load 进行统计]QPS = 总请求数 ...
- POJ1611-The Suspects-并查集
记录元素个数的并查集. 利用sz数组保存并查集的大小.每次union时,把小的集合并到大的中去,并更新sz数组. #include <cstdio> #include <algori ...
- HDU4287-STL模拟水题
一场2012天津网络预选赛的题,签到题. 但是还是写了三四十分钟,C++和STL太不熟悉了,总是编译错误不知道怎么解决. 一开始用的Char [] 后来改成了string,STL和string搭配起来 ...
- windows service 安装/卸载
第一种方法: 前提: Service1 中的serviceProcessInstaller1设置 Account为localSystem 1. 开始 ->运行 ->cmd(管理员身份运行) ...
- 【 HDU - 4456 】Crowd (二维树状数组、cdq分治)
BUPT2017 wintertraining(15) #5A HDU 4456 题意 给你一个n行n列的格子,一开始每个格子值都是0.有M个操作,p=1为第一种操作,给格子(x,y)增加z.p=2为 ...
- 自学Aruba1.4-Aruba体系结构-产品线
点击返回:自学Aruba之路 1. Aruba产品线 IP switches: 1500.2500.3500 Controllers:7200 .70x0 Series.7005 Meridian:基 ...
- 【Luogu4723】线性递推(常系数齐次线性递推)
[Luogu4723]线性递推(常系数齐次线性递推) 题面 洛谷 题解 板子题QwQ,注意多项式除法那里每个多项式的系数,调了一天. #include<iostream> #include ...
- BZOJ 400题纪念
应该是最后一次纪念了吧! 想当年,我可是发过"BZOJ 10题纪念"的人--那时候(一年前?)的自己真的好菜啊,只能说掌握了c++的基础语法的样子.当时觉得省选级别的BZOJ题是世 ...
- EOJ2018.10 月赛(B 数学+思维题)
传送门:Problem B https://www.cnblogs.com/violet-acmer/p/9739115.html 题意: 找到最小的包含子序列a的序列s,并且序列s是 p -莫干山序 ...
- P1963 [NOI2009]变换序列
对于\(N\)个整数\(0, 1, \cdots, N-1,\)一个变换序列\(T\)可以将\(i\)变成\(T_i\),其中 \(T_i \in \{ 0,1,\cdots, N-1\}\)且 \( ...