Opened 13 years ago

Last modified 13 years ago

#1218 closed defect (fixed)

HDF4 driver and Hyperion driver

Reported by: warmerdam Owned by: warmerdam
Priority: high Milestone:
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords:
Cc:

Description

Attempting to read HDF4_SDS:HYPERION_L1:"EO1H0150332002121112PF.L1R":1
out of the following datset:

  ftp://edclpdsftp.cr.usgs.gov/E01/samples/EO1H0150332002121112PF.tar.gz

results in:
Driver: HDF4Image/HDF4 Dataset
Size is 0, 242
Coordinate System is `'
Metadata:
  File Type=Ground image
  L1 File Generated By=HYP version 1.1
  Time of L1 File Generation=Nov 24 18:26:26 2004
  EchoRatiofile=ratio_revB.dat
  Calibration Parameter File=HypGain_revC.dat.svf
  ImageStartTime=2002121153618.796
  File Byte Order=Big endian
  Interleave Format=BIL
  Frame Number Range=0, 3350
  Scene_ID=EO10150332002121112PF
  Level0 image filename=EO12002121_0FED0FEC_r1_LGS_01.L0
  Level0 Pre-Dark filename=EO12002121_0FEA0FE9_r1_LGS_01.L0
  Level0 Post-Dark filename=EO12002121_0FEF0FEE_r1_LGS_01.L0
  Dark Offset method [Trended | Predark | Postdark]=Trended
  Data Units=nanometers
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  242.0)
Upper Right (    0.0,    0.0)
Lower Right (    0.0,  242.0)
Center      (    0.0,  121.0)
ERROR 7: Assertion `nBlockXSize > 0 && nBlockYSize > 0' failed
in file `gdalrasterband.cpp', line 648

So there seems to be some sort of dimension determination problem.

Change History (2)

comment:1 Changed 13 years ago by dron

Frank,

That should be fixed now (more or less).

Regards,
Andrey

comment:2 Changed 13 years ago by warmerdam

I have confirmed the problem seems fixed.  The key parts of the patch are:

@@ -2372,9 +2375,18 @@
     if ( poDS->iSubdatasetType == HYPERION_L1 )
     {
         // XXX: Hyperion SDSs has Height x Bands x Width dimensions scheme
-        poDS->nBands = poDS->aiDimSizes[1];
-        poDS->nRasterXSize = poDS->aiDimSizes[2];
-        poDS->nRasterYSize = poDS->aiDimSizes[0];
+        if ( poDS->iRank > 2 )
+        {
+            poDS->nBands = poDS->aiDimSizes[1];
+            poDS->nRasterXSize = poDS->aiDimSizes[2];
+            poDS->nRasterYSize = poDS->aiDimSizes[0];
+        }
+        else
+        {
+            poDS->nBands = poDS->aiDimSizes[0];
+            poDS->nRasterXSize = poDS->aiDimSizes[1];
+            poDS->nRasterYSize = 1;
+        }
     }

Note: See TracTickets for help on using tickets.