4

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

  • 1
    Can you add a screenshot of the Symbology tab in the Layer Properties window, with the Min / Max Value Settings section expanded? – Gabriel De Luca Dec 29 '18 at 13:21
  • Take a look here: gis.stackexchange.com/…. For sure one of them is a duplicate. If not, edit the question to clarify. Tks. – Andre Silva Dec 29 '18 at 21:47
  • 1
    I have edited my initial question to provide more detail description of my problem – Witold Rozak Dec 30 '18 at 15:58
  • Just tried exactly the same with your data and I cannot reproduce the issue. Only difference is that I'm using QGIS 3.4.2. However, you could try using Built virtual raster tool instead. Make sure to uncheck Place each input file into a separate band. – MrXsquared Dec 30 '18 at 16:10
  • I could not reproduce the issue in QGIS 3.4.2 either, but when updating to 3.4.3 I found the same behavior. The log error says GDAL command output: 0RuntimeError: module compiled against API version 0xc but this version of numpy is 0xa. Seems like a problem with the numpy version. I can't found a solution for that yet, but it is already reported. Please add the log of the gdal_merge gui to the question. – Gabriel De Luca Dec 31 '18 at 5:33
2

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.

  • The discussion under this bug report implies that the issue wasn't caused by QGIS. But it sounds like you're saying that QGIS 3.4.3 caused the issue with the numpy version. If that's the case, please update the bug report and make sure the devs know that. Otherwise they won't know they need to fix it. – csk Jan 2 at 17:35
  • I see that they adjusted the category to Build/Install . I do not have my credentials for that site at this time, but when I can I will clarify that the numpy module library was not installed separately from the QGIS distribution. Thank you. – Gabriel De Luca Jan 2 at 19:57
1

I would suggest that you run these set of commands to reinstall numpy in case the first line above does not return a version:

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 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

I got merge grids to work again using the above commands.

  • Thank you, there was an error in the other answer, the correct command was python -m pip show numpy. Already edited. Likewise, it is only to know the version of the installed module. The whole process can be reduced to run python -m pip install -U numpy, command that summarizes the module upgrade regardless of the installed version, as reported in OSGeo4W. – Gabriel De Luca Jan 16 at 15:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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