Geoscience Reference
In-Depth Information
Chapter 11
Virtual Rasters and Raster Calculations
Virtual rasters (VRT) do not contain the actual pixel values of the raster cells. Instead,
these virtual files in XML format describe the raster data by: name and location (path)
of the real raster file, number of bands, lines and columns, projection information,
etc. This chapter introduces the powerful concept of virtual rasters and explains how
you can perform subsequent raster calculations without having to write intermediate
datasets to file. On the other hand, this chapter also deals with calculations on real
raster datasets, using the utility gdal_calc.py .
Virtual rasters have a number of benefits over real data sets. They can easily
be edited to modify mappings, add attributes such as color tables and metadata or
perform raster operations. In case of consecutive raster operations, the actual writing
of the pixel values can be postponed until the end. This avoids reading and writing of
temporary files, which increases efficiency. Virtual rasters can also be useful when
you need to access raw binary raster files for which no GDAL driver exists. You must
then describe the structure of the binary raster in the VRT file, such as: length of the
header in bytes, data type, band encoding and byte order (most or least significant
bit first). 1 Finally, virtual formats in XML support the description of algorithms to
be applied to the raster data.
Virtual datasets have limited built in support for raster calculations. If you want
to define new functions, you can also implement your own utility based on the
GDAL application programming language (API). This requires some lower level
programming skills and is discussed in more detail in Chap. 14 .
1 Check http://www.gdal.org/gdal_vrttut.html for an example how to define the subelements for
rawrasterbands.
 
Search WWH ::




Custom Search