[Qgis-user] QGIS1.5 on Win (standalone installation): Problem with VRT

Agustin Lobo alobolistas at gmail.com
Tue Nov 2 05:45:43 PDT 2010


Hi!

Just to report that this problem is still present when making a VRT file
using "Raster/Build virtual raster (catalog)": I've made another vrt file
and had to add the 2 lines:
</VRTRasterBand>
<VRTRasterBand dataType="UInt16" band="2">

for each layer as suggested by Benoit in August.

I've filled a ticket.

Agus

2010/8/11 Benoit de Cabissole <benoit at exigesa.com>:
> Agus,
>
> Please try the following:
>
> (note the comments in the xml to help you see the changes)
>
> <VRTDataset rasterXSize="3001" rasterYSize="2554">
>  <SRS>PROJCS["WGS 84 / UTM zone 26N",GEOGCS["WGS
> 84",DATUM["WGS_1984",SPHEROID["WGS
> 84",6378137,298.2572235630016,AUTHORITY["EPSG","7030&quo
> t;]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich&qu
> ot;,0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG&quot
> ;,"4326"]],PROJECTION["Transverse_Mercator"],PARAMETER[&
> quot;latitude_of_origin",0],PARAMETER["central_meridian",-27]
> ,PARAMETER["scale_factor",0.9996],PARAMETER["false_easting&qu
> ot;,500000],PARAMETER["false_northing",0],UNIT["metre",1
> ,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG",&q
> uot;32626"]]</SRS>
>  <GeoTransform> 6.5222487132554676e+005, 4.0000000000000000e+000,
> 0.0000000000000000e+000, 4.1899966827195832e+006,
> 0.0000000000000000e+000,-4.0000000000000000e+000</GeoTransform>
>  <VRTRasterBand dataType="UInt16" band="1">
>    <ColorInterp>Gray</ColorInterp>
>    <SimpleSource>
>      <SourceFilename
> relativeToVRT="1">po_172227_blu_0000000.tif</SourceFilename>
>      <SourceBand>1</SourceBand>
>      <SourceProperties RasterXSize="3001" RasterYSize="2554"
> DataType="UInt16" BlockXSize="3001" BlockYSize="256"/>
>      <SrcRect xOff="0" yOff="0" xSize="3001" ySize="2554"/>
>      <DstRect xOff="0" yOff="0" xSize="3001" ySize="2554"/>
>    </SimpleSource>
> <!-- added following two lines -->
>  </VRTRasterBand>
>  <VRTRasterBand dataType="UInt16" band="2">
>    <SimpleSource>
>      <SourceFilename
> relativeToVRT="1">po_172227_grn_0000000.tif</SourceFilename>     <!--
> changed relativeToVRT to 1 -->
>      <SourceBand>1</SourceBand>
>      <SourceProperties RasterXSize="3001" RasterYSize="2554"
> DataType="UInt16" BlockXSize="3001" BlockYSize="256"/>
>      <SrcRect xOff="0" yOff="0" xSize="3001" ySize="2554"/>
>      <DstRect xOff="0" yOff="0" xSize="3001" ySize="2554"/>
>    </SimpleSource>
> <!-- added following two lines -->
>  </VRTRasterBand>
>  <VRTRasterBand dataType="UInt16" band="3">
>    <SimpleSource>
>      <SourceFilename
> relativeToVRT="1">po_172227_nir_0000000.tif</SourceFilename>     <!--
> changed relativeToVRT to 1 -->
>      <SourceBand>1</SourceBand>
>      <SourceProperties RasterXSize="3001" RasterYSize="2554"
> DataType="UInt16" BlockXSize="3001" BlockYSize="256"/>
>      <SrcRect xOff="0" yOff="0" xSize="3001" ySize="2554"/>
>      <DstRect xOff="0" yOff="0" xSize="3001" ySize="2554"/>
>    </SimpleSource>
> <!-- added following two lines -->
>  </VRTRasterBand>
>  <VRTRasterBand dataType="UInt16" band="4">
>    <SimpleSource>
>      <SourceFilename
> relativeToVRT="1">po_172227_red_0000000.tif</SourceFilename>     <!--
> changed relativeToVRT to 1 -->
>      <SourceBand>1</SourceBand>
>      <SourceProperties RasterXSize="3001" RasterYSize="2554"
> DataType="UInt16" BlockXSize="3001" BlockYSize="256"/>
>      <SrcRect xOff="0" yOff="0" xSize="3001" ySize="2554"/>
>      <DstRect xOff="0" yOff="0" xSize="3001" ySize="2554"/>
>    </SimpleSource>
>  </VRTRasterBand>
> </VRTDataset>
>
>
> This should hopefully do it.
> Otherwise, is your data type really UInt16, can it be coerced to bytes?
>
> Cheers,
> Benoit
>
>> -----Original Message-----
>> From: Agustin Lobo [mailto:alobolistas at gmail.com]
>> Sent: Tuesday, 10 August 2010 22:37
>> To: Benoit EXIGE
>> Cc: qgis-user; arturgil at gmail.com; cavallini at faunalia.it
>> Subject: Re: [Qgis-user] QGIS1.5 on Win (standalone installation):
>> Problem with VRT
>>
>>
>> Thanks, I've done as below and the problem remains.
>> Should I fill a ticket?
>>
>> <VRTDataset rasterXSize="3001" rasterYSize="2554">
>>   <SRS>PROJCS["WGS 84 / UTM zone 26N",GEOGCS["WGS
>> 84",DATUM["WGS_1984",SPHEROID["WGS
>> 84",6378137,298.2572235630016,AUTHORITY["EPSG",&quo
>> t;7030"]],AUTHORITY["EPSG","6326"]],PRIME
>> M["Greenwich",0],UNIT["degree",0.0174532925199
>> 433],AUTHORITY["EPSG","4326"]],PROJECTION[&quo
> t;Transverse_Mercator"],PARAMETER>
> ["latitude_of_origin",0],PARAMETER["central_meridia
>> n",-27],PARAMETER["scale_factor",0.9996],PARAMETER[
> "false_easting",500000],PARAMETER>
> ["false_northing",0],UNIT["metre",1,AUTHORITY[
> "EPSG","9001>
> "]],AUTHORITY["EPSG","32626"]]</SRS>
>>   <GeoTransform> 6.5222487132554676e+005, 4.0000000000000000e+000,
>> 0.0000000000000000e+000, 4.1899966827195832e+006,
>> 0.0000000000000000e+000,-4.0000000000000000e+000</GeoTransform>
>>   <VRTRasterBand dataType="UInt16" band="1">
>>     <ColorInterp>Gray</ColorInterp>
>>     <SimpleSource>
>>       <SourceFilename
>> relativeToVRT="1">po_172227_blu_0000000.tif</SourceFilename>
>>       <SourceBand>1</SourceBand>
>>       <SourceProperties RasterXSize="3001" RasterYSize="2554"
>> DataType="UInt16" BlockXSize="3001" BlockYSize="256"/>
>>       <SrcRect xOff="0" yOff="0" xSize="3001" ySize="2554"/>
>>       <DstRect xOff="0" yOff="0" xSize="3001" ySize="2554"/>
>>     </SimpleSource>
>>     <SimpleSource>
>>       <SourceFilename
>> relativeToVRT="2">po_172227_grn_0000000.tif</SourceFilename>
>>       <SourceBand>1</SourceBand>
>>       <SourceProperties RasterXSize="3001" RasterYSize="2554"
>> DataType="UInt16" BlockXSize="3001" BlockYSize="256"/>
>>       <SrcRect xOff="0" yOff="0" xSize="3001" ySize="2554"/>
>>       <DstRect xOff="0" yOff="0" xSize="3001" ySize="2554"/>
>>     </SimpleSource>
>>     <SimpleSource>
>>       <SourceFilename
>> relativeToVRT="3">po_172227_nir_0000000.tif</SourceFilename>
>>       <SourceBand>1</SourceBand>
>>       <SourceProperties RasterXSize="3001" RasterYSize="2554"
>> DataType="UInt16" BlockXSize="3001" BlockYSize="256"/>
>>       <SrcRect xOff="0" yOff="0" xSize="3001" ySize="2554"/>
>>       <DstRect xOff="0" yOff="0" xSize="3001" ySize="2554"/>
>>     </SimpleSource>
>>     <SimpleSource>
>>       <SourceFilename
>> relativeToVRT="4">po_172227_red_0000000.tif</SourceFilename>
>>       <SourceBand>1</SourceBand>
>>       <SourceProperties RasterXSize="3001" RasterYSize="2554"
>> DataType="UInt16" BlockXSize="3001" BlockYSize="256"/>
>>       <SrcRect xOff="0" yOff="0" xSize="3001" ySize="2554"/>
>>       <DstRect xOff="0" yOff="0" xSize="3001" ySize="2554"/>
>>     </SimpleSource>
>>   </VRTRasterBand>
>> </VRTDataset>
>>
>>
>> 2010/8/10 Benoit EXIGE <benoit at exigesa.com>:
>> > Hi Agus,
>> >
>> > Looks to me that the <sourceband> should be incremented from 1
>> to 4 for your
>> > four rasters.
>> >
>> > Hope this helps.
>> > Benoit
>> >
>> >
>> > Sent from my iPod
>> >
>> > On 10 Aug 2010, at 21:01, Agustin Lobo <alobolistas at gmail.com> wrote:
>> >
>> >> Hi!
>> >>
>> >> I use the gdal utilities (raster/Build Virtual Raster) with 4 files but
>> >> then QGIS sees one band only (only one band listed in the Properties
>> >> dialog).
>> >> This is the VRT file, could anyone tell me if this is correct?
>> >>
>> >> <VRTDataset rasterXSize="3001" rasterYSize="2554">
>> >>  <SRS>PROJCS["WGS 84 / UTM zone 26N",GEOGCS["WGS
>> >> 84",DATUM["WGS_1984",SPHEROID["WGS
>> >>
>> >>
>> 84",6378137,298.2572235630016,AUTHORITY["EPSG",&quo
>> t;7030"]],AUTHORITY["EPSG","6326"]],PRIME
>> M["Greenwich",0],UNIT["degree",0.0174532925199
>> 433],AUTHORITY["EPSG","4326"]],PROJECTION[&quo
> t;Transverse_Mercator"],PARAMETER>
> ["latitude_of_origin",0],PARAMETER["central_meridia
>> n",-27],PARAMETER["scale_factor",0.9996],PARAMETER[
> "false_easting",500000],PARAMETER>
> ["false_northing",0],UNIT["metre",1,AUTHORITY[
> "EPSG","9001>
> "]],AUTHORITY["EPSG","32626"]]</SRS>
>> >>  <GeoTransform> 6.5222487132554676e+005, 4.0000000000000000e+000,
>> >> 0.0000000000000000e+000, 4.1899966827195832e+006,
>> >> 0.0000000000000000e+000,-4.0000000000000000e+000</GeoTransform>
>> >>  <VRTRasterBand dataType="UInt16" band="1">
>> >>   <ColorInterp>Gray</ColorInterp>
>> >>   <SimpleSource>
>> >>     <SourceFilename
>> >> relativeToVRT="1">po_172227_blu_0000000.tif</SourceFilename>
>> >>     <SourceBand>1</SourceBand>
>> >>     <SourceProperties RasterXSize="3001" RasterYSize="2554"
>> >> DataType="UInt16" BlockXSize="3001" BlockYSize="256"/>
>> >>     <SrcRect xOff="0" yOff="0" xSize="3001" ySize="2554"/>
>> >>     <DstRect xOff="0" yOff="0" xSize="3001" ySize="2554"/>
>> >>   </SimpleSource>
>> >>   <SimpleSource>
>> >>     <SourceFilename
>> >> relativeToVRT="1">po_172227_grn_0000000.tif</SourceFilename>
>> >>     <SourceBand>1</SourceBand>
>> >>     <SourceProperties RasterXSize="3001" RasterYSize="2554"
>> >> DataType="UInt16" BlockXSize="3001" BlockYSize="256"/>
>> >>     <SrcRect xOff="0" yOff="0" xSize="3001" ySize="2554"/>
>> >>     <DstRect xOff="0" yOff="0" xSize="3001" ySize="2554"/>
>> >>   </SimpleSource>
>> >>   <SimpleSource>
>> >>     <SourceFilename
>> >> relativeToVRT="1">po_172227_nir_0000000.tif</SourceFilename>
>> >>     <SourceBand>1</SourceBand>
>> >>     <SourceProperties RasterXSize="3001" RasterYSize="2554"
>> >> DataType="UInt16" BlockXSize="3001" BlockYSize="256"/>
>> >>     <SrcRect xOff="0" yOff="0" xSize="3001" ySize="2554"/>
>> >>     <DstRect xOff="0" yOff="0" xSize="3001" ySize="2554"/>
>> >>   </SimpleSource>
>> >>   <SimpleSource>
>> >>     <SourceFilename
>> >> relativeToVRT="1">po_172227_red_0000000.tif</SourceFilename>
>> >>     <SourceBand>1</SourceBand>
>> >>     <SourceProperties RasterXSize="3001" RasterYSize="2554"
>> >> DataType="UInt16" BlockXSize="3001" BlockYSize="256"/>
>> >>     <SrcRect xOff="0" yOff="0" xSize="3001" ySize="2554"/>
>> >>     <DstRect xOff="0" yOff="0" xSize="3001" ySize="2554"/>
>> >>   </SimpleSource>
>> >>  </VRTRasterBand>
>> >> </VRTDataset>
>> >>
>> >> Thanks
>> >> Agus
>> >> _______________________________________________
>> >> Qgis-user mailing list
>> >> Qgis-user at lists.osgeo.org
>> >> http://lists.osgeo.org/mailman/listinfo/qgis-user
>> >
>> > _______________________________________________
>> > Qgis-user mailing list
>> > Qgis-user at lists.osgeo.org
>> > http://lists.osgeo.org/mailman/listinfo/qgis-user
>> >
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>



More information about the Qgis-user mailing list