[GRASS5] export RGB channels in one ERDAS/IMG file

Frank Warmerdam warmerdam at pobox.com
Thu Sep 2 09:39:33 EDT 2004

Markus Neteler wrote:
> Frank,
> this could be added easily. But I don't know how to tell 'gdal_translate'
> about it.
> The docs only mention single-file input:
> http://www.remotesensing.org/gdal/gdal_utilities.html#gdal_translate


gdal_translate doesn't support multiple input files. Holy cow! r.out.gdal
is just a script!  OK, that isn't news to you but it is to me.  I will add
writing a C r.out.gdal to my TODO list.

>>Given that it does not, it seems you might have to do this all rather
>>indirectly.  One approach is to output individual rasters and then composite
>>them with an external application like OpenEV or within Imagine itself.
> As I also need that functionality, I'll add it once I have understood
> the gdal_translate procedure...

In the meantime, I don't think it will be easy to do from within GRASS.

BTW, before I forgot that gdal_merge.py can stack input files into seperate
bands if given the -seperate switch.  So for anyone with a GDAL build that
includes python support you could export the various bands to standalone
files and then merge them into an RGB composite with:

   gdal_merge.py -o out.img -of HFA -seperate band1.img band2.img band3.img

Best regards,

I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

More information about the grass-dev mailing list