[gdal-dev] HDF4 python add band
Luca Delucchi
lucadeluge at gmail.com
Sun Apr 27 22:58:44 PDT 2014
On 27 April 2014 11:20, Even Rouault <even.rouault at mines-paris.org> wrote:
> Luca,
>
Hi Even,
> very few drivers (and formats) support AddBand (the only ones are MEM and
> VRT), mostly because it would imply in most cases to completely rewrite the
> structure of what is already on disk.
>
ok,
> Currently, with current code, your only option is to specify the right number
> of bands at Create() time if you create a new HDF4Image from scratch.
Yes, my problem is that the different bands have different datatype
and I don't think it is possible to set different datatype in
Create(). Am I right?
> Or if you've an existing HDF4Image that would fit into memory, you could
> CreateCopy() it in a MEM dataset, AddBand() to the MEM dataset and fill it, and
> then CreateCopy() to a new HDF4Image.
>
Ok, so I could create a MEM dataset and fill it and at the end of my
process CreateCopy() to a new HDF4Image. (I'm merging several HDF in
one)
> But actually looking at the driver, I think it should be possible to implement
> AddBand() by a call to SDcreate(). At least in the case the dataset is a
> "GDAL_HDF4" one (i.e. created by GDAL initially).
>
Ok, should I open a ticket for this?
> Even
>
--
ciao
Luca
http://gis.cri.fmach.it/delucchi/
www.lucadelu.org
More information about the gdal-dev
mailing list