How to Fix Black Squares After Merging Two Rasters in QGIS

geotiff-tiffmergeqgisraster

After merging two SRTM TIFF files all I get is a black rectangle.

Merged raster has zeros next to both black and white squares under layer name.

I have no clue what I am doing wrong. Any suggestions?

I downloaded 2 tiles from here: https://dds.cr.usgs.gov/srtm/version2_1/SRTM3/Islands/

Tiles: S44E170 and S44E171

I opened both tiles in QGIS Desktop 3.4.3
enter image description here

enter image description here
enter image description here

And after merging them I get this:
enter image description here
enter image description here
enter image description here

Best Answer

Tested on a clean install of the QGIS Standalone Installer Version 3.4, on a 64-bit Windows 10 machine.

QGIS 3.4.3 seems to install a version of the numpy module that is not what gdal_merge needs.

After several attempts, I found this solution:

  • Run as Administrator the OSGeo4W.bat file, located at the QGIS 3.4 folder (C:\Program Files\QGIS 3.4 by default), that calls enviroment variables and opens a shell with administrator privileges

  • run: python -m pip show numpy, returns Version: 1.12.1+mkl

  • run: python -m pip uninstall numpy, agree to proceed, returns Successfully uninstalled numpy-1.12.1+mkl

  • run: python -m pip install numpy, returns Succesfully installed numpy-1.15.4

  • close the shell and run the Merge function in QGIS again, it will work fine now.

Related Question