Geography Reference
In-Depth Information
<VRTRasterBand dataType="Byte" band="1">
-
<Metadata>
10
<MDI key="NBITS"> 1 </MDI>
-
</Metadata>
-
<ColorInterp> Palette </ColorInterp>
-
<NoDataValue> 0 </NoDataValue>
-
<ColorTable>
15
<Entry c1="255" c2="255" c3="255" c4="255"/>
-
<Entry c1="0" c2="0" c3="0" c4="255"/>
-
</ColorTable>
-
<SimpleSource>
-
<SourceFilename relativeToVRT="1"> l1-1.tif </SourceFilename>
20
<SourceBand> 1 </SourceBand>
-
<SrcRect xOff="0" yOff="0" xSize="9568" ySize="12754"/>
-
<DstRect xOff="0" yOff="0" xSize="9568" ySize="12754"/>
-
</SimpleSource>
-
</VRTRasterBand>
25
</VRTDataset>
-
The tag we added is found in line 14 of the VRT file. Notice the file
also contains a reference to the raster in the <SourceFilename>. This
is important—you still need the original raster in order for the VRT to
work properly.
When the VRT file is displayed by software that uses GDAL for raster
access, white will be transparent, allowing the underlying layers to
show through. In Figure 11.7 , on the following page, we have loaded
the parcel shapefile we digitized in Section 8.1 , Digitizing, on page 120 ,
into QGIS, overlaid by our VRT file. You'll notice that the parcels (green
polygons) are visible, proving that the white of our original raster is now
transparent. You can use VRT files in a number of ways, including set-
ting transparent values for adjacent images so they can be displayed
together without blotting each out. The key is to use gdalinfo to get the
color index number and then create and edit the VRT file(s).
For more information on the VRT format, see the GDAL Virtual Format
Tutorial. 7
11.3
Creating a Spatial Index for Shapefiles
A spatial index can improve the performance of your mapping appli-
cation, whether it be on the desktop or the server. 8 The index speeds
up drawing, selecting, and identifying features by allowing the software
7.
http://www.gdal.org/gdal_vrttut.html
This assumes that your software supports the use of the spatial index in . qix format.
8.
 
 
 
Search WWH ::




Custom Search