Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#2706 closed feature (fixed)

WKT.write(collection) fails

Reported by: strk Owned by: tschaub
Priority: minor Milestone: 2.11 Release
Component: Format.WKT Version: 2.9
Keywords: Cc:
State:

Description

It seems to me that WKT.write() fails when passed a Feature whose geometry is a Geometry.Collection. This was tested adding such a testcase in WKT.html.

Won't have time shortly for working on a patch so I tought to file it to avoid forgetting about the issue.

Oh, since I looked at it, the problem lies in lack of a 'geometrycollection' element in the 'extract' property of WKT class. Most likely portion of the code in 'write' should be put in its own function (ie: extractGeometry) to reuse it from the 'geometrycollection' extracter in a recursive manner.

Attachments (3)

WKT.write_collection.patch (2.8 KB) - added by strk 5 years ago.
WKT_test_collection_write.patch (3.2 KB) - added by strk 5 years ago.
patch to the etestcase
test_Format_WKT_read_collection.patch (3.8 KB) - added by strk 5 years ago.

Download all attachments as: .zip

Change History (9)

Changed 5 years ago by strk

comment:1 Changed 5 years ago by strk

The attached patches implement and test proper WKT.write for GEOMETRYCOLLECTION

Changed 5 years ago by strk

patch to the etestcase

Changed 5 years ago by strk

comment:2 Changed 5 years ago by strk

test_Format_WKT_read_collection.patch, replacing WKT_test_collection_write.patch, also adds a fix in WKT.read(geom_array) testing, which is missing in trunk, replaced with a duplicate of WKT.write(geom_array) instead.

comment:3 Changed 5 years ago by strk

  • Component changed from general to Format.WKT
  • Owner set to tschaub

Sounds like a patch for WKT.write was already provided in #2240. I haven't looked at it

comment:4 Changed 4 years ago by tschaub

  • Status changed from new to assigned

Reviewing this now. I see that the test_Format_WKT_read_collection.patch and WKT_test_collection_write.patch patches are the same. strk, did you mean to attach a different patch for reading? If so, a separate ticket would probably be easiest at this point. Thanks.

comment:5 Changed 4 years ago by tschaub

  • Resolution set to fixed
  • Status changed from assigned to closed

In w/ r10971.

comment:6 Changed 4 years ago by strk

Great. Better 6 months later than never :P

Note: See TracTickets for help on using tickets.