[Gdal-dev] RE: VRT File Format

Matt Hanson mhanson at photon.com
Tue Sep 12 16:09:51 EDT 2006


I've tracked down this error to vrtsourcedrasterband.cpp, line 286, where is processed the sources from the VRT set.
I can't really figure out what's happening. It loks like the it's supposed to step through the XML elements of the tree, but on the first one (which is an XML Attribute, dataType) it generates an error because VRTDriver::ParseSource checks to see if it's an element which it's not, it's an attribute.   So it triggers the CPLError in vrtdriver.cpp, line 134.
 
My VRT looks correct to me, but I must be doing something wrong because if this really is an error it wouldn't work on any VRT dataset.
 
 
*************************************************
if( poBand != NULL 

&& poBand->XMLInit( psChild, pszVRTPath ) == CE_None )

{

SetBand( ++nBands, poBand );

}

else

{

if( poBand )

delete poBand; 

return CE_Failure;

}

***************************************

poBand is evaluating to Null, bu

 


________________________________

From: Matt Hanson
Sent: Tue 9/12/2006 3:21 PM
To: gdal-dev at lists.maptools.org
Subject: VRT File Format


Encountered another problem with the VRT files, but different then my other post - to work around that issue for now I am using absolute pathnames.   But when I try to read in the VRT file below I get
ERROR 1: Corrupt of empty VRT source XML document.
 
Here's my VRT file:
 
*********************************************************************************************
<VRTDataset rasterXSize="400" rasterYSize="400">

<VRTRasterBand dataType="Int16" band="1">

<SimpleSource>

<SourceFilename>C:\Documents and Settings\mhanson\Flux\testimages\MISI_28jun02</SourceFilename>

<SourceBand>1</SourceBand>

<SrcRect xOff="0" yOff="0" xSize="400" ySize="400"/>

<DstRect xOff="0" yOff="0" xSize="400" ySize="400"/>

</SimpleSource>

</VRTRasterBand>

</VRTDataset>

********************************************************************





More information about the Gdal-dev mailing list