[Gdal-dev] RE: VRT File Format

Matt Hanson mhanson at photon.com
Wed Sep 20 16:01:29 EDT 2006


So, can anyone verify VRT files work ?    My sample VRT is as simple as the one in the documentation and GDAL is not parsing it correctly.

________________________________

From: Matt Hanson
Sent: Thu 9/14/2006 5:07 PM
To: gdal-dev at lists.maptools.org
Subject: RE: VRT File Format


In looking at this more, I don't see how the current VRT driver can read any virtual file correctly.   Is anyone else able to read VRT files in 1.3.2?
 
The problem is that vrtsourcedrasterband is not expecting the <VRTRasterBand> XML element to have any XML attributes (i.e. <VRTRasterBand dataType="float32"> associated with it.   It expects the first child to be an Element also.    
 
I would submit a bug report, but since this bug means broken VRT files I wanted to check to see if anyone else was using VRT's with success.   And if you are reading them with 1.3.2 then can you post the VRT file you're using ?    Thanks!
 
matt

________________________________

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


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