OGR_G_CreateFromWkt does not work when given LINEARRING WKT. An example is below, using the Python bindings:
>>> import ogr
>>> ring = ogr.CreateGeometryFromWkt('LINEARRING(0 0, 0 1, 1 1, 1 0, 0 0)')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/hcm/local/lib/python2.5/site-packages/ogr.py", line 989, in CreateGeometryFromWkt
_obj = _gdal.OGR_G_CreateFromWkt( string, srs_o )
ValueError: OGR_G_CreateFromWkt failed.
I have worked around this in upcoming GeoDjango patches by using OGR_G_CreateGeometry with OGR_G_ImportFromWkt. Attached is a patch for ogrgeometryfactory.cpp which fixed this problem in the svn version.