From 424980d92b88032c4bae67db8cb5bc98f41aafda Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 20 May 2009 00:18:46 +0000 Subject: [PATCH] via a layer object pickle datasource params rather than the datasource object itself - see #345 --- bindings/python/mapnik_layer.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bindings/python/mapnik_layer.cpp b/bindings/python/mapnik_layer.cpp index 856a537da..d0f67d91a 100644 --- a/bindings/python/mapnik_layer.cpp +++ b/bindings/python/mapnik_layer.cpp @@ -30,10 +30,11 @@ // mapnik #include #include +#include using mapnik::Layer; using mapnik::parameters; -using mapnik::datasource; +using mapnik::datasource_cache; struct layer_pickle_suite : boost::python::pickle_suite @@ -53,7 +54,7 @@ struct layer_pickle_suite : boost::python::pickle_suite { s.append(style_names[i]); } - return boost::python::make_tuple(l.abstract(),l.title(),l.clear_label_cache(),l.getMinZoom(),l.getMaxZoom(),l.isQueryable(),l.datasource(),s); + return boost::python::make_tuple(l.abstract(),l.title(),l.clear_label_cache(),l.getMinZoom(),l.getMaxZoom(),l.isQueryable(),l.datasource()->params(),s); } static void @@ -101,8 +102,8 @@ struct layer_pickle_suite : boost::python::pickle_suite if (state[6]) { - boost::shared_ptr ds = extract >(state[6]); - l.set_datasource(ds); + mapnik::parameters params = extract(state[6]); + l.set_datasource(datasource_cache::instance()->create(params)); } boost::python::list s = extract(state[7]);