创建 PostGIS 模板数据库时出现问题
我正在尝试为我的 GeoDjango 应用程序在 Mac OS X Snow Leopard (10.6) 上构建 PostGIS (1.5) 的模板地理数据库。
我已经成功做到了提供的 postgis.sql 应该运行(即 psql -d template_postgis -f $POSTGIS_SQL_PATH/postgis.sql )
此时,我在尝试运行的第一个 SQL 语句中收到错误。当我在 psql 提示符下尝试时,结果如下:
template_postgis=# CREATE OR REPLACE FUNCTION st_spheroid_in(cstring) RETURNS spheroid AS '/usr/local/pgsql/lib/postgis-1.5','ellipsoid_in' LANGUAGE 'C' IMMUTABLE STRICT;
NOTICE: type "spheroid" is not yet defined
DETAIL: Creating a shell type definition.
ERROR: could not load library "/usr/local/pgsql/lib/postgis-1.5.so": dlopen(/usr/local/pgsql/lib/postgis-1.5.so, 10): Symbol not found: _DatumGetFloat4
Referenced from: /usr/local/pgsql/lib/postgis-1.5.so
Expected in: /opt/local/lib/postgresql83/bin/postgres
in /usr/local/pgsql/lib/postgis1.5.so
有什么想法可能会搞砸吗?
I am trying to build a template geographic database for PostGIS (1.5) on Mac OS X Snow Leopard (10.6) for my GeoDjango application.
I am following:
http://docs.djangoproject.com/en/dev/ref/contrib/gis/install/#creating-a-spatial-database-template-for-postgis
I've managed to come up to the point where the provided postgis.sql should be run (i.e. psql -d template_postgis -f $POSTGIS_SQL_PATH/postgis.sql
)
At that point I am getting an error at the first SQL statement that is tried to be run. When I try that on the psql prompt the result is as follows:
template_postgis=# CREATE OR REPLACE FUNCTION st_spheroid_in(cstring) RETURNS spheroid AS '/usr/local/pgsql/lib/postgis-1.5','ellipsoid_in' LANGUAGE 'C' IMMUTABLE STRICT;
NOTICE: type "spheroid" is not yet defined
DETAIL: Creating a shell type definition.
ERROR: could not load library "/usr/local/pgsql/lib/postgis-1.5.so": dlopen(/usr/local/pgsql/lib/postgis-1.5.so, 10): Symbol not found: _DatumGetFloat4
Referenced from: /usr/local/pgsql/lib/postgis-1.5.so
Expected in: /opt/local/lib/postgresql83/bin/postgres
in /usr/local/pgsql/lib/postgis1.5.so
Any ideas what might have been messed up?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
检查您是否安装了正确的必备库。当我安装 GEOS v2 时,我遇到了同样的错误,升级到 v3 解决了这个问题。
Check that you have the correct pre-requisite libraries installed. I got this same error when I had GEOS v2 installed, and an upgrade to v3 fixed the issue.
以下是我为 PostGIS 设置模板数据库的方法
使用 KML 文件将滑坡导入 PostGIS
Here's how I set up my template database for PostGIS
Landsliding Into PostGIS With KML Files
此错误表明未找到共享对象。最明显的原因是 PostGIS 尚未安装(正确)。此外,contrib/postgis-1.5 文件夹中的 SQL 脚本的安装顺序也很重要。
我已经成功地使用了这个命令和(Linux shell 命令):
在此之后,应该有大约 800 个函数、一些新类型和一些重载运算符可用。
This error indicates that the Shared Object is not found. The most obvious reason is that PostGIS has not been installed (properly). Furthermore, the order in which the SQL Scripts from the contrib/postgis-1.5 folder are installed is important.
I have used this order and (Linux shell commands) successfully:
After this, there should be somewhere around 800 functions, a few new types and some overloaded operator available.