安装PostGIS的问题

ava*_*tar 14 postgresql ubuntu postgis ubuntu-10.10

我正在尝试按照以下说明安装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
Run Code Online (Sandbox Code Playgroud)

但它没有通过"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.
Run Code Online (Sandbox Code Playgroud)

所以我在网上找到了一个地方,上面写着这样的话:

--with-pgconfig = FILE PostgreSQL提供了一个名为pg_config的实用程序,可以使PostGIS等扩展程序找到PostgreSQL安装目录.使用此参数(--with-pgconfig =/path/to/pg_config)手动指定PostGIS将构建的特定PostgreSQL安装.

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

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

Nic*_*vén 27

您需要安装地理位置.

但最简单的安装方法是从ubuntugis-unstable存储库:

sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update 
sudo apt-get install postgis 
Run Code Online (Sandbox Code Playgroud)

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

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

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

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

CREATE EXTENSION postgis;
Run Code Online (Sandbox Code Playgroud)

HTH


小智 5

我用postgres 9.0测试了centos 5我遇到了这个问题.我修复了yum install postgresql90-devel然后./configure --with-pgconfig =/usr/pgsql-9.0/bin/pg_config