diff --git a/bindings/python/mapnik_coord.cpp b/bindings/python/mapnik_coord.cpp index 42cd37ff7..2b98fbaf8 100644 --- a/bindings/python/mapnik_coord.cpp +++ b/bindings/python/mapnik_coord.cpp @@ -24,11 +24,23 @@ #include #include +using mapnik::coord; + +struct coord_pickle_suite : boost::python::pickle_suite +{ + static boost::python::tuple + getinitargs(const coord& c) + { + using namespace boost::python; + return boost::python::make_tuple(c.x,c.y); + } +}; + void export_coord() { using namespace boost::python; - using mapnik::coord; class_ >("Coord",init()) + .def_pickle(coord_pickle_suite()) .def_readwrite("x", &coord::x) .def_readwrite("y", &coord::y) .def(self == self) // __eq__