I was trying to merge a bunch of SRTM rasters in QGIS as I've always done, but this time some of the rasters included large areas of pixels in the sea. The result is that only pixels near the shore are showing any visible contrast. Pixels on land are all white (no information there)(figure). However the individual SRTMs on land obviously have a lot of detail (figure of the original SRTMs before merging). If do as usual and merge only SRTMs which are on land the result is quite decent. How do I come around this? How do I merge all rasters, including the ones in the shore with a lot of pixels at sea?
-
1Maybe there is a large difference between min/max values? If yes, QGIS probably assigns a very large part of raster values to the white color, for example.– mgriCommented Jul 2, 2017 at 22:33
-
I tried using quantile coloring scheme for that reason. No use. Apparently the merging operation is the one that assigns all those pixels in white to maximum elevation (white). But it shouldn't be that way because they are not the same.– rodrikevCommented Jul 2, 2017 at 22:39
-
Please check the actual values of some pixels, I have the same suspicion as mgri. Try to use the "actual" min/max for the styling, not the faster statistical calculation that QGIS uses by default.– bugmenot123Commented Jul 2, 2017 at 23:48
-
Tried that too. The thing is, the maximum value amongst all initial rasters was 949. After merging it is 255. Makes no sense.– rodrikevCommented Jul 2, 2017 at 23:57
-
First, you have to look on the properties of one of your raster layers which value is assingned to no data values. Pixels with No data values are not displayed and are not taking in to account for statistics. Second when you merge the layers, the dialog box ask for which value is to be taken as no data value. If you do not ser this properly, all the píxels are shown, including those at sea.– Gerardo JimenezCommented Jul 3, 2017 at 0:40
1 Answer
I was curious about your last comment. First a raster layer is a matrix of values. As a matrix is always a square or a rectangle. In areas near the sea, a raster layer needs a way to handle those pixels that are "sea", and does it as no data value. Pixels with no data value are not displayed nor are taking in to account in the statistics of the layer. I made an experiment with 4 SRTM models near Yucatan, Mexico. They include the Gulf of Mexico, The Caribbean Sea and a little bit of the Pacific Ocean.
The image shows the four separated models. Then I went to the properties of each one. Scrolling in the metadata section I found the following:
For each model the no data value was the same -32768. When I merged the models, I used this value in the dialog box
and this is the merged DEM showing the continental part and "hidding" the sea pixels.
So, in order the properly merge separate DEMs that include pixels in the sea, you must first search for what value the provider is using to define "no data values". This also applies to build virtual raster (catalog) tool.
This link will clarify a little bit more the issue, although is ArcMap's documentation:
http://desktop.arcgis.com/en/arcmap/10.3/manage-data/raster-and-images/nodata-in-raster-datasets.htm
Hope it helps
Gerardo
-
I've put a screenshot of my metadata for the individual rasters in the question. Take a look. "NoDataValue not set". Here is a link for the files I'm using. Hope you can help me. 4shared.com/folder/YE7oYWbO/SRTM.html– rodrikevCommented Jul 3, 2017 at 12:44
-
I have downloaded your data. There are a couple of files that I assume are sea. Nevertheless they have values ranging from 0 to 6 in some areas. I tried using the raster calculator to convert values below 6 to , but this causes problems with "inland" pixels and leave some "sea" pixels with values. I think is a problem with your data. Try download them again and see if what i described before works. Commented Jul 3, 2017 at 15:18