Changeset 1159

Show
Ignore:
Timestamp:
05/24/09 02:02:33 (14 months ago)
Author:
dane
Message:

+add pickle support to projection class - see #345

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/bindings/python/mapnik_projection.cpp

    r525 r1159  
    2525#include <mapnik/coord.hpp> 
    2626#include <mapnik/projection.hpp> 
     27 
     28using mapnik::projection; 
     29 
     30struct projection_pickle_suite : boost::python::pickle_suite 
     31{ 
     32    static boost::python::tuple 
     33    getinitargs(const projection& p) 
     34    { 
     35        using namespace boost::python; 
     36        return boost::python::make_tuple(p.params()); 
     37    } 
     38}; 
    2739 
    2840namespace { 
     
    7486{ 
    7587    using namespace boost::python;  
    76     using mapnik::projection; 
    77      
     88 
    7889    class_<projection>("Projection", init<optional<std::string const&> >()) 
     90        .def_pickle(projection_pickle_suite()) 
    7991        .def ("params", make_function(&projection::params, 
    8092                                      return_value_policy<copy_const_reference>()))