n fact in the Gdalinfo.java program or in the Gdalinfo.c, if the dataset
is null the program print the message error and call the system.exit().<br>The
message says there is a problem with a value (if i remember error 4)
and the last error is "open failed -1". The message is exactly the same
with Gdalinfo.exe<br>
I will check the file, maybe it's come from a wrong value in a controlrecord.<br><br>I also tried to understand why this map works with Qgis but it's because they use the Gdalinfo.exe and get the ouput.<br><br>As
you say Ari, read files with errors is not a good thing. But the
question for the programmer (like me) is : don't read a map if there is
just a litlle error in one file or read a map even if there is an error
but the raster and data like width, height and georeferencing are
readable.<br>
In my case i have to read these maps. And i'd preffered to load it in
the dataset java class than get informations with the gdalinfo.exe and
build a vrt with Gdalbuildvrt.exe<br><br><div class="gmail_quote">2011/11/26 Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Le samedi 26 novembre 2011 14:21:35, Florent JITIAUX a écrit :<br>
<div class="im">> Hi,<br>
><br>
> first thanks for all tools and bidings.<br>
><br>
> I have a question about Gdalinfo.exe and gdal binding programs.<br>
> I have an USRP map but with some fields errors. When i try to load it with<br>
> the java Gdalinfo, the open failed (the dataset is null). When i use<br>
> gdalinfo.exe to read the map, the error mesage is the same but after<br>
> gdalinfo succeeds to identify the driver and get informations about the<br>
> map. I found the IdentyDriver method of Gdal class which is able to read<br>
> the driver of my map but impossible to find a way to read informations<br>
> with the java binding. That's why i say gdalinfo.exe is magic.<br>
> That's the same with Gdalbuildvrt. With the java binding it's impossible to<br>
> create a vrt because the dataset is null but it works with the .exe.<br>
<br>
</div>There's no magic here, but it is true that Java, Python and perhaps other<br>
bindings will return none/null if an error is emitted in the Open() method of<br>
the driver, even if it returned a non-null dataset. There was a rationale for<br>
this. See <a href="http://trac.osgeo.org/gdal/changeset/11529" target="_blank">http://trac.osgeo.org/gdal/changeset/11529</a> /<br>
<a href="http://trac.osgeo.org/gdal/ticket/1635" target="_blank">http://trac.osgeo.org/gdal/ticket/1635</a><br>
<br>
What should be done probably is turn the CE_Failure into a CE_Warning if the<br>
dataset opened by gdalinfo is readable. What is the *exact* error message you<br>
are seing ?<br>
</blockquote></div><br>