資源簡介
GDAL讀取tiff圖像,需要配置GDAL庫。GDAL的基本用法。
代碼片段和文件信息
#include?“gdal.h“?
#include
#include?
#include?“cpl_string.h“??
/*#include
#include
#include
#include*/
int?main()?
{?
????
GDALDatasetH????hDataset;?
GDALDriverH?????hDriver;
GDALDriverH?hDriver1;
GDALRasterBandH?hBand;?
unsigned?short?*pafScanline;?
unsigned?char?*pafScanline1;?
????int?nXSizenYSize;
????int?nnij;
?//打開文件
????GDALAllRegister();
????hDataset?=?GDALOpen(?“map.tif“?GA_ReadOnly?);?
????if(?hDataset?==?NULL?)?
????return?1;?
?
????hDriver?=?GDALGetDatasetDriver(?hDataset?);?
????printf(?“Driver:?%s/%s\n“?
????????????GDALGetDriverShortName(?hDriver?)?
????????????GDALGetDriverLongName(?hDriver?)?);?
?
????printf(?“Size?is?%dx%dx%d\n“?
????????????GDALGetRasterXSiz
- 上一篇:信息系統的屬性約簡算法
- 下一篇:華中科技大學編譯原理實驗
評論
共有 條評論