[Gdal-dev] translating HDF4 to netCDF, HDF in --formats, but translate says "unsupported"

Andrey Kiselev dron at ak4719.spb.edu
Wed Oct 3 02:02:35 EDT 2007


On Tue, Oct 02, 2007 at 03:47:03PM -0500, Edward Fialkowski wrote:
> Yep, someone totally gave me some bad files.  Both of them that were
> given to me were bad, so now I went and got another 19 mb file, which
> is recognized.
> 
> I'm really sorry to take the time on simply a bad file.
> 
> Unfortunately, though, I'm not quite ready for translation, so now I
> really need some help.
> 
> [root at niceguy apps]# ./gdal_translate -of netCDF no2track20060101.hdf
> no2track20060101.nc
> 
> Input file size is 512, 512
> Input file has no bands, and so cannot be translated.
> 
> no bands?  I'm  completely unfamiliar with HDF, but from what limited
> I know of bands, I can't see why it's stopping the translation.

HDF file can contain multiple images with different sizes and
parameters, so usually we can't translate it directly. Such complex
container will be represented in GDAL via subdataset abstraction. You
should run gdalinfo on input file to get a list of subdatasets and later
translate each individual subdataset. Here you can find an example:

 http://www.gdal.org/frmt_hdf4.html

Also it is possible that GDAL does not understand the file contents (HDF
is a quite complicated thing for automatic processing). In this case I
will need a file itself to diagnose the problem.

Best regards,
Andrey

-- 
Andrey V. Kiselev
ICQ# 26871517



More information about the Gdal-dev mailing list