python-mapnik
python-mapnik copied to clipboard
demo error:mapnik.Shapefile() failure
when I run python demo, an error like that: File "rundemo.py", line 58, in provpoly_lyr.datasource = mapnik.Shapefile(file=path.join(root,'../data/boundaries'), encoding='latin1') File "/usr/local/lib/python2.7/dist-packages/mapnik-0.1-py2.7-linux-x86_64.egg/mapnik/init.py", line 370, in Shapefile return CreateDatasource(keywords) TypeError: No to_python (by-value) converter found for C++ type: std::shared_ptrmapnik::datasource
When I run C++ demp: an error like that: running demo ...
std::exception: Could not create datasource for type: 'shape' (no datasource plugin directories have been successfully registered)
but ,when check the 'shape' in mapnik.DatasourceCache.plugin_names()', it retun true.
@wanghaiyang1930 - this is related to https://github.com/mapnik/python-mapnik/pull/79 and should be fixed in HEAD.
When execute ./rundemo occurs errors Only modify file rundemo.cpp in lines:
Lines 57 and 58 to datasource_cache::instance().register_datasources("/usr/local/lib/mapnik/input/"); freetype_engine::register_font("/usr/local/lib/mapnik/fonts/DejaVuSans.ttf");
Line 232 to p["file"]="../data/boundaries";
Line 246 to p["file"]="../data/qcdrainage";
Line 257 to p["file"]="../data/ontdrainage";
Line 269 to p["file"]="../data/boundaries_l";
Line 281 to p["file"]="../data/roads";
Line 297 to p["file"]="../data/popplaces";
To back ./mapnik And now execute make make test sudo make install :)
@KyryIx - please, clarify what is the issue here ? Both data-sources and font registration paths must be correctly set.
OK :)
This error is still present. Please update your demos