AW: [Gdal-dev] gdal and hdf

C.Strobl at dlr.de C.Strobl at dlr.de
Wed Sep 6 11:38:31 EDT 2006


hello frank,
thank you for your fast answer. the -sds option works fine, i didn't see it, because i searched mainly at the hdf-description-page.
my problem was the specification of subdatasets. i think its only a matter of syntax, maybe double quotes or not, ...its always a little bit different with windows, also for example with ogr and vpf. there only the subdataset must be double quoted
its still interesting for me, because sometimes its more usefull to extract only subdatasets
thanks
christian
  

-----Ursprüngliche Nachricht-----
Von: Frank Warmerdam [mailto:warmerdam at pobox.com] 
Gesendet: Montag, 4. September 2006 18:44
An: Strobl, Christian
Cc: gdal-dev at lists.maptools.org
Betreff: Re: [Gdal-dev] gdal and hdf

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