Opened 10 years ago

Closed 3 years ago

#4403 closed defect (wontfix)

Compact layers in HDF4 files break gdal_translate

Reported by: simonf Owned by: warmerdam
Priority: normal Milestone: closed_because_of_github_migration
Component: default Version: unspecified
Severity: normal Keywords:


Compact layers are occasionally present in the HDF4 MODIS files produced by LPDAAC. See section 4.2 on page 34 in

Compact data is written to one-dimensional SDSs in observation order; that is, all the additional observations for row 0, column 0 are written, then all additional observations for row 0, column 1, and so on. If a pixel has no additional observations, nothing is written to the compact SDS for that pixel. The number of additional observations written to the compact data at each pixel is stored in the 2-dimensional SDS 'num_observations'.

As explained by LPDAAC staff: "Most MOD09GA have 21 layers. These have 42 layers inside the HDF files. They are named the same as the original 21 only each has a -c at the end. These stand for compact, and the data in these files are data from additional passes."


Running this: gdal_translate HDF4_EOS:EOS_GRID:"/tmp/MOD09GQ.A2011342.h22v09.005.2011344054617.hdf":MODIS_Grid_2D:sur_refl_b02_1 /tmp/a

produces: Input file size is 4800, 4800 0ERROR 1: GDreadfield() failed for block. ERROR 1: IReadBlock failed at X offset 0, Y offset 320 ERROR 1: GetBlockRef? failed at X block offset 0, Y block offset 320

This is still a problem with 1.8.1

Change History (1)

comment:1 Changed 3 years ago by Even Rouault

Milestone: closed_because_of_github_migration
Resolution: wontfix
Status: newclosed

This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub?. If you believe this ticket is still valid, you may file it to if it is not already reported there.

Note: See TracTickets for help on using tickets.