Changeset 1147

Show
Ignore:
Timestamp:
05/19/09 20:08:18 (15 months ago)
Author:
dane
Message:

+copy/pickle support for Coord objects - see #345

Files:
1 modified

Legend:

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

    r330 r1147  
    2525#include <mapnik/coord.hpp> 
    2626 
     27using mapnik::coord; 
     28 
     29struct coord_pickle_suite : boost::python::pickle_suite 
     30{ 
     31    static boost::python::tuple 
     32    getinitargs(const coord<double,2>& c) 
     33    { 
     34        using namespace boost::python; 
     35        return boost::python::make_tuple(c.x,c.y); 
     36    } 
     37}; 
     38 
    2739void export_coord() 
    2840{ 
    2941    using namespace boost::python; 
    30     using mapnik::coord; 
    3142    class_<coord<double,2> >("Coord",init<double,double>()) 
     43        .def_pickle(coord_pickle_suite()) 
    3244        .def_readwrite("x", &coord<double,2>::x) 
    3345        .def_readwrite("y", &coord<double,2>::y)