[Qgis-user] gdalbuildvrt and BuildVRT plugin

Giovanni Pasini jynxtor at gmail.com
Thu Sep 17 09:45:31 PDT 2009


Giovanni Pasini ha scritto:
> With a single band raster map (eg. topographical black/white map) if 
> there is a collar (eg. white border) around the raster, using 
> gdalbuilvrt (and BuildVRT plugin) the result is a vrt file where the map 
> have white strips in overlap area [1].
> In this case making little modification in the vrt text file you can 
> obtain a nice result [2]. What is important is to set the NODATA value 
> in vrt for each raster and replace SimpleSource with ComplexSource.
> I don't remember where I find this trick (mailing list?) and I'm not a 
> gdal guru (vrt specification in gdal web site [3]).
> 
> When created the vrt file (via command-line or the very useful new 
> plugin) I run:
> sed -e 's/<SimpleSource>/<ComplexSource>/g' -e 's/<\/SimpleSource>/ 
> <NODATA>0<\/NODATA>\n    <\/ComplexSource>/g' file_created.vrt
> 
> and now all is ok.
> Note that the trasparency of the final map must be set in qgis in the 
> usual manner.
> 
> Maybe this can be add to the plugin (an otpion to select NODATA value)?
> Hope this can help (and sorry for the bad english...).
> 
> Regards,
> giovanni
> 
> 
> [1] http://www.iouppo.com/lite/pics/de0b44236bd2b2398de0e3172269f81b.png
> [2] http://www.iouppo.com/lite/pics/5d9e1e816caea9c33f1f62595bffaa59.png
> [3] http://www.gdal.org/gdal_vrttut.html
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
> 

Here the reference from http://www.gdal.org/gdal_vrttut.html:


ComplexSource: The ComplexSource is derived from the SimpleSource (so it 
shares the SourceFilename, SourceBand, SrcRect and DestRect elements), 
but it provides support to rescale and offset the range of the source 
values. Certain regions of the source can be masked by specifying the 
NODATA value.

giovanni



More information about the Qgis-user mailing list