[Gdal-dev] RE: VRT File Format

Matt Hanson mhanson at photon.com
Thu Sep 21 13:37:52 EDT 2006


Frank , you are correct about two different versions:
the gdalinfo I was using was built on my cygwin a while ago: 1.3.1 (2005/10/04)
and of course the library I was linking to was newer: 1.3.2 from CVS (2006/05/02), AND I'm building with Visual Studio.
 
So, I called gdalinfo.exe, which is the CVS version from a week or two ago, and that generates the same error as my simple program.  So, there still seems to be a bug It looks like this is probably an issue with the Windows build.   I'm currently rebuilding my cygwin with the same version as windows to verify, but I suspect that since it ran for you that I won't have a problem with it.
 
Any suggestions?
 
 

________________________________

From: Frank Warmerdam [mailto:warmerdam at pobox.com]
Sent: Thu 9/21/2006 12:46 PM
To: Matt Hanson
Cc: gdal-dev at lists.maptools.org
Subject: Re: [Gdal-dev] RE: VRT File Format



Matt Hanson wrote:
> This is indeed interesting.  I took the sample and changed the filename too.   I tried gdalinfo and it works.    But my code still wasn't working (corrupt XML file error).  So, I made this very simple program, even switched to the C API.  And it does not work.   I've looked at gdalinfo.c and can't see why there would be any difference.   Someone on the list emailed and suggested I avoid spaces in my filenames.  I've done that too, and still doesn't work yet gdalinfo.exe does.
> 
> *******************************************************************
> #include "gdal.h"
>
> int main() {
>
> GDALAllRegister();
>
> const char* fname = "c:\\testimages\\tstimage";
>
> GDALDatasetH ds = GDALOpen(fname,GA_ReadOnly);
>
> return 0;
>
> }
>
> **************************************************
>
> The exact error is:
>
> "ERROR 1: Corrupt or empty VRT source XML document."
>
> Which i've traced back as described before to gdalsourcerasterband.cpp:286 where it appears that while processing the XML elements it expects only XML elements, not attributes.  When it hits the first attribute of VRTRasterBand it throws this error.
>
> I'm not sure if I'm confused why my code doesn't work, or if I'm confused that the gdalinfo code does work !
>
> Sincerely, Confused in New Hampshire

Matt,

The conclusion I would take from this is that you have multiple
versions of the GDAL DLL or shared library and you get getting
these different version in the two cases for some reason or other.

There was a fix in the VRT code in the last month or two that might
have been related.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org <http://osgeo.org/> 







More information about the Gdal-dev mailing list