[GIS] Mosaic of rasters is big, black rectangle in QGIS

mosaicqgisraster

I am brand new to QGIS and the world of maps. I have four GeoTiffs inside QGIS. I can merge them just fine using the Merge command, but when I try to use the Mosaic command instead I just end up with a black screen and a new layer which has a Min value of NaN and a really low Max number.

Can anyone tell me why and how to fix that, please? I see someone else had a similar problem in ArcGIS:
Why is mosaic of rasters big, black rectangle in ArcGIS Desktop?

I've since followed this guide for calculating statistics and then re-run Mosaic but nothing changed, it's still just blackness.

(The reason I'm using Mosaic and not Merge is because in a bit I'm going to need this command with a 5th image that overlays the other 4, and this is just a simple test.)

enter image description here
enter image description here

Best Answer

TO merge raster layer, you can use the Merge raster layers tool. You can get the tool from Processing Toolbox -> GDAL/OGR -> Miscellaneous -> Merge raster layers.

But before the mosaic process, you need to confirm the data type of the raster images. You can check the raster data type from Layer properties -> Metadata, then go to Data Type. In the example below the data type is 16 bit signed integer. Thus, the output data type should be the same.

enter image description here

Here is an example of of SRTM data before mosaic:

enter image description here

  1. Open the merge tool from Processing Toolbox -> GDAL/OGR -> Miscellaneous -> Merge raster layers
  2. Select the raster images using the ... dots
  3. Select Int16 (in my case), yours might be different depending on the input data type
  4. Define the output file name with extension such as tif for example.

enter image description here

Here is the output mosaic DEM

enter image description here