微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

postgresql – 安装PostGIS的问题

我正在按照以下说明安装PostGIS:
wget http://postgis.refractions.net/download/postgis-1.5.2.tar.gz
tar zxvf postgis-1.5.2.tar.gz && cd postgis-1.5.2/
sudo ./configure && make && sudo checkinstall --pkgname postgis-1.5.2 --pkgversion 1.5.2-src --default

但是它没有通过“sudo ./configure”命令.最后一句话:

configure: error: Could not find pg_config within the current path. You may need to try re-running configure with a --with-pgconfig parameter.

所以我在网上看到我发现一个这样的地方说:

–with-pgconfig=FILE Postgresql provides a utility called pg_config to
enable extensions like PostGIS to
locate the Postgresql installation
directory. Use this parameter
(–with-pgconfig=/path/to/pg_config)
to manually specify a particular
Postgresql installation that PostGIS
will build against.

我使用“whereis pg_config搜索pg_config,但是找不到.是指“/etc/postgresql/9.0/main/pg_hba.conf”文件还是文件夹??我错过了什么吗?在这一点上我真的很困惑我猜想比真正的清晰度更好的真正的混乱:).

我使用Postgresql 9 / Ubuntu 10.10.任何帮助将不胜感激.

你需要安装geos.

但最简单的安装方式是从ubuntugis-unstable版本库:

sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update 
sudo apt-get install postgis

如果要从源代码编译,需要安装:

> postgresql-dev(从包管理器)
> libgeos-dev(从包管理器或http://trac.osgeo.org/geos)
> proj4(从包管理器或http://trac.osgeo.org/proj)
> libxml2

如果从包管理器安装,还要检查dev文件

我可能忘记了一些东西,但编译器会告诉你的.

最后,连接到您的数据库并运行以下sql以在空间上启用它:

CREATE EXTENSION postgis;

HTH

原文地址:https://www.jb51.cc/postgresql/192609.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐