#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)
Change History (9)
by , 16 years ago
Attachment: | linearring_createfromwkt.patch added |
---|
comment:1 by , 16 years ago
Milestone: | → 1.5.0 |
---|---|
Owner: | changed from | to
Mateusz,
Please apply if it seems appropriate.
comment:2 by , 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:4 by , 16 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:6 by , 15 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 , 15 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 , 15 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)'
Patch for ogrgeometryfactory.cpp that adds support for linear rings to OGR_G_CreateFromWkt.