Hi all,
I suspect there is a bug in gdal.UseExceptions() in python binding.
I noticed that if a RuntimeError has been generated, following gdal
instructions *raise the same exception*.
It seems that a gdal.ErrorReset() is necessary to reset it.
An example with ipython:
In [2]: from osgeo import gdal
In [3]: gdal.UseExceptions()
In [4]: dataset = gdal.Open('./filename.wrongformat')
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call
last)
/home/fasano/Desktop/test/<ipython console> in <module>()
RuntimeError: `./filename.wrongformat' not recognised as a supported
file format.
In [5]: gdal.GetCacheMax()
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call
last)
/home/fasano/Desktop/test/<ipython console> in <module>()
RuntimeError: `./filename.wrongformat' not recognised as a supported
file format.
In [6]: gdal.ErrorReset()
In [7]: gdal.GetCacheMax()
Out[7]: 41943040
(My gdal version is 1.5.4)
_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev