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?
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:
Hope it helps