[gdal-dev] Python geometry.Transform() returns code 6

Gregor at HostGIS gregor at hostgis.com
Thu Dec 9 12:15:10 EST 2010


> IIRC, older versions of the bindings silenced error messages
 > to stdout but didn't throw exceptions by default.  Gregor
 > might try issuing 'osr.UseExceptions()'

Ah, good advice hobu. I had set ogr.UseExceptions() in my real code, but 
not osr's version. The resulting error is slightly less vague:

 >>> firstgeom.Transform(coordTrans)
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File 
"/usr/lib64/python2.5/site-packages/GDAL-1.7.1-py2.5-linux-x86_64.egg/osgeo/ogr.py", 
line 3770, in Transform
     return _ogr.Geometry_Transform(self, *args)
RuntimeError: OGR Error: General Error

Without the exceptions, the return was simply the number 6, and I hit 
the source to discover that this indicates a general error.

-- 
HostGIS, Open Source solutions for the global GIS community
Greg Allensworth - SysAdmin, Programmer, GIS Person, Security
    Network+   Server+   A+   Security+   Linux+
    PHP   PostgreSQL   MySQL   DHTML/JavaScript/AJAX

"No one cares if you can back up — only if you can recover."


More information about the gdal-dev mailing list