18

Okay, so I'm a little fed up with different raster-in-database solutions that I tried over the last 2 weeks which don't work currently (PostGIS raster) or can't handle my volume of data (Rasterlite), so I'm reading about the VRT format. Bear with me, I'd like your opinions on this, and also if what I propose makes sense at all:

VRT is basically a metadata XML file describing various properties of the actual raster file, like pixel dimensions, geolocation, etc..

Step 1: I converted (not really, just generated VRTs) all my GeoTIFF files into VRT.

Now, since I see I can merge the VRT, I assume its possible to create a mosaic of VRT metadata files, one big VRT to hold all metadata. Great, that means, metadata will probably be used for optimizing the rendering since QGIS will decide (assumption) which tiles fall into the current canvas extent and which not...

Step 2: create a VRT mosaic

Okay, now the next benefit I see is, I only need to add one entry into the QGIS table of contents and I can set different things upon it, like scale dependant rendering and null data value transparency if needed. One could argue, you can simply load GeoTIFFs into QGIS and put them in a group, true, but you don't have any control over a group except for setting the common SRS.

If I wanted to see my orthophoto on a small scale (large zoom-out) and still have speedy rendering I would repeat the steps, only with a resampled set of original raster and end up with a few big VRT datasets.

Does this make any sense? :)

nmtoken
  • 13,355
  • 5
  • 38
  • 87
U2ros
  • 5,117
  • 5
  • 29
  • 51

1 Answers1

13

I love processing with vrt's. you can make lots of interim changes. Evaluate them quickly in QGIS and if you like any of them just translate back to a selfcontained raster format (tif, png etc).

saves lots of time.

U2ros,your uses of vrt's makes perfect sense, to me at least :) mosaicking and then clipping is what I originally started using vrts for: eliminating interim rasters that I would delete later.

check out this link: http://www.perrygeo.com/lazy-raster-processing-with-gdal-vrts.html [link adjusted since the blog has been moved]

hope it has something for you.

AndreJ
  • 76,698
  • 5
  • 86
  • 162
s_a
  • 951
  • 6
  • 10
  • Can you clarify this for me? Can you have multiple file references in one vrt file? for example, if you have 4 geotif files, from which you make 4 vrt files and then merge them. Based on the link you sent, the merge will ACTUALLY happen and the result will be 1 big geotiff file, what i would expect/want would be 1 VRT file that has contents of the original 4 - sort of like a catalog file? – U2ros Sep 07 '12 at 15:11
  • hey U2ros, are you using gdal cmdline or QGIS to make vrt's. I believe you might find more options using the command line. you can make 4 tifs merge into one vrt. and if you like it export it again as a single tif (or as a vrt). I think you will really like the options available from the gdal commanline tools check out these two websites: http://www.gdal.org/gdal_vrttut.html ; http://www.gdal.org/gdal_utilities.html – s_a Sep 07 '12 at 15:26
  • atm, qgis ui, but im comfortable with cli, will definitely do it there then. – U2ros Sep 07 '12 at 15:28
  • one last thing :) In the page I sent I assume the author wants a final raster and not a VRT so yes the merge will result in a TIFF or some non-virtual format. – s_a Sep 07 '12 at 15:29
  • 1
    Second answer from this link http://gis.stackexchange.com/questions/25499/how-can-i-join-several-raster-files-using-qgis explains it on a practical level – U2ros Sep 07 '12 at 15:48
  • By the way... when building pyramids... and when i select the option to build tiff (jpeg compressed) OVR files. Theres always 1 corresponding OVR file for each original image, regardless of number of pyramid levels. They cant be all in the same OVR file or can they? – U2ros Sep 09 '12 at 16:32
  • Hi U2ros, This may or may not be worthy of another thread to get attention. But the answer is they are all in the one file. There is a bit of information at at the gdal webpage under the gdaladdo tool.Also, check there if you want to store the overviews in the original tiff :) – s_a Sep 10 '12 at 12:55
  • I ve played a lot last few days with vrts. I think the best solution is to use ECW as original format, and vrt to build a catalog – U2ros Sep 10 '12 at 15:21