Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Introduction

Do this slowly and carefully, and if your lucky, you won't get hurt.

keywords

Fedora 8
Fedora 9
centos
proj.4
geos
postgis
postgresql

proj4 install
geos install

In order to build postGIS you need some artifacts from the postgresQL development package. This is not as straight forward as it should be.<br>
I encourage you to take a few minutes to read this through. First, your "disto repository" is not likely to be up to date with respect to postgresql packages. In other words, if you blindly type "yum install postgresql-devel", you may have trouble getting everything installed properly. I've seen errors regarding missing libraries and the like. To avoid the fuss, when you are installing postgresql packages, use the postgresql repositories instead of your ditsro repsository.

Here is how you do that. You should read this from top to bottom.
http://yum.pgsqlrpms.org/howtoyum.php
Also read this; you can safley skip sections on this page.
http://www.postgresonline.com/journal/index.php?/archives/45-An-Almost-Idiots-Guide-to-PostgreSQL-YUM.html

Did you do your reading?

OK, now we build postGIS.

$ yum install postgresql-devel
$ tar xvfz postgis-1.3.1.tar.gz
$ cd postgis-1.3.1
$ ./configure \--with-pgsql=/usr/bin/pg_config \--with-geos=/usr/local/bin/geos-config \--with-proj=/usr/local
$ make
$ su
$ make install
$ exit

Errors I've seen:
error

configure: error: Can't find 'flex'

solution

yum install flex

make a postgis_template

This is optional.
This page shows how to create and use a db template:
http://geospatial.nomad-labs.com/2006/12/24/postgis-template-database/

make a database

You can make a postgis db "by hand" (see below)<br>
Or you can make a postgis db by using the template (see previous)<br>

$ su postgres
$ cd
$ createdb sfmaps
$ createlang plpgsql sfmaps
$ psql \-f /usr/share/lwpostgis.sql \-d sfmaps (error: could not load library)
$ psql \-f /usr/share/spatial_ref_sys.sql \-d sfmaps
$ psql sfmaps

if you encounter this error:

libgeos_c.so.1: cannot open shared object file: No such file or directory<br>

do this<br>
Add /usr/local/lib to the dynamic linker run-time bindings

echo '/usr/local/lib' >> /etc/ld.so.conf.d/local-lib.conf
ldconfig
  • No labels