[Gdal-dev] esri .hdr open problem; minor hdf4 channels issue

Andrey Kiselev dron at ak4719.spb.edu
Fri Sep 26 16:58:33 EDT 2003


On Fri, Sep 26, 2003 at 10:41:59AM +0400, Vladimir Slepnev wrote:
> 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:
...
> 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,

I'm not sure it is a good solution... But well, I shall commit proposed
logic into the driver. There is much of unnatural intellect in the HDF4
driver already, not a problem if we add a bit more :-)

					Regards,
					Andrey


-- 
Andrey V. Kiselev
Home phone:  +7 812 5274898  ICQ# 26871517



More information about the Gdal-dev mailing list