[Gdal-dev] Error propagation from GDAL.Dataset.GetGeoTransform() in C#

yonil l_yoni at yahoo.com
Tue Nov 18 06:44:01 EST 2008


I'm trying to use the following code to detect a possible error caused 
by the GetGeoTransform() call, but it reports no error has occurred, and
does not raise an exception.

Making this call on the same dataset from native C code returns 
CE_Failure from GDALGetGeoTransform().

Here's the C# snippet:

_dataset.GetGeoTransform(temp); // returns normally with default values
OSGeo.GDAL.CPLErr err = Gdal.GetLastErrorType();
if (OSGeo.GDAL.CPLErr.CE_None != err)
{
     throw new ApplicationException("GetGeoTransform() failed.");
}

Am I doing anything wrong, or is it somehow a problem with the C# 
bindings? I've built the C# bindings from the GDAL v1.5.3 release, 
running on Win32.

I've uploaded a small C# project with a sample dataset that is causing this
to occur.
http://www.nabble.com/file/p20558001/GDALWrapTester.rar GDALWrapTester.rar 


-- 
View this message in context: http://www.nabble.com/Error-propagation-from-GDAL.Dataset.GetGeoTransform%28%29-in-C--tp20558001p20558001.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.



More information about the gdal-dev mailing list