MapInfo Virtual Raster is a raster that acquires the data for all of its fields and bands from other raster sources at run time. The virtual raster is fully described by a small XML file that records the structure of the raster (the fields and bands and their properties). The XML also records the raster file sources from which the raster data is acquired to populate the fields and bands.
MapInfo Virtual Raster behaves like an actual raster file, even though it does not exist physically. It gives you the same experience as any physical raster file. A virtual raster provides you the following advantages:
- With virtual raster you can render an RGB file by sourcing the R, G, and B bands from different raster source.
- Each band in a virtual raster is connected to a raster source. The raster source provides data to the virtual raster driver on demand, at run time. This data need not conform to the projection or geometry of the virtual raster. It will be interpolated and re-projected, as required, to match the geometry of the virtual raster at run time.
- Virtual datasets are useful for managing large datasets that are split into multiple files. Virtual rasters are just XML files that contain information about where actual data can be found.
- There is no restriction on the cell size, geometry or projection of the source raster. When linking a virtual band to a source raster, you need to specify the required field and band index of the source raster.
- Using a virtual raster allows you to avoid merging, combining, re-projecting and re-sampling the source rasters to get them into an appropriate form for rendering. All that work is done for you on the fly by the virtual raster driver. For raster sources like ECW or JPEG2000 this is more useful because any processing operation on rasters with lossy image compression results in further loss of image quality.
The output XML
MapInfo Virtual Raster operation creates an XML output file. This XML file records all information about the component raster and the raster rendering engine reads the information described in the XML and renders it on the map.
Structure of the output XML file
The output XML file lists all the rasters that are source rasters to this virtual raster. In addition to filename, each source raster has a unique name. For example, 'RasterSource0, 'RasterSource1' etc. as shown below.
<Raster File="D:\Data\All\grc\SeattleLULC.grc" Name="RasterSource0"/>
<Raster File="D:\Data\All\Classified\Classified.grc" Name="RasterSource1"/>
<Raster File="D:\Data\All\grd\SeattleElevation.grd" Name="RasterSource2"/>
- The RasterInfo tag will have a single FieldInfo
tag. The FieldInfo tag has an attribute 'Name' which will
define the field name for the Virtual raster. The
FieldInfo tag can contain one or more
BandInfo tags.
<RasterInfo> <FieldInfo Name="Field"> <BandInfo Name="Index"> <Raster Name="RasterSource0" Field="0" Band="0" PrimaryRaster="true"/> </BandInfo> <BandInfo Name="Band 1"> <Raster Name="RasterSource1" Field="0" Band="0"/> </BandInfo> </FieldInfo> </RasterInfo>
- Each band is linked to a named source raster. Name the field index and band index of the data
you want to extract from that source raster for the virtual band. Bands can be
designated a 'Name' (just like fields). One of the bands can be marked as
PrimaryRaster. The properties of the raster referred to by PrimaryRaster band
will be used to define the virtual raster properties such as the coordinate
system, geometry and the cell size.
<BandInfo Name="Index"> <Raster Name="RasterSource0" Field="0" Band="0" PrimaryRaster="true"/> </BandInfo> <BandInfo Name="Band 1"> <Raster Name="RasterSource1" Field="0" Band="0"/> </BandInfo>