[gdal-dev] HDF4 trouble files

Joaquim Luis jluis at ualg.pt
Sun Nov 25 16:45:14 EST 2007


OK
Excuse me guys, it was a false error report. I was used to load the 
color files with no problem and I got hanged with the sst ones

... but I still have this other situation

This file reports 0s for all X's
http://oceancolor.gsfc.nasa.gov/cgi/getfile/S20061822006212.L3m_MO_L555_9.bz2
It may obviously be a file's internal error. but I have no way to tell it.

....
Corner Coordinates:
Upper Left  (       0.000,10018754.171) (  0d 0'0.01"E, 90d 0'0.00"N)
Lower Left  (       0.000,-10018754.171) (  0d 0'0.01"E, 90d 0'0.00"S)
Upper Right (       0.000,10018754.171) (  0d 0'0.01"E, 90d 0'0.00"N)
Lower Right (       0.000,-10018754.171) (  0d 0'0.01"E, 90d 0'0.00"S)
Center      (   0.0000000,   0.0000000) (  0d 0'0.01"E,  0d 0'0.01"N)

Joaquim

> Joaquim,
>
> Calling GetRasterCount from an HDF4 will always return 0 if you use 
> only the file name to open it. In order to "see" bands you need to 
> specify the subdataset string [http://www.gdal.org/frmt_hdf4.html] 
> when you open it. And in order to see the subdatasets list you need to 
> check the metadata, ex.: 
> [http://trac.osgeo.org/gdal/browser/trunk/gdal/apps/gdalinfo.c#L284]
>
> Best regards,
>
> Ivan
>
> Joaquim Luis wrote:
>> Hi
>>
>> I'm having troubles reading some of files available at
>> http://oceancolor.gsfc.nasa.gov
>> In particular the SST files but not the ocean color files.
>>
>> What is happening is that on the problematic files
>>
>> GDALGetRasterCount( hDataset );
>>
>> is returning 0, which is fatal to my gdalread mex file.
>>
>> Here is an example file
>> http://oceancolor.gsfc.nasa.gov/cgi/getfile/T20061822006212.L3m_MO_SST_9.bz2 
>>
>> Note that running gdalinfo on it does not print the
>> Band 1 Block= ...
>>
>> since that part of the code is inside a loop
>> for( iBand = 0; iBand < GDALGetRasterCount( hDataset ); iBand++ )
>>
>> and it's not executed since GDALGetRasterCount( hDataset ) == 0
>>
>>
>> Joaquim Luis
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>
>>
>
>



More information about the gdal-dev mailing list