Opened 11 years ago

Closed 8 years ago

#4672 closed defect (fixed)

HDF4 read incorrectly

Reported by: cmutel Owned by: warmerdam
Priority: normal Milestone:
Component: GDAL_Raster Version: 1.9.0
Severity: normal Keywords: hdf4
Cc: etourigny


GDAL reads some HDF4 subdatasets incorrectly (which other utilities such as HDFlook can process without problems).

GDAL interprets the bottom third of the image correctly, the next upper half is filled with the nodata value, and then a different selection from the image is repeated four times across the top fifth of the image (see attached). Sample dataset which shows this problem is also attached; other similar datasets can be downloaded at (data from MODIS on evapotranspiration).

Problem seen with Mac (10.6) 64-bit and Linux 64-bit with GDAL 1.9.0.

Attachments (2)

MOD16A2.A2000M01.h14v02.105.2010357183410.hdf (918.6 KB ) - added by cmutel 11 years ago.
Dataset read incorrectly
hdf4-read-incorrectly.png (180.3 KB ) - added by cmutel 11 years ago.
Illustration of incorrect read

Download all attachments as: .zip

Change History (6)

by cmutel, 11 years ago

Dataset read incorrectly

by cmutel, 11 years ago

Attachment: hdf4-read-incorrectly.png added

Illustration of incorrect read

comment:1 by warmerdam, 11 years ago

Cc: etourigny added
Component: defaultGDAL_Raster
Status: newassigned

The problem is the HDF4 grid code using the tile API when it isn't working on tile sized chunks. It isn't clear how far back things have been broken.

I have made a fix for this in trunk (r24447) and 1.9 branch (r24448). It may be though that the logic for picking a block size ought to be more tile-size-friendly.

Unfortunately the fix will not likely be in 1.9.1.

comment:2 by Even Rouault, 11 years ago

r24449 /trunk/autotest/gcore/ Test that non-tiled access works (#4672)

comment:3 by etourigny, 11 years ago

That was fast! I noticed that when passed to the netcdf driver, the values are ok but there is no projection.

The fix works for me (trunk). Any workaround that could work, as it probably won't make it to 1.9.1?

comment:4 by Even Rouault, 8 years ago

Resolution: fixed
Status: assignedclosed

Looks like the issue was solved

Note: See TracTickets for help on using tickets.