[Gdal-dev] gdal and hdf

Frank Warmerdam warmerdam at pobox.com
Mon Sep 4 12:43:58 EDT 2006


C.Strobl at dlr.de wrote:
--------------------------------------
>  
> #gdal_translate
> gdal_translate -of GTiff "E:\usgs\modis\subset_MOD02_243.1850.hdf" 
> e:\usgs\modis\subset_MOD02_243.1850.tif
> Input file contains subdatasets. Please, select one of them for reading.
>  
> --------------------------------------------------
>  
> analogue to the description given at 
> http://www.remotesensing.org/gdal/frmt_hdf4.html i tested gdalinfo for 
> subdatasets
>  
> 
> gdalinfo 
> HDF4_EOS:EOS_SWATH:E:\usgs\modis\subset_MOD02_243.1850.hdf:MODIS_SWATH_Type_L1B:EV_250_Aggr1km_RefSB

Christian,

I have just tested the FWTools 1.0.5 with a modis swath file and
it seemed to work ok.  I will note that FWTools 1.0.6 contains
some improvements with regard to swath handling.

I wasn't clear on what problems actually occured when you tried the
translations you reported on.

By the way, the easiest way to capture all the subdatasets out of an
HDF file is with the -sds option to gdal_translate.  This causes
it to produce one output file for each subdataset in the input file.

> --------------------------------------------------
>  
> there were the same problems i had already with the aster-files
...
> the problem: the second result-file i can't view with a normal image 
> software like irfanview or photoshop, but for example with erdas. ok, 
> thats not so important for me now. i think i make some mistake with the 
> syntax defining the datasubsets. maybe somebody can help me, maybe its a 
> windows special like ogr and vpf.

Potentially the problem is the use of band interleaved TIFF files.  You
could try adding the -co INTERLEAVE=PIXEL creation option on gdal_translate.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list