我正在尝试为 node-mapnik 构建 occi 插件。我的目的是在 tilelive-bridge 节点模块的 node-mapnik 安装中使用该插件。
这是我首先做的:
git clone https://github.com/mapnik/mapnik --depth 5
cd mapnik
git submodule update --init
这样做之后,我可以使用以下方法构建 postgis 插件:
python scons/scons.py INPUT_PLUGINS='postgis'
生成的 postgis.input 文件在 plugins/input 目录中可用。
我克隆了 mapnik/non-core-plugins 存储库,将 occi 插件复制到 plugins/input 目录中,zip-installed oracle instantclient 11.2.0.4.0 版本(rpm 安装没有给我包含文件夹和/或 .h 文件),编辑 SConstruct 文件并将这一行添加到插件对象:
'occi':{'default':False,'path':'OCCI','inc':'occi.h','lib':'clntsh','lang':'C++'},
然后我编辑了 config.py 文件并添加了这些:
OCCI_INCLUDES = '/usr/lib/oracle/10.2.0.3/client/include'
OCCI_LIBS = '/usr/lib/oracle/10.2.0.3/client'
另外,我改变了这一行:
PathVariable('OCCI_LIBS', 'Search path for OCCI library files', '/usr/lib/oracle/10.2.0.3/client' + LIBDIR_SCHEMA_DEFAULT, PathVariable.PathAccept),
进入
PathVariable('OCCI_LIBS', 'Search path for OCCI library files', '/usr/lib/oracle/10.2.0.3/client', PathVariable.PathAccept),
然后我将这 3 行添加到 ~/.bashrc:
export ORACLE_HOME=/usr/lib/oracle/10.2.0.3/client
export PATH=$ORACLE_HOME:$PATH
export LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.3/client
请注意,我使用的不是 10.2.0.3 版本,而是 11.2.0.4.0,我只是将文件夹命名为适合 SConstruct 中的默认文件夹(我也可以更改默认文件夹,但我不确定是默认文件夹,所以我保持原样)。
然后我输入:
source ~/.bashrc
并转到 mapnik 文件夹以运行构建:
python scons/scons.py INPUT_PLUGINS='occi'
它说:
Checking for C++ library clntsh... yes
但它没有说:
Checking for C++ library ociei... yes
就像 github 中 mapnik 的 wiki 的 occi 页面所暗示的那样。
我得到的错误:
In file included from plugins/input/occi/occi_datasource.cpp:24:0:
plugins/input/occi/occi_featureset.hpp:55:43: error: ‘geometry_type’ in namespace ‘mapnik’ does not name a type
const mapnik::geometry_type::types& geom_type,
^
plugins/input/occi/occi_featureset.hpp:55:63: error: expected unqualified-id before ‘&’ token
const mapnik::geometry_type::types& geom_type,
^
plugins/input/occi/occi_featureset.hpp:55:63: error: expected ‘)’ before ‘&’ token
plugins/input/occi/occi_featureset.hpp:55:63: error: expected ‘;’ at end of member declaration
plugins/input/occi/occi_featureset.hpp:55:65: error: ‘geom_type’ does not name a type
const mapnik::geometry_type::types& geom_type,
^
plugins/input/occi/occi_featureset.hpp:61:38: error: ‘mapnik::geometry_type’ has not been declared
void fill_geometry_type (mapnik::geometry_type* geom,
^
scons: *** [plugins/input/occi/occi_datasource.os] Error 1
scons: building terminated because of errors.
Tilelive-bridge 没有附带带有 occi 插件的 mapnik 安装,并且在它们删除 occi 支持之前的版本将无法编译。
你能告诉我我错过了什么吗?
感谢您提前提供的所有帮助