artemp/trac2github — Issue #346: Deepcopy and Pickle support for Boost Python objects
Author: artemp
Created: 2011-10-09 20:29:02+00:00
State: open
Labels: Core_Library

Pickling support will be a major advancement for Mapnik as it will allow for:

1) maps (or sub objects) to be serialized in binary form, which will be potentially 1000's of times faster to load than xml and

2) allow for bundling of map objects along with other pickled info (think rendering directives, auxillary styles, serialized data - geojson) and

3) will allow for serialization of Map state as well as the basic styles and layers and

4) will be easy to marshall into pickle-based datastores (think custom django fields or couchdb) and

5) will have potentially lots of other uses

I've added pickling support to a few of the main container objects exposed in the Python bindings. But many more objects need pickling support added.

Copy and Deepcopy are supported in boost via the same support needed for pickling.
http://www.boost.org/doc/libs/1_39_0/libs/python/doc/v2/pickle.html

We need to discuss how to accomplish this (fairly) extensive task to complete full pickle/deepcopy support of Mapnik objects in python, and this ticket will track status (and super-cede other pickle-related tickets).

List of boost python cpp files that need pickle/copy support added or extended:

* source:trunk/bindings/python/mapnik_polygon_pattern_symbolizer.cpp [1155]
* source:trunk/bindings/python/mapnik_polygon_symbolizer.cpp [1157]
* source:trunk/bindings/python/mapnik_rule.cpp [1342] [1344]
* source:trunk/bindings/python/__init__.py [1342] NEEDS REVIEW
* source:trunk/bindings/python/mapnik_symbolizer.cpp [1342] [1344] NEEDS REVIEW
* source:trunk/bindings/python/mapnik_shield_symbolizer.cpp [1158]
* source:trunk/bindings/python/mapnik_datasource.cpp
* source:trunk/bindings/python/mapnik_style.cpp [921] [1149]
* source:trunk/bindings/python/mapnik_parameters.cpp [1162] NEEDS REVIEW
* source:trunk/bindings/python/mapnik_projection.cpp [1159]
* source:trunk/bindings/python/mapnik_line_pattern_symbolizer.cpp [1155]
* source:trunk/bindings/python/mapnik_text_symbolizer.cpp [1164] [1298] [1314]
* source:trunk/bindings/python/mapnik_proj_transform.cpp [1163]
* source:trunk/bindings/python/mapnik_view_transform.cpp [1163]
* source:trunk/bindings/python/mapnik_line_symbolizer.cpp [1160]
* source:trunk/bindings/python/mapnik_coord.cpp [1147]
* source:trunk/bindings/python/mapnik_stroke.cpp [1161] [1164]
* source:trunk/bindings/python/mapnik_point_symbolizer.cpp [1295]
* source:trunk/bindings/python/mapnik_raster_symbolizer.cpp [1154]
* source:trunk/bindings/python/mapnik_query.cpp [1156]