python-mapnik icon indicating copy to clipboard operation
python-mapnik copied to clipboard

demo error:mapnik.Shapefile() failure

Open artemp opened this issue 9 years ago • 5 comments

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.

artemp avatar Jan 28 '16 12:01 artemp

@wanghaiyang1930 - this is related to https://github.com/mapnik/python-mapnik/pull/79 and should be fixed in HEAD.

artemp avatar Jan 28 '16 12:01 artemp

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 avatar Feb 21 '18 03:02 KyryIx

@KyryIx - please, clarify what is the issue here ? Both data-sources and font registration paths must be correctly set.

artemp avatar Feb 23 '18 09:02 artemp

OK :)

KyryIx avatar Feb 23 '18 16:02 KyryIx

This error is still present. Please update your demos

geoeo avatar Oct 08 '20 09:10 geoeo