[gdal-dev] gdalbuilvrt and multiband files

Martin Lambers marlam at marlam.de
Tue Dec 6 16:17:32 EST 2011


The GTA driver supports all GDAL metadata, including projection etc. It
is stored in GTA tags. The gta tool will not touch it (unless you tell
it to by using the 'gta tag' command or edit it in the GUI). So in
this example the metadata ending up in the out*.gta files should be
the same as in the in*.gta files.

Martin


On Tue, 6 Dec 2011 18:25:37 -0200, Etienne Tourigny wrote:
> The idea looks pretty cool!
> 
> just curious: what happens to georeferencing data (projection and GT)
> and metadata when converting to (and from) GTA format?  What is the
> status of metadata support in the GDAL driver?
> 
> Etienne
> 
> On Tue, Dec 6, 2011 at 6:08 PM, Martin Lambers <marlam at marlam.de>
> wrote:
> > Hi Jose!
> >
> > On Tue, 6 Dec 2011 17:52:17 +0000, Jose Gomez-Dans wrote:
> >> I'm trying to build a VRT file out of a number of multiband files
> >> using gdalbuildvrt. Let's say I have N 7-band files, and I want
> >> build 7 N-band files (i.e., I want to stack all the bands in the
> >> same dataset). I have accomplished this thus far by having a prior
> >> step that creates a VRT for each individual band, and I then stack
> >> them using gdalbuildvrt -separate. However, i was wondering whether
> >> there's any more direct way of doing this? I guess that one way
> >> would be to build the XML file directly, but I was keen in finding
> >> some "shell-fu" way!
> >
> > This might be slightly offtopic, but if you are using the latest
> > GDAL from svn, you could try the brand new GTA driver to store your
> > files in GTA format. Then you can use the gta tool, which was made
> > for exactly this kind of generic array data manipulation:
> >
> > # loop over 7 bands, called 'components' in GTA
> > for j in `seq 0 6`; do
> >  # loop over N input files "in*.gta"
> >  for i in `seq 1 N`; do
> >    # extract the current component into its own file
> >    gta component-extract -k $j < in$i.gta > tmp$i.gta
> >  done
> >  # merge the extracted components into the output file
> >  gta component-merge tmp*.gta > out$j.gta
> >  rm tmp*.gta
> > done
> >
> > Not a pure GDAL solution, but plenty of shell-fu :)
> >
> > Martin
> > _______________________________________________
> > gdal-dev mailing list
> > gdal-dev at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/gdal-dev



More information about the gdal-dev mailing list