[postgis-users] PostGIS without JTS or GEOS

TECHER David davidtecher at yahoo.fr
Wed Mar 15 05:36:10 PST 2006


I think U need to used Geos for what U are doing!


As Nico said, from PostGIS doc

----------------------------------------------------------------------------------------------

PointOnSurface(geometry)

    Return a Point guaranteed to lie on the surface

    Implemented using GEOS

    OGC SPEC 3.2.14.2 and 3.2.18.2 -

--------------------------------------------------------------------------------------------

One solution I give is first trying to backup your database with only
the tables then
rebuild postgis with geos

So let's go:

Backup only for tables:
===============

su 'postgres_usre_you_are'

export yourdatabase=????????;for i in $(psql -d ${yourdatabase} -AtF ""
-c "select tablename  from pg_tables where (tablename not like 'pg_%')
and (tablename not like 'spatial_ref_sys' ) and (tablename not like
'sql_%' ) and (tablename not like 'geom%' ) order by tablename");do 
pg_dump -civOt $i $yourdatabase >> ~/${yourdatabase}_dump.sql;done

replace ????? by then name of your database

cd /path/to/postgis-1.0.0/sources

make uninstall clean distclean

cd ..
 
wget http://geos.refractions.net/geos-2.2.1.tar.bz2

tar xjjf geos-2.2.1.tar.bz2

cd geos-2.2.1;./configure && make && make install

If your need to specify the gcc version U could try

CC=gcc-3.4 CXX=g++-3.4 ./configure

before make and make install

See if geos it installed by trying

geos-config --version

then

try

which geos-config

if u have something like '/usr/local/bin/geos-config'

do

cat /etc/ld.so.conf

then see if it send U something like '/usr/local/lib' or else

do echo /usr/local/lib >> /etc/ld.so.conf

then

ldconfig

cd /path/to/postgis-1.0.0/sources

./configure --enable-autoconf --with-geos=$(which geos-config)

N.B: Since 1.0.0 is not available on PostGIS I'm very sure for the
options above so try ./configure --help for the option for geos

make

make install

su 'postgres_usre_you_are'

dropdb yourdatase
createdb yourdatabse and so on


then psql -d yoyrdatabase -f ~/"your_database"_dump.sql




	

	
		
___________________________________________________________________________ 
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.
Téléchargez sur http://fr.messenger.yahoo.com



More information about the postgis-users mailing list