Geoscience Reference
In-Depth Information
11.1 Virtual Raster Format Description
The XML format of a virtual raster consists of hierarchical elements. The top
most level is the root element of the dataset, VRTDataset . The root element
describes the width ( rasterXSize ) and height ( rasterYSize ) of the dataset in
pixels. The next level can consist of six subelements fromwhich VRTRasterBand
represents the raster bands of the data sets. For multi-band images, there is a
VRTRasterBand defined for each band. The other five subelements are optional
and used to describe the spatial reference system (SRS), the geotransform (GeoTrans-
form), list of ground control points (GCPList), metadata (Metadata) and a mask band
(MaskBand) that is shared between all bands.
We show a simple example of a VRT image describing an image ( lena.tif )
that is not georeferenced. One of the basic subelements of VRTRasterBand is
SimpleSource . It describes the source element and indicates where the actual
raster data can be read from. From the example below, it is shown how a rectangle
of interest from the source can be mapped to the target raster data set using an offset
in X and Y.
<VRTDataset rasterXSize="512" rasterYSize="512">
<VRTRasterBand dataType="Byte" band="1">
<SimpleSource>
<SourceFilename relativeToVRT="1">lena.tif</SourceFilename>
<SourceBand>1</SourceBand>
<SourceProperties RasterXSize="512" RasterYSize="512"
DataType="Byte" BlockXSize="512" BlockYSize="5" />
<SrcRect xOff="0" yOff="0" xSize="512" ySize="512" />
<DstRect xOff="0" yOff="0" xSize="512" ySize="512" />
</SimpleSource>
</VRTRasterBand>
</VRTDataset>
We briefly describe two other sources that have been derived from Simple
Source : AveragedSource and ComplexSource . AveragedSource sup-
ports an average resampling scheme when the rectangle of the source is not iden-
tical to the target. ComplexSource allows you to manipulate the raster values
via linear and non-linear scaling or by using a lookup table. An example of the
KernelFilteredSource is provided in Sect. 11.3 .
11.2 gdalbuildvrt
The utility gdalbuildvrt is the virtual counterpart of the utility gdal_merge.
py , described in Sect. 8.4 . The default mode is to mosaic all input rasters into a
single VRT. In this case, some basic checking is performed on the input files prior to
the mosaic. The number of bands, the projection and color tables (if available) must
all be similar. Files that fail the check will be skipped from the mosaic. Alternatively,
setting the command line switch -separate will stack all input bands into a multi-
band VRT rather than to mosaic. Input files will not be checked in this case.
 
 
Search WWH ::




Custom Search