我是 manpnik 的新手,面临类似的问题。每次我尝试从 python 地理空间开发手册编译示例代码时,mapnik 都会抛出运行时错误消息。这是问题的根源。
datasource = mapnik.Shapefile(file="world_borders.shp")
polygonLayer = mapnik.Layer("Polygons")
polygonLayer.datasource = datasource
polygonLayer.styles.append("polygonStyle")
error message
Traceback (most recent call last):
File "createExampleMap.py", line 45, in <module>
datasource = mapnik.Shapefile(file="world_borders.shp")
File "C:\Python27\lib\site-packages\mapnik\__init__.py", line 341, in Shapefile
return CreateDatasource(keywords)
RuntimeError: Could not create datasource for type: 'shape'
I'd appreciate help from anyone thanks