Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#1992 closed defect (wontfix)

OGR_G_CreateFromWkt does not work with Linear Rings.

Reported by: jbronn Owned by: Mateusz Łoskot
Priority: normal Milestone:
Component: default Version: svn-trunk
Severity: normal Keywords: wkt linearring
Cc: jbronn@…

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 (1)

linearring_createfromwkt.patch (451 bytes ) - added by jbronn 16 years ago.
Patch for ogrgeometryfactory.cpp that adds support for linear rings to OGR_G_CreateFromWkt.

Download all attachments as: .zip

Change History (9)

by jbronn, 16 years ago

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

comment:1 by warmerdam, 16 years ago

Milestone: 1.5.0
Owner: changed from warmerdam to Mateusz Łoskot

Mateusz,

Please apply if it seems appropriate.

comment:2 by hobu, 16 years ago

Milestone: 1.5.0

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...

comment:3 by Mateusz Łoskot, 16 years ago

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

comment:4 by warmerdam, 16 years ago

Resolution: wontfix
Status: newclosed

comment:5 by springmeyer, 16 years ago

When is a new SF spec anticipated?

comment:6 by warmerdam, 16 years ago

OGC issued a new simple features geometry specification a year or two ago. There is no schedule for it's implementation in OGR. Does that answer the question? Does it relate to this ticket?

comment:7 by springmeyer, 16 years ago

I am referring to hobu's statement above of ' I think we should defer this until the new SF spec comes out and see how things have changed.'

But yes, if there is schedule for implementation, that does answer my question (ie that there is no reason to re-open or re-consider this ticket)

thanks.

comment:8 by springmeyer, 16 years ago

Upps, I meant: 'But yes, if there is NO PLANNED schedule for implementation, that does answer my question (ie that there is no reason to re-open or re-consider this ticket)'

Note: See TracTickets for help on using tickets.