加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

postgresql – 安装PostGIS的问题

发布时间:2020-12-13 16:26:55 所属栏目:百科 来源:网络整理
导读:我正在按照以下说明安装PostGIS: wget http://postgis.refractions.net/download/postgis-1.5.2.tar.gztar 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 --defaul
我正在按照以下说明安装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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读