Hi Agus, <br>the Raster/BuildVRT calls the gdalbuildvrt executable [1]. <br><br>The default gdalbuildvrt behavior is to create a VRT which has as many bands <br>as one of the input files.<br>You should use "-separate" option to make sure that each files goes into a <br>
separate <em></em>band. <br>The "-separate" option is available from gdal1.7, but in this moment you cannot <br>tick the option from the Raster/BuildVRT tool.<br><br>Cheers.<br><br>[1] <a href="http://www.gdal.org/gdalbuildvrt.html">http://www.gdal.org/gdalbuildvrt.html</a><br>
<br><br><div class="gmail_quote">On Tue, Nov 2, 2010 at 1:45 PM, Agustin Lobo <span dir="ltr"><<a href="mailto:alobolistas@gmail.com">alobolistas@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Just to report that this problem is still present when making a VRT file<br>
using "Raster/Build virtual raster (catalog)": I've made another vrt file<br>
and had to add the 2 lines:<br>
</VRTRasterBand><br>
<VRTRasterBand dataType="UInt16" band="2"><br>
<br>
for each layer as suggested by Benoit in August.<br>
<br>
I've filled a ticket.<br>
<br>
Agus<br>
<br>
2010/8/11 Benoit de Cabissole <<a href="mailto:benoit@exigesa.com">benoit@exigesa.com</a>>:<br>
> Agus,<br>
><br>
> Please try the following:<br>
><br>
> (note the comments in the xml to help you see the changes)<br>
><br>
> <VRTDataset rasterXSize="3001" rasterYSize="2554"><br>
> <SRS>PROJCS["WGS 84 / UTM zone 26N",GEOGCS["WGS<br>
> 84",DATUM["WGS_1984",SPHEROID["WGS<br>
> 84",6378137,298.2572235630016,AUTHORITY["EPSG","7030&quo<br>
> t;]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich&qu<br>
> ot;,0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG"<br>
> ;,"4326"]],PROJECTION["Transverse_Mercator"],PARAMETER[&<br>
> quot;latitude_of_origin",0],PARAMETER["central_meridian",-27]<br>
> ,PARAMETER["scale_factor",0.9996],PARAMETER["false_easting&qu<br>
> ot;,500000],PARAMETER["false_northing",0],UNIT["metre",1<br>
> ,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG",&q<br>
> uot;32626"]]</SRS><br>
> <GeoTransform> 6.5222487132554676e+005, 4.0000000000000000e+000,<br>
> 0.0000000000000000e+000, 4.1899966827195832e+006,<br>
> 0.0000000000000000e+000,-4.0000000000000000e+000</GeoTransform><br>
> <VRTRasterBand dataType="UInt16" band="1"><br>
> <ColorInterp>Gray</ColorInterp><br>
> <SimpleSource><br>
> <SourceFilename<br>
> relativeToVRT="1">po_172227_blu_0000000.tif</SourceFilename><br>
> <SourceBand>1</SourceBand><br>
> <SourceProperties RasterXSize="3001" RasterYSize="2554"<br>
> DataType="UInt16" BlockXSize="3001" BlockYSize="256"/><br>
> <SrcRect xOff="0" yOff="0" xSize="3001" ySize="2554"/><br>
> <DstRect xOff="0" yOff="0" xSize="3001" ySize="2554"/><br>
> </SimpleSource><br>
> <!-- added following two lines --><br>
> </VRTRasterBand><br>
> <VRTRasterBand dataType="UInt16" band="2"><br>
> <SimpleSource><br>
> <SourceFilename<br>
> relativeToVRT="1">po_172227_grn_0000000.tif</SourceFilename> <!--<br>
> changed relativeToVRT to 1 --><br>
> <SourceBand>1</SourceBand><br>
> <SourceProperties RasterXSize="3001" RasterYSize="2554"<br>
> DataType="UInt16" BlockXSize="3001" BlockYSize="256"/><br>
> <SrcRect xOff="0" yOff="0" xSize="3001" ySize="2554"/><br>
> <DstRect xOff="0" yOff="0" xSize="3001" ySize="2554"/><br>
> </SimpleSource><br>
> <!-- added following two lines --><br>
> </VRTRasterBand><br>
> <VRTRasterBand dataType="UInt16" band="3"><br>
> <SimpleSource><br>
> <SourceFilename<br>
> relativeToVRT="1">po_172227_nir_0000000.tif</SourceFilename> <!--<br>
> changed relativeToVRT to 1 --><br>
> <SourceBand>1</SourceBand><br>
> <SourceProperties RasterXSize="3001" RasterYSize="2554"<br>
> DataType="UInt16" BlockXSize="3001" BlockYSize="256"/><br>
> <SrcRect xOff="0" yOff="0" xSize="3001" ySize="2554"/><br>
> <DstRect xOff="0" yOff="0" xSize="3001" ySize="2554"/><br>
> </SimpleSource><br>
> <!-- added following two lines --><br>
> </VRTRasterBand><br>
> <VRTRasterBand dataType="UInt16" band="4"><br>
> <SimpleSource><br>
> <SourceFilename<br>
> relativeToVRT="1">po_172227_red_0000000.tif</SourceFilename> <!--<br>
> changed relativeToVRT to 1 --><br>
> <SourceBand>1</SourceBand><br>
> <SourceProperties RasterXSize="3001" RasterYSize="2554"<br>
> DataType="UInt16" BlockXSize="3001" BlockYSize="256"/><br>
> <SrcRect xOff="0" yOff="0" xSize="3001" ySize="2554"/><br>
> <DstRect xOff="0" yOff="0" xSize="3001" ySize="2554"/><br>
> </SimpleSource><br>
> </VRTRasterBand><br>
> </VRTDataset><br>
><br>
><br>
> This should hopefully do it.<br>
> Otherwise, is your data type really UInt16, can it be coerced to bytes?<br>
><br>
> Cheers,<br>
> Benoit<br>
><br>
>> -----Original Message-----<br>
>> From: Agustin Lobo [mailto:<a href="mailto:alobolistas@gmail.com">alobolistas@gmail.com</a>]<br>
>> Sent: Tuesday, 10 August 2010 22:37<br>
>> To: Benoit EXIGE<br>
>> Cc: qgis-user; <a href="mailto:arturgil@gmail.com">arturgil@gmail.com</a>; <a href="mailto:cavallini@faunalia.it">cavallini@faunalia.it</a><br>
>> Subject: Re: [Qgis-user] QGIS1.5 on Win (standalone installation):<br>
>> Problem with VRT<br>
>><br>
>><br>
>> Thanks, I've done as below and the problem remains.<br>
>> Should I fill a ticket?<br>
>><br>
>> <VRTDataset rasterXSize="3001" rasterYSize="2554"><br>
>> <SRS>PROJCS["WGS 84 / UTM zone 26N",GEOGCS["WGS<br>
>> 84",DATUM["WGS_1984",SPHEROID["WGS<br>
>> 84",6378137,298.2572235630016,AUTHORITY["EPSG",&quo<br>
>> t;7030"]],AUTHORITY["EPSG","6326"]],PRIME<br>
>> M["Greenwich",0],UNIT["degree",0.0174532925199<br>
>> 433],AUTHORITY["EPSG","4326"]],PROJECTION[&quo<br>
> t;Transverse_Mercator"],PARAMETER><br>
> ["latitude_of_origin",0],PARAMETER["central_meridia<br>
>> n",-27],PARAMETER["scale_factor",0.9996],PARAMETER[<br>
> "false_easting",500000],PARAMETER><br>
> ["false_northing",0],UNIT["metre",1,AUTHORITY[<br>
> "EPSG","9001><br>
> "]],AUTHORITY["EPSG","32626"]]</SRS><br>
>> <GeoTransform> 6.5222487132554676e+005, 4.0000000000000000e+000,<br>
>> 0.0000000000000000e+000, 4.1899966827195832e+006,<br>
>> 0.0000000000000000e+000,-4.0000000000000000e+000</GeoTransform><br>
>> <VRTRasterBand dataType="UInt16" band="1"><br>
>> <ColorInterp>Gray</ColorInterp><br>
>> <SimpleSource><br>
>> <SourceFilename<br>
>> relativeToVRT="1">po_172227_blu_0000000.tif</SourceFilename><br>
>> <SourceBand>1</SourceBand><br>
>> <SourceProperties RasterXSize="3001" RasterYSize="2554"<br>
>> DataType="UInt16" BlockXSize="3001" BlockYSize="256"/><br>
>> <SrcRect xOff="0" yOff="0" xSize="3001" ySize="2554"/><br>
>> <DstRect xOff="0" yOff="0" xSize="3001" ySize="2554"/><br>
>> </SimpleSource><br>
>> <SimpleSource><br>
>> <SourceFilename<br>
>> relativeToVRT="2">po_172227_grn_0000000.tif</SourceFilename><br>
>> <SourceBand>1</SourceBand><br>
>> <SourceProperties RasterXSize="3001" RasterYSize="2554"<br>
>> DataType="UInt16" BlockXSize="3001" BlockYSize="256"/><br>
>> <SrcRect xOff="0" yOff="0" xSize="3001" ySize="2554"/><br>
>> <DstRect xOff="0" yOff="0" xSize="3001" ySize="2554"/><br>
>> </SimpleSource><br>
>> <SimpleSource><br>
>> <SourceFilename<br>
>> relativeToVRT="3">po_172227_nir_0000000.tif</SourceFilename><br>
>> <SourceBand>1</SourceBand><br>
>> <SourceProperties RasterXSize="3001" RasterYSize="2554"<br>
>> DataType="UInt16" BlockXSize="3001" BlockYSize="256"/><br>
>> <SrcRect xOff="0" yOff="0" xSize="3001" ySize="2554"/><br>
>> <DstRect xOff="0" yOff="0" xSize="3001" ySize="2554"/><br>
>> </SimpleSource><br>
>> <SimpleSource><br>
>> <SourceFilename<br>
>> relativeToVRT="4">po_172227_red_0000000.tif</SourceFilename><br>
>> <SourceBand>1</SourceBand><br>
>> <SourceProperties RasterXSize="3001" RasterYSize="2554"<br>
>> DataType="UInt16" BlockXSize="3001" BlockYSize="256"/><br>
>> <SrcRect xOff="0" yOff="0" xSize="3001" ySize="2554"/><br>
>> <DstRect xOff="0" yOff="0" xSize="3001" ySize="2554"/><br>
>> </SimpleSource><br>
>> </VRTRasterBand><br>
>> </VRTDataset><br>
>><br>
>><br>
>> 2010/8/10 Benoit EXIGE <<a href="mailto:benoit@exigesa.com">benoit@exigesa.com</a>>:<br>
>> > Hi Agus,<br>
>> ><br>
>> > Looks to me that the <sourceband> should be incremented from 1<br>
>> to 4 for your<br>
>> > four rasters.<br>
>> ><br>
>> > Hope this helps.<br>
>> > Benoit<br>
>> ><br>
>> ><br>
>> > Sent from my iPod<br>
>> ><br>
>> > On 10 Aug 2010, at 21:01, Agustin Lobo <<a href="mailto:alobolistas@gmail.com">alobolistas@gmail.com</a>> wrote:<br>
>> ><br>
>> >> Hi!<br>
>> >><br>
>> >> I use the gdal utilities (raster/Build Virtual Raster) with 4 files but<br>
>> >> then QGIS sees one band only (only one band listed in the Properties<br>
>> >> dialog).<br>
>> >> This is the VRT file, could anyone tell me if this is correct?<br>
>> >><br>
>> >> <VRTDataset rasterXSize="3001" rasterYSize="2554"><br>
>> >> <SRS>PROJCS["WGS 84 / UTM zone 26N",GEOGCS["WGS<br>
>> >> 84",DATUM["WGS_1984",SPHEROID["WGS<br>
>> >><br>
>> >><br>
>> 84",6378137,298.2572235630016,AUTHORITY["EPSG",&quo<br>
>> t;7030"]],AUTHORITY["EPSG","6326"]],PRIME<br>
>> M["Greenwich",0],UNIT["degree",0.0174532925199<br>
>> 433],AUTHORITY["EPSG","4326"]],PROJECTION[&quo<br>
> t;Transverse_Mercator"],PARAMETER><br>
> ["latitude_of_origin",0],PARAMETER["central_meridia<br>
>> n",-27],PARAMETER["scale_factor",0.9996],PARAMETER[<br>
> "false_easting",500000],PARAMETER><br>
> ["false_northing",0],UNIT["metre",1,AUTHORITY[<br>
> "EPSG","9001><br>
> "]],AUTHORITY["EPSG","32626"]]</SRS><br>
>> >> <GeoTransform> 6.5222487132554676e+005, 4.0000000000000000e+000,<br>
>> >> 0.0000000000000000e+000, 4.1899966827195832e+006,<br>
>> >> 0.0000000000000000e+000,-4.0000000000000000e+000</GeoTransform><br>
>> >> <VRTRasterBand dataType="UInt16" band="1"><br>
>> >> <ColorInterp>Gray</ColorInterp><br>
>> >> <SimpleSource><br>
>> >> <SourceFilename<br>
>> >> relativeToVRT="1">po_172227_blu_0000000.tif</SourceFilename><br>
>> >> <SourceBand>1</SourceBand><br>
>> >> <SourceProperties RasterXSize="3001" RasterYSize="2554"<br>
>> >> DataType="UInt16" BlockXSize="3001" BlockYSize="256"/><br>
>> >> <SrcRect xOff="0" yOff="0" xSize="3001" ySize="2554"/><br>
>> >> <DstRect xOff="0" yOff="0" xSize="3001" ySize="2554"/><br>
>> >> </SimpleSource><br>
>> >> <SimpleSource><br>
>> >> <SourceFilename<br>
>> >> relativeToVRT="1">po_172227_grn_0000000.tif</SourceFilename><br>
>> >> <SourceBand>1</SourceBand><br>
>> >> <SourceProperties RasterXSize="3001" RasterYSize="2554"<br>
>> >> DataType="UInt16" BlockXSize="3001" BlockYSize="256"/><br>
>> >> <SrcRect xOff="0" yOff="0" xSize="3001" ySize="2554"/><br>
>> >> <DstRect xOff="0" yOff="0" xSize="3001" ySize="2554"/><br>
>> >> </SimpleSource><br>
>> >> <SimpleSource><br>
>> >> <SourceFilename<br>
>> >> relativeToVRT="1">po_172227_nir_0000000.tif</SourceFilename><br>
>> >> <SourceBand>1</SourceBand><br>
>> >> <SourceProperties RasterXSize="3001" RasterYSize="2554"<br>
>> >> DataType="UInt16" BlockXSize="3001" BlockYSize="256"/><br>
>> >> <SrcRect xOff="0" yOff="0" xSize="3001" ySize="2554"/><br>
>> >> <DstRect xOff="0" yOff="0" xSize="3001" ySize="2554"/><br>
>> >> </SimpleSource><br>
>> >> <SimpleSource><br>
>> >> <SourceFilename<br>
>> >> relativeToVRT="1">po_172227_red_0000000.tif</SourceFilename><br>
>> >> <SourceBand>1</SourceBand><br>
>> >> <SourceProperties RasterXSize="3001" RasterYSize="2554"<br>
>> >> DataType="UInt16" BlockXSize="3001" BlockYSize="256"/><br>
>> >> <SrcRect xOff="0" yOff="0" xSize="3001" ySize="2554"/><br>
>> >> <DstRect xOff="0" yOff="0" xSize="3001" ySize="2554"/><br>
>> >> </SimpleSource><br>
>> >> </VRTRasterBand><br>
>> >> </VRTDataset><br>
>> >><br>
>> >> Thanks<br>
>> >> Agus<br>
>> >> _______________________________________________<br>
>> >> Qgis-user mailing list<br>
>> >> <a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br>
>> >> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
>> ><br>
>> > _______________________________________________<br>
>> > Qgis-user mailing list<br>
>> > <a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br>
>> > <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
>> ><br>
><br>
> _______________________________________________<br>
> Qgis-user mailing list<br>
> <a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
><br>
_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Giuseppe Sucameli<br><br>