[gdal-dev] Gdalinfo.exe is magic, why not bindings ?

Even Rouault even.rouault at mines-paris.org
Sat Nov 26 11:55:26 EST 2011


Le samedi 26 novembre 2011 14:21:35, Florent JITIAUX a écrit :
> Hi,
> 
> first thanks for all tools and bidings.
> 
> I have a question about Gdalinfo.exe and gdal binding programs.
> I have an USRP map but with some fields errors. When i try to load it with
> the java Gdalinfo, the open failed (the dataset is null). When i use
> gdalinfo.exe to read the map, the error mesage is the same but after
> gdalinfo succeeds to identify the driver and get informations about the
> map. I found the IdentyDriver method of Gdal class which is able to read
> the driver of my map but impossible to find a way to read informations
> with the java binding. That's why i say gdalinfo.exe is magic.
> That's the same with Gdalbuildvrt. With the java binding it's impossible to
> create a vrt because the dataset is null but it works with the .exe.

There's no magic here, but it is true that Java, Python and perhaps other 
bindings will return none/null if an error is emitted in the Open() method of 
the driver, even if it  returned a non-null dataset. There was a rationale for 
this. See http://trac.osgeo.org/gdal/changeset/11529 / 
http://trac.osgeo.org/gdal/ticket/1635

What should be done probably is turn the CE_Failure into a CE_Warning if the 
dataset opened by gdalinfo is readable. What is the *exact* error message you 
are seing ?


More information about the gdal-dev mailing list