4

I recently downloaded QGIS 3.10 and am trying to merge several raster DEM .tif files via the Ratser tab > miscellaneous > merge. I tried several output data types like Float32, Int16, and Byte, and high and low compression profiles but they all yield the same error message: "The following layers were not correctly generated (insert layer name). You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm." I am not sure where to find this information or what it means. Do I need to install a plugin to run it? What can I do to make this command run successfully?

3
  • The message that contains phrase insert layer name seems to tell that you have not given a valid name for the output file.
    – user30184
    Commented Mar 13, 2020 at 8:50
  • I did name the layer I just didn’t include the specific name in my question. Thank you for your answer though!
    – Mads
    Commented Mar 14, 2020 at 3:06
  • This issue is still not resolved. After opening Raster > Miscellaneous > Merge and then selecting the ... for Input Files, at this point, no matter what you select or do not select, the whole dialog will close and go back to the main QGIS project screen, as if nothing has happened. Commented Apr 16, 2020 at 12:30

2 Answers 2

3

May be different reasons about why you can't merge them. Most of them can be deducted from the complete error message, not just the end part.

About the end part, it is just saying that you can find that log in the Log Messages panel (View ~> Panels ~> Log Messages), generally in the Proccesing Tab. But the text in the Log tab of the processing window is the same as the text logged in the Proccesing tab of the Log Messages panel.

For instance, check this Log:

QGIS version: 3.10.3-A Coruña
QGIS code revision: 0e1f846438
Qt version: 5.11.2
GDAL version: 3.0.4
GEOS version: 3.8.0-CAPI-1.13.1 
PROJ version: Rel. 6.3.1, February 10th, 2020
Processing algorithm…
Algorithm 'Merge' starting…
Input parameters:
{ 'DATA_TYPE' : 5, 'EXTRA' : '', 'INPUT' : '', 'NODATA_INPUT' : None, 'NODATA_OUTPUT' : None, 'OPTIONS' : '', 'OUTPUT' : 'TEMPORARY_OUTPUT', 'PCT' : False, 'SEPARATE' : False }

GDAL command:
python3 -m gdal_merge -ot Float32 -of GTiff -o C:/Users/Gabriel/AppData/Local/Temp/processing_7b398423d55540609fc7426a5b406a0b/processing_ef4d9c14a2ca4bf08bd09c0d1c53d5e4/0dcfa065d9f440fcb971f60d43f55e01/OUTPUT.tif --optfile C:/Users/Gabriel/AppData/Local/Temp/processing_7b398423d55540609fc7426a5b406a0b/processing_ef4d9c14a2ca4bf08bd09c0d1c53d5e4/47fa46a83f0647018e0d6704bab4c501/mergeInputFiles.txt
GDAL command output:
No input files selected.

Usage: gdal_merge.py [-o out_filename] [-of out_format] [-co NAME=VALUE]*

[-ps pixelsize_x pixelsize_y] [-tap] [-separate] [-q] [-v] [-pct]

[-ul_lr ulx uly lrx lry] [-init "value [value...]"]

[-n nodata_value] [-a_nodata output_nodata_value]

[-ot datatype] [-createonly] input_files

[--help-general]



Execution completed in 0.43 seconds
Results:
{'OUTPUT': 'C:/Users/Gabriel/AppData/Local/Temp/processing_7b398423d55540609fc7426a5b406a0b/processing_ef4d9c14a2ca4bf08bd09c0d1c53d5e4/0dcfa065d9f440fcb971f60d43f55e01/OUTPUT.tif'}

Loading resulting layers
The following layers were not correctly generated.<ul><li>C:/Users/Gabriel/AppData/Local/Temp/processing_7b398423d55540609fc7426a5b406a0b/processing_ef4d9c14a2ca4bf08bd09c0d1c53d5e4/0dcfa065d9f440fcb971f60d43f55e01/OUTPUT.tif</li></ul>You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.

It have the same last part, but the error is described before, at:

GDAL command output:
No input files selected.

I have just opened the process and press Run without selecting any input layer ...

1
  • Thank you, I just checked the log and it came up with a message saying "No module named gdal_merge." There is a similar link on reddit: reddit.com/r/QGIS/comments/ed6fky/… so I know someone else is also facing the same issue. Appreciate all the help!
    – Mads
    Commented Mar 14, 2020 at 4:01
2

Have you considered creating a virtual raster of the DEM? I use this often when combining 1 sq.km tiles of LiDAR data. You can then use the virtual raster like any other raster, or save it as a new (but very large) single raster file.

To create a virtual raster go to Raster > Miscellaneous > Build Virtual Raster

Select the DEMs to be joined in ‘Input Layers’. Uncheck ‘Place each input file into a separate band’, as you will want the DEM to be a single band. Check ‘Allow projection difference’ if your DEMs are projected in different Coordinate Reference Systems (CRS). Choose ‘Overide projection...’ if you want the virtual raster projected in a specific CRS. Choose which resampling algorithm you want – I generally use the default Nearest Neighbour. The rest of the fields are optional. I would recommend saving the virtual raster [file ending .vrt] to the same folder as the DEMs. When this is executed, you will have a virtual raster file which is small, but behaves like single DEM file which you can use for geospatial analysis, 3D views, creating contours etc. You can save this virtual raster as a single raster file if you really want, but be warned the resulting DEM raster will be very large. Right-click the virtual raster in your layers panel, choose Export, and ‘Save As’. enter image description here

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