#3092 closed defect (invalid)
poBand->SetMetadataItem( "source_0", szFilterSourceXML, "new_vrt_sources" ) doesn't support VRTRawRasterBand
Reported by: | arb | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | default | Version: | unspecified |
Severity: | normal | Keywords: | |
Cc: |
Description
When creating a VRT one uses this to describe the data source poBand->SetMetadataItem( "source_0", szFilterSourceXML, "new_vrt_sources" );
This works fine for the examples, KernelFilteredSource and presumably other sources based on SimpleSource.
It doesn't appear to work when trying to describe a VRTRawRasterBand subclass. The intention is to get output similar to: <VRTRasterBand dataType="UInt16" band="1" subClass="VRTRawRasterBand"> <SourceFilename relativetoVRT="1">file.dat</SourceFilename> <ByteOrder>LSB</ByteOrder> </VRTRasterBand>
The output is usually just <VRTRasterBand dataType="UInt16" band="1"> so how can the subclass be set? (A perusal of the source code suggested only SimpleSource-style VRTs could be written)
Change History (2)
comment:1 by , 15 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 by , 15 years ago
The VRT tutorial didn't have an example for specifying parameters of VRTRawRasterBand. Done in r17493
Andrew,
The SetMetadatItem("source_0", xml, "new_vrt_sources") is a convenience that it is not indented to support anything else than the sources deriving from the VRTSource class : VRTSimpleSource, VRTComplexSource, VRTAveragedSource. These sources can only be inserted into a VRTSourcedRasterBand (which is the default type of band when using dataset.AddBand() or driver.Create()). Here you want a VRTRawRasterBand, so you can't use that mechanism.
See http://trac.osgeo.org/gdal/browser/trunk/autotest/gdrivers/vrtrawlink.py on how to create a VRT dataset with RawRasterBands