[QGIS-trac] Re: [Quantum GIS] #1929: transparency of 0 value do not apply to GDAL virtual rasters (vrt)

Quantum GIS qgis at qgis.org
Thu Sep 17 12:57:00 EDT 2009


#1929: transparency of 0 value do not apply to GDAL virtual rasters (vrt)
-----------------------------------------------------+----------------------
        Reporter:  pcav                              |         Owner:  ersts        
            Type:  bug                               |        Status:  assigned     
        Priority:  major: does not work as expected  |     Milestone:  Version 1.4.0
       Component:  Rasters                           |       Version:  HEAD         
      Resolution:                                    |      Keywords:               
Platform_version:                                    |      Platform:  All          
        Must_fix:  No                                |   Status_info:  1            
-----------------------------------------------------+----------------------
Changes (by pcav):

 * cc: jynxtor at gmail.com (added)

Comment:

 An interesting note from Giovanni Pasini:

 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.

-- 
Ticket URL: <https://trac.osgeo.org/qgis/ticket/1929#comment:5>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats


More information about the QGIS-trac mailing list