[Gdal-dev] RE: VRT File Format
Frank Warmerdam
warmerdam at pobox.com
Thu Sep 21 12:46:49 EDT 2006
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
More information about the Gdal-dev
mailing list