Ticket #1915 (new feature)

Opened 4 years ago

Last modified 4 years ago

CSV write method for OpenLayers.Format.Text

Reported by: fvanderbiest Owned by: tschaub
Priority: minor Milestone: 2.13 Release
Component: Format Version: SVN
Keywords: csv text write Cc:
State: Needs More Work

Description

Here's a patch which adds the write method to OpenLayers.Format.Text

Attachments

patch_ol.format.csv_write_v0.diff Download (1.5 KB) - added by fvanderbiest 4 years ago.
patch_ol.format.csv_write_v1.diff Download (1.9 KB) - added by fvanderbiest 4 years ago.

Change History

Changed 4 years ago by fvanderbiest

Changed 4 years ago by edgemaster

I don't see any handling for the position of the point, which should be included in write methods on our Formats.

Changed 4 years ago by fvanderbiest

Changed 4 years ago by fvanderbiest

Right.

I included two extra columns : _center_x and _center_y which represent the centroid of the geometry bbox.

For points, this should be equivalent to their coordinates.

This also provides an easy "kind of centroid" to other types of geometries.

Changed 4 years ago by crschmidt

  • milestone set to 2.8 Release

Changed 4 years ago by crschmidt

  • state changed from Review to Needs More Work
  • milestone changed from 2.8 Release to 2.9 Release

Having a 'write' method on a format which then can't be usefully passed back into read is not something that I'm interested in. Rather than creating yet another incompatible format, this code should be changed to be as close as possible to the existing MVS format ( http://trac.openlayers.org/wiki/MapViewerService#DataFile).

This means:

  • _center_x / y is out, 'lon' / 'lat' are in
  • Format should read graphicOffset style properties if the exist
  • Format should read externalGraphic property if it exists

I would add one other thing that it should do, which is to (optionally?) write out the WKT geometry, since this actually makes it somewhat useful for non-points, which I'd like to encourage.

Despite my tone here, I'm quite interested in seeing this go in, but it's simply too late for me to help make it happen. If someone can take this on as a task before April 1, I'll gladly help review it. But it iwll need some kind of tests and example usage before it's really ready.

Note: See TracTickets for help on using tickets.