Ticket #1992 (closed defect: wontfix)

Opened 8 months ago

Last modified 8 months ago

OGR_G_CreateFromWkt does not work with Linear Rings.

Reported by: jbronn Assigned to: mloskot
Priority: normal Milestone:
Component: default Version: svn-trunk
Severity: normal Keywords: wkt linearring
Cc: jbronn@gmail.com

Description

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.

Attachments

linearring_createfromwkt.patch (451 bytes) - added by jbronn on 11/14/07 17:33:51.
Patch for ogrgeometryfactory.cpp that adds support for linear rings to OGR_G_CreateFromWkt.

Change History

11/14/07 17:33:51 changed by jbronn

  • attachment linearring_createfromwkt.patch added.

Patch for ogrgeometryfactory.cpp that adds support for linear rings to OGR_G_CreateFromWkt.

11/14/07 17:45:29 changed by warmerdam

  • owner changed from warmerdam to mloskot.
  • milestone set to 1.5.0.

Mateusz,

Please apply if it seems appropriate.

11/16/07 08:54:27 changed by hobu

  • milestone deleted.

LinearRing? isn't a standalone OGC SF object, and we don't have a WKB representation for LinearRing?. Introducing this patch will mean a bunch of inconsistency without adding a WKB representation that stands alone and supporting ImportFromWKT (which the standard doesn't specify how it should behave). I think we should defer this until the new SF spec comes out and see how things have changed. Additionally, if we are to spend time mucking with WKB/WKT i/o in OGR, we should get the EMPTY support working correctly first, rather than attending to this.

Deferring...

11/16/07 12:33:31 changed by mloskot

Frank, Hobu, according to the last comment, I'm not applying the patch.

11/19/07 19:49:59 changed by warmerdam

  • status changed from new to closed.
  • resolution set to wontfix.