Using QGIS 2.14.3 I tested Virtual Raster Table technology for the first time using two TIF DEMS (NED 1/3 arc-second, projected to EPSG:3338, single band, 32-bit floating point, ~ 5-meter resolution). I then created a GeoTIFF hillshade from the VRT (using Raster > Terrain Analysis > Hillshade). I think that the results are spectacular (Brooks Range, northern Alaska):

enter image description here

Happy with the above test, I then used the same procedures to create a VRT for my entire project area (77 NED TIFs), including a hillshade. Sadly, though, this hillshade (~ 70 GB!) has an unwanted grid pattern:

enter image description here

The same process is applied in both cases, the only difference (that I can think of) is the number of TIFFs in the VRT. The grid pattern reminds me of improper resampling techniques that I've seen in the past (such as using Nearest Neighbor when Bilinear would have been appropriate), but even still, why did it work so well in the test case? Any suggestions to avoid this grid pattern?

EDIT: After further experimentation, I have found that this unwanted grid pattern arises when as few as two tiles are used in a VRT.

  • Did you used option resolution in the build VRT menu?
    – Jost Hobic
    Jun 20 '16 at 8:25
  • I have exactly the same problem. When i use a single raster to compute hillshading, everything works fine. When i use a merged raster, these unwanted grid pattern appear. I tried to resample the raster before computing a hillshade: grid pattern shows up again. Does anyone know why this could be? Dec 31 '17 at 10:52
  • Do the patterns show up in the original CRS and 1:1 scale of the data? If not, do they vanish if you use a different resampling mode for the layer than nearest-neighbor? Apr 10 '18 at 11:21

Did you used option resolution in the build VRT menu? One possible reason is that your TIFF have pyramids.

Check under Layer properties - Pyramids: if you have small pyramids icons in yellow (see pic bellow). If you do have it then when you create VRT Qgis automatically switches to lower resolution - performance. As pyramids are made by Nearest Neighbor - you get that effect when hillshading.

enter image description here

As it states in Layer properties-Pyramids: Please note that building internal pyramids may alter the original data file and once created they cannot be removed!

In that case i recommend that you make new tiffs or merge them through Raster - Miscellaneous - Merge.

  • you had a good idea, but sadly modifying either the resolution option and/or Building Overview resampling options made no difference - the grid pattern remains.
    – Stu Smith
    Jun 20 '16 at 20:34
  • Edit: @ Jost Hobic you had a good idea, but sadly modifying either the resolution option and/or Building Overview resampling options made no difference - the grid pattern remains. I tried building overviews on the VRT's source input tiffs, the VRT itself, as well as the VRT hillshade. No joy. Also... I created a VRT with just one tif (that had previously displayed the grid pattern when used in a multi-tiff VRT) and the grid pattern was not there. The evidence still seems to point to a problem with the VRTs. I am still puzzled...
    – Stu Smith
    Jun 20 '16 at 20:43
  • Check my edited answer. I suspect pyramids.
    – Jost Hobic
    Jun 22 '16 at 8:40
  • @ Jost Hobic I have redone this experiment without any pyramids. The grid problem still exists. Please see my screen shot:
    – Stu Smith
    Aug 12 '16 at 0:13

Most likely grid artifacts in a hillshade are resulting from a DEM that got reprojected/warped by using nearest neighbour which seems to be the default resampling mode in GDAL/QGIS. As suggested in how to remove strange gdaldem hillshade artifacts and exhausted in depth here using bilinear as resampling mode when raster warping in order to avoid faulty hillshades is adviced.

This is what did the trick for me when I was confronted with that very symptomatic pattern - Not sure about VRTs though.

EDIT: I generated VRTs trying all three resolution options as suggested by Jost Hobic's comment and bumped into the grid again. Perhaps merging the DEMs beforehand would facilitate a workaround but 70 GB sound rather time consuming...

EDIT 2: Perhaps a more suitable workaround could be to create VRT out of hillshades which were batch processed beforehand ?

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.