<P>Hi, I'm not quite sure about what you need to analyze the problem. But I will write down all details which I consider helpful.</P>
<P>I build all dlls (gdal_HDF5.dll, gdal_HDF5Image.dll), add C:\gdal\gdal162\bld\bin as system variable.</P>
<P>Then I reset VS2008 as VC++ with default settings, add C:\gdal\gdal162\bld\include and C:\gdal\gdal162\bld\lib to the project.</P>
<P>The sample datas are supplied as part of software package. Theit file structures are below read out by The HDF hdfview 2.5.</P>
<P>-----------Structure of sample data from hdfview 2.5----------------<BR>C:\Program Files\thg\hdfview 2.5\samples\hdf5_test.h5<BR>+hdf5_test.h5<BR> +A note<BR> +arrays<BR> -1D String<BR> -2D float array<BR> -2D int array<BR> -3D int array<BR> -ArrayOfStructures<BR> -Vdata with mixed types<BR> +datatypes<BR> -H5_NATIVE_INT<BR> +images<BR> -3D THG<BR> -Iceberg<BR> -hst_lagoon_detail.jpg<BR> -ice interlace<BR> -pixel interlace<BR> -plane interlace</P>
<P><BR>-----------Structure of sample data from Envi 4.3----------------<BR>D:\RSI\IDL63\examples\data\hdf5_test.h5<BR>+hdf5_test.h5<BR> -2D int array<BR> -A note<BR> -SL to 3D int array<BR> +arrays<BR> -2D float array<BR> -2D int array<BR> -3D int array<BR> -Vdata with mixed types<BR> +datatypes<BR> -A Native float datatype<BR> -A String datatype<BR> -Air pressure<BR> +images<BR> -Eskimo<BR> -Eskimo_palette<BR> -Iceberg<BR> -Iceberg_palette<BR> +links<BR> +hard links<BR> -Eskimo<BR> -RGB values<BR> -loop back to links<BR> +soft links<BR> -2D float array</P>
<P><BR>-------------------------the code that I write in VS2008 ------------------------<BR>#include <iostream><BR>#include <stdio.h></P>
<P>#include "gdal_priv.h"<BR>#pragma comment(lib,"gdal_i.lib")</P>
<P>using std::cout;<BR>using std::endl;</P>
<P>int main()<BR>{<BR> GDALAllRegister();</P>
<P> const char* filename="D:\\RSI\\IDL63\\examples\\data\\hdf5_test.h5";<BR> //const char* filename="C:\\Program Files\\thg\\hdfview 2.5\\samples\\hdf5_test.h5";</P>
<P> const char* pszFormat="HDF5";<BR> GDALDriver *poDriver = GetGDALDriverManager()->GetDriverByName(pszFormat);<BR> <BR> if( poDriver != NULL )<BR> {<BR> cout<<pszFormat<<" format is supported!"<<endl;<BR> }<BR> else<BR> {<BR> cout<<"Gdal do not support "<<pszFormat<<"."<<endl;<BR> }</P>
<P> GDALDataset *poDataset; <BR> poDataset= (GDALDataset *) GDALOpen( filename, GA_ReadOnly);<BR> <BR> if(poDataset == NULL)<BR> {<BR> cout<<"error!";<BR> return 0;<BR> }<BR> else<BR> {<BR> //***************************************************************//<BR> double adfGeoTransform[6];<BR> <BR> printf( "Driver: %s/%s\n",<BR> poDataset->GetDriver()->GetDescription(), <BR> poDataset->GetDriver()->GetMetadataItem( GDAL_DMD_LONGNAME ) );<BR> <BR> printf( "Size is %dx%dx%d\n", <BR> poDataset->GetRasterXSize(), poDataset->GetRasterYSize(),<BR> poDataset->GetRasterCount() );<BR> <BR> if( poDataset->GetProjectionRef() != NULL )<BR> printf( "Projection is '%s'\n", poDataset->GetProjectionRef() );<BR> <BR> if( poDataset->GetGeoTransform( adfGeoTransform ) == CE_None )<BR> {<BR> printf( "Origin = (%.6f,%.6f)\n",<BR> adfGeoTransform[0], adfGeoTransform[3] );<BR> <BR> printf( "Pixel Size = (%.6f,%.6f)\n",<BR> adfGeoTransform[1], adfGeoTransform[5] );<BR> }<BR> }<BR> <BR> GDALClose(poDataset);<BR> return 0;<BR>}</P><br><br><span title="neteasefooter"/><hr/>
<a href="http://www.yeah.net/?from=footer">没有广告的终身免费邮箱,www.yeah.net</a>
</span>