Ticket #608 (closed feature: fixed)

Opened 6 years ago

Last modified 6 years ago

add WKT support

Reported by: tschaub Owned by: tschaub
Priority: minor Milestone: 2.4 Release
Component: Format Version:
Keywords: Cc:
State:

Description

Here's an example:  http://dev.openlayers.org/sandbox/tschaub/wkt/examples/wkt.html

The following patch includes the new format, tests, and the above example. If this makes it in, I'll make a multi-purpose example that demonstrates all vector formats.

Also, I think I'll propose next that geometry.toString be changed simply to

return OpenLayers.Format.WKT.prototype.write(this);

This would mean that all geometries would require Format/WKT.js - but it seems like a pretty slick solution. I'll leave that for another patch.

Note that we already have one user who is using this to insert feaatues into an Oracle db with ArcSDE.

Attachments

wkt.patch Download (33.0 KB) - added by tschaub 6 years ago.
read/write support for WKT

Change History

Changed 6 years ago by tschaub

read/write support for WKT

Changed 6 years ago by tschaub

  • keywords review added

I'll happily commit if this passes review.

Changed 6 years ago by sderle

looks great! nice work. please apply.

Changed 6 years ago by crschmidt

Please be aware that the vector layer renderers use 'toString' to get a value which they use for printing points. If the toString of geometries changes, there needs to be another value which the renderers can use.

Changed 6 years ago by crschmidt

I'm a doofus. They use toShortString, not toString. I'm in favor of making WKT the default encoding of geometry objects as strings.

Changed 6 years ago by tschaub

  • keywords review removed
  • status changed from new to closed
  • resolution set to fixed

committed in r2942

Note: See TracTickets for help on using tickets.