创建 PostGIS 模板数据库时出现问题

发布于 2024-10-10 11:13:58 字数 1121 浏览 0 评论 0原文

我正在尝试为我的 GeoDjango 应用程序在 Mac OS X Snow Leopard (10.6) 上构建 PostGIS (1.5) 的模板地理数据库。

我正在关注: http: //docs.djangoproject.com/en/dev/ref/contrib/gis/install/#creating-a-spatial-database-template-for-postgis

我已经成功做到了提供的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

心清如水 2024-10-17 11:13:58

检查您是否安装了正确的必备库。当我安装 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.

拒绝两难 2024-10-17 11:13:58

以下是我为 PostGIS 设置模板数据库的方法
使用 KML 文件将滑坡导入 PostGIS

Here's how I set up my template database for PostGIS
Landsliding Into PostGIS With KML Files

吃→可爱长大的 2024-10-17 11:13:58

此错误表明未找到共享对象。最明显的原因是 PostGIS 尚未安装(正确)。此外,contrib/postgis-1.5 文件夹中的 SQL 脚本的安装顺序也很重要。

我已经成功地使用了这个命令和(Linux shell 命令):

$ psql -U postgres -d database -f /usr/share/postgresql/9.0/contrib/_int.sql
$ psql -U postgres -d database  -f /usr/share/postgresql/9.0/contrib/pg_trgm.sql
$ psql -U postgres -d database  -f /usr/share/postgresql/9.0/contrib/postgis-1.5/postgis.sql
$ psql -U postgres -d database  -f /usr/share/postgresql/9.0/contrib/postgis-1.5/spatial_ref_sys.sql

在此之后,应该有大约 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:

$ psql -U postgres -d database -f /usr/share/postgresql/9.0/contrib/_int.sql
$ psql -U postgres -d database  -f /usr/share/postgresql/9.0/contrib/pg_trgm.sql
$ psql -U postgres -d database  -f /usr/share/postgresql/9.0/contrib/postgis-1.5/postgis.sql
$ psql -U postgres -d database  -f /usr/share/postgresql/9.0/contrib/postgis-1.5/spatial_ref_sys.sql

After this, there should be somewhere around 800 functions, a few new types and some overloaded operator available.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文