标签:des style blog class code c
1、windows下的编译
1.1、解压后打开nmake.opt,设置GDAL_HOME
1.2、进入vs的command promot,进入正常的那个即可,64位的没试过,可以参考gdal官网
1.3、nmake /f makefile.vc
1.4、nmake /f makefile.vc install
1.5、nmake /f makefile.vc devinstall
2、打开文件
#include "gdal_priv.h" #include "cpl_conv.h" // for CPLMalloc() int main() { GDALDataset *poDataset; GDALAllRegister(); poDataset = (GDALDataset *) GDALOpen( pszFilename, GA_ReadOnly ); if( poDataset == NULL ) { ...; }
gdal中文路径的问题
adfGeoTransform[0] /* top left x */ adfGeoTransform[1] /* w-e pixel resolution */ adfGeoTransform[2] /* 0 */ adfGeoTransform[3] /* top left y */ adfGeoTransform[4] /* 0 */ adfGeoTransform[5] /* n-s pixel resolution (negative value) */
double adfGeoTransform[6]; printf( "Driver: %s/%s\n", poDataset->GetDriver()->GetDescription(), poDataset->GetDriver()->GetMetadataItem( GDAL_DMD_LONGNAME ) ); printf( "Size is %dx%dx%d\n", poDataset->GetRasterXSize(), poDataset->GetRasterYSize(), poDataset->GetRasterCount() ); if( poDataset->GetProjectionRef() != NULL ) printf( "Projection is `%s‘\n", poDataset->GetProjectionRef() ); if( poDataset->GetGeoTransform( adfGeoTransform ) == CE_None ) { printf( "Origin = (%.6f,%.6f)\n", adfGeoTransform[0], adfGeoTransform[3] ); printf( "Pixel Size = (%.6f,%.6f)\n", adfGeoTransform[1], adfGeoTransform[5] ); }
标签:des style blog class code c
原文地址:http://www.cnblogs.com/summerwinter/p/3735246.html