Ticket #2706 (closed feature: fixed)

Opened 5 years ago

Last modified 4 years ago

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

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

Change History

Changed 5 years ago by strk

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 4 years ago by strk

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

Changed 4 years ago by strk

  • owner set to tschaub
  • component changed from general to Format.WKT

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

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.

Changed 4 years ago by tschaub

  • status changed from assigned to closed
  • resolution set to fixed

In w/ r10971.

Changed 4 years ago by strk

Great. Better 6 months later than never :P

Note: See TracTickets for help on using tickets.