<div dir="ltr"><div><br><br>On Thu, Nov 10, 2016 at 10:02 AM, Sajid Pareeth <<a href="mailto:spareeth@gmail.com">spareeth@gmail.com</a>> wrote:<br>><br>> Hi all<br>><br>> I am exporting a group of rasters to single stacked GTiff and ENVI format files.<br>><br>> Here is my group:<br>> i.group S2A_OPER_MSI_L1C_TL_MTI__20160810T122618_A005911_T30SWJ_10m -l<br>> group <S2A_OPER_MSI_L1C_TL_MTI__20160810T122618_A005911_T30SWJ_10m> references the following raster maps<br>> -------------<br>> <S2A_OPER_MSI_L1C_TL_MTI__20160810T122618_A005911_T30SWJ_B02.jp2@barrax>   <br>> <S2A_OPER_MSI_L1C_TL_MTI__20160810T122618_A005911_T30SWJ_B03.jp2@barrax>   <br>> <S2A_OPER_MSI_L1C_TL_MTI__20160810T122618_A005911_T30SWJ_B04.jp2@barrax>   <br>> <S2A_OPER_MSI_L1C_TL_MTI__20160810T122618_A005911_T30SWJ_B08.jp2@barrax>   <br>> -------------<br>><br>> I use the following export command:<br>> r.out.gdal input=${BASE}_10m output="${MYDATA}/${FOLDER}Barrax/20m/${BASE}_10m" format=ENVI<br>><br>><br>> But the band names in the output ENVI or GTiff files are changed to "Band 1", "Band 2", "Band 3", "Band 4".<br>><br>> Is there any way to retain the original raster names for the individual bands in the final stacked image?<br>><br><br>In GDAL, raster bands do not have names, they are numbered. The name of each input  band could be used as description with GDALSetDescription() or the input name could also be stored as a band-specific metadata item. In any case, it depends on the output format if the input name can be used as description or for a band-specific metadata item. With GDALSetDescription(), gdalinfo would then report e.g.<br><br>Band 1 Block=1678x1 Type=Float64, ColorInterp=Gray<br>  Description = elev_state_500m<br><br></div>Other applications including r.in.gdal might not check for any band-specific description upon import.<br><div><br></div><div>Markus M<br></div><div><br></div></div>