1

I am performing Raster-> Miscellaneous-> Merge tool using QGIS version 3.16.11 to merge approximately fourteen Landsat8 OLI images. These images are stacked using Bands2-7 and while create the mosaic of these images. The GDAL command output showing an error:

**GDAL command output:**
ERROR 6: D:/SatelliteData/Merge_data/LC08_Sindh_Mosaic2016.tif, band 1: SetColorTable() not supported for multi-sample TIFF files.

Any idea how we can resolve this issue. I am working on a landcover project. Can I go with the output as it is generated a raster with this error?

Here is the total log file of Merge:

QGIS version: 3.16.11-Hannover
QGIS code revision: 26cc1c76
Qt version: 5.15.2
GDAL version: 3.3.1
GEOS version: 3.9.1-CAPI-1.14.2
PROJ version: Rel. 8.1.1, September 1st, 2021

Processing algorithm…

Algorithm 'Merge' starting…

Input parameters:

{ 'DATA_TYPE' : 5, 'EXTRA' : '', 'INPUT' : ['D:/SatelliteData/Sindh 2016/LC08_L2SP_150042_20161024_20200905_02_T1/Stacked/LC08_L2SP_150042_20161024_20200905_02_T1_SR_Bstack_raster.tif','D:/SatelliteData/Sindh 2016/LC08_L2SP_150043_20161008_20200906_02_T1/Stacked/LC08_L2SP_150043_20161008_20200906_02_T1_SR_Bstack_raster.tif','D:/SatelliteData/Sindh 2016/LC08_L2SP_151040_20161015_20200905_02_T1/Stacked/LC08_L2SP_151040_20161015_20200905_02_T1_SR_Bstack_raster.tif','D:/SatelliteData/Sindh 2016/LC08_L2SP_151041_20161015_20200905_02_T1/Stacked/LC08_L2SP_151041_20161015_20200905_02_T1_SR_Bstack_raster.tif','D:/SatelliteData/Sindh 2016/LC08_L2SP_151042_20161015_20200905_02_T1/Stacked/LC08_L2SP_151042_20161015_20200905_02_T1_SR_Bstack_raster.tif','D:/SatelliteData/Sindh 2016/LC08_L2SP_151043_20161015_20200905_02_T1/Stacked/LC08_L2SP_151043_20161015_20200905_02_T1_SR_Bstack_raster.tif','D:/SatelliteData/Sindh 2016/LC08_L2SP_152040_20161006_20200906_02_T1/Stacked/LC08_L2SP_152040_20161006_20200906_02_T1_SR_Bstack_raster.tif','D:/SatelliteData/Sindh 2016/LC08_L2SP_152041_20161006_20200906_02_T1/Stacked/LC08_L2SP_152041_20161006_20200906_02_T1_SR_Bstack_raster.tif','D:/SatelliteData/Sindh 2016/LC08_L2SP_152042_20161006_20200906_02_T1/Stacked/LC08_L2SP_152042_20161006_20200906_02_T1_SR_Bstack_raster.tif','D:/SatelliteData/Sindh 2016/LC08_L2SP_152043_20170110_20200905_02_T1/Stacked/LC08_L2SP_152043_20170110_20200905_02_T1_SR_Bstack_raster.tif','D:/SatelliteData/Sindh 2016/LC08_L2SP_153040_20161013_20200905_02_T1/Stacked/LC08_L2SP_153040_20161013_20200905_02_T1_SR_Bstack_raster.tif','D:/SatelliteData/Sindh 2016/LC08_L2SP_153041_20161013_20200905_02_T1/Stacked/LC08_L2SP_153041_20161013_20200905_02_T1_SR_Bstack_raster.tif','D:/SatelliteData/Sindh 2016/LC08_L2SP_153042_20161013_20200905_02_T1/Stacked/LC08_L2SP_153042_20161013_20200905_02_T1_SR_Bstack_raster.tif','D:/SatelliteData/Sindh 2016/LC08_L2SP_153043_20170202_20200905_02_T1/Stacked/LC08_L2SP_153043_20170202_20200905_02_T1_SR_Bstack_Reproj.tif'], 'NODATA_INPUT' : None, 'NODATA_OUTPUT' : -1, 'OPTIONS' : '', 'OUTPUT' : 'D:/SatelliteData/Merge_data/LC08_Sindh_Mosaic2016.tif', 'PCT' : True, 'SEPARATE' : False }



GDAL command:

gdal_merge.bat -pct -a_nodata -1 -ot Float32 -of GTiff -o D:/SatelliteData/Merge_data/LC08_Sindh_Mosaic2016.tif --optfile C:/Users/WWF-Pakistan/AppData/Local/Temp/processing_IeotZk/11f0c2c0bd2848a896d227be23a53105/mergeInputFiles.txt

GDAL command output:

ERROR 6: D:/SatelliteData/Merge_data/LC08_Sindh_Mosaic2016.tif, band 1: SetColorTable() not supported for multi-sample TIFF files.
2
  • 1
    Using the merge tool you can only extend the geographic extents of rasters which have the same config. Do you want to sum up the bands too?
    – Ash
    Oct 16, 2021 at 6:58
  • Yes I need to sum up the bands too as all these rasters have the same config
    – Shumaill
    Oct 21, 2021 at 11:26

1 Answer 1

1

You can do this via a script:

1- Import the modules

2- Import the rasters

3- Get their band:

band_raster_1 = ds_raster_1.GetRasterBand(1)

band_raster_n = ds_raster_n.GetRasterBand(1)

and so on...

4 - then sum the bands together:

band_merged = band_raster_1 + band_raster_2 + band_raster_3 + ... + band_raster_n

And it's done.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.