I want to produce a set of VRTs (GDAL's internal virtual rasters) that comprise a re-arrangement of bands of a number of individual GeoTIFF files. Say I have my initial set of GeTIFF files, all having 4 bands:
file_01: band_01...band_04 file_02: band_01...band_04 file_03: band_01...band_04 file_04: band_01...band_04 file_05: band_01...band_04
And what I want to have is
vrt_01: file_01:band_01 file_02:band_01 file_03:band_01 file_04:band_01 file_05:band_01 vrt_02: file_01:band_02 file_02:band_02 file_03:band_02 file_04:band_02 file_05:band_02 vrt_03: file_01:band_03 file_03:band_03 file_03:band_04 file_04:band_03 file_05:band_03 vrt_04: file_01:band_04 file_04:band_04 file_03:band_04 file_04:band_04 file_05:band_04
My initial thoughts were:
gdalbuildvrt, creating an "file of files", but I don't think you can specify a particular band, just filenames
gdal_translateto create VRTs of the individual bands for each file, then proceed as in (1) above, but that looks like far too much effort.
I'd like to avoid creating the XML file myself because I find that that is quite error prone and requires quite a bit of debugging (they can all have different extents, etc etc etc)