Ticket #3052 (closed defect: fixed)
poBand->SetMetadataItem( "source_0", szFilterSourceXML, "vrt_sources" ) not supported as expected
| Reported by: | rouault | Owned by: | rouault |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.6.2 |
| Component: | GDAL_Raster | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: | belaid_moa@… |
Description
The VRT tutorial says that poBand->SetMetadataItem?( "source_0", szFilterSourceXML, "vrt_sources" ) in the following snippet should be supported, but the code has never been implemented for SetMetadataItem?() (although it has been for SetMetadata?.)
int nBand;
GDALDriver *poDriver = (GDALDriver *) GDALGetDriverByName( "VRT" );
GDALDataset *poSrcDS, *poVRTDS;
poSrcDS = (GDALDataset *) GDALOpenShared( pszSourceFilename, GA_ReadOnly );
poVRTDS = poDriver->CreateCopy( "", poSrcDS, FALSE, NULL, NULL, NULL );
for( nBand = 1; nBand <= poVRTDS->GetRasterCount(); nBand++ )
{
char szFilterSourceXML[10000];
GDALRasterBand *poBand = poVRTDS->GetRasterBand( nBand );
sprintf( szFilterSourceXML,
"<KernelFilteredSource>"
" <SourceFilename>%s</SourceFilename>1<SourceBand>%d</SourceBand>"
" <Kernel>"
" <Size>3</Size>"
" <Coefs>0.111 0.111 0.111 0.111 0.111 0.111 0.111 0.111 0.111</Coefs>"
" </Kernel>"
"</KernelFilteredSource>",
pszSourceFilename, nBand );
poBand->SetMetadataItem( "source_0", szFilterSourceXML, "vrt_sources" );
}
Change History
Note: See
TracTickets for help on using
tickets.
