logo       

esri .hdr open problem; minor hdf4 channels issue: msg#00153

gis.gdal.devel

Subject: esri .hdr open problem; minor hdf4 channels issue

Well, here's an ESRI header file for a dataset that is giving us
problems; when reading through GDAL, all channels appear identical to
the first one. Could it be because BANDGAPBYTES==0?

Also, HDF4 datasets with 3D SDS sometimes open blatantly wrong: e.g. a
6000x3x6000 SDS opened as 6000 bands, each of size 3x6000. This one
seems to be pretty easy to correct, here are the changes we've made to
hdf4dataset.cpp:

/* --------------------------------------------------------------------
*/
/* Select SDS or GR for reading from.
*/
/* --------------------------------------------------------------------
*/ ...
// Create band information objects.
switch( poDS->iRank ) { case 2:
poDS->nBands = 1;
poDS->iXDim = 1;
poDS->iYDim = 0;
break;

case 3:
// BIP
if((poDS->aiDimSizes[0] < poDS->aiDimSizes[1]) &&
(poDS->aiDimSizes[0] < poDS->aiDimSizes[2]) )
{
poDS->iBandDim = 0;
poDS->iYDim = 1;
poDS->iXDim = 2;
}
else
{
// BIL
if((poDS->aiDimSizes[1] <= poDS->aiDimSizes[0]) &&
(poDS->aiDimSizes[1] <= poDS->aiDimSizes[2]) )
{
poDS->iYDim = 0;
poDS->iBandDim = 1;
poDS->iXDim = 2;
}
else
{ // BSQ
poDS->iYDim = 0;
poDS->iXDim = 1;
poDS->iBandDim = 2;

}
}

Vladimir Slepnev
Programmer, RDC ScanEx

Attachment: image.HDR.txt
Description: Text document

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise