[gdal-dev] HDF4 python add band

Etienne Tourigny etourigny.dev at gmail.com
Sun Apr 27 23:40:49 PDT 2014


It might be easier to use dedicated software for this. No the same but
related, there are quite a few libraries out there for joining and editing
netcdf files, there is probably the same for hdf files.

cheers
Etienne


On Mon, Apr 28, 2014 at 2:58 AM, Luca Delucchi <lucadeluge at gmail.com> wrote:

> 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
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140428/886b7059/attachment.html>


More information about the gdal-dev mailing list