Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem creating PostGIS template database

I am trying to build a template geographic database for PostGIS (1.5) on Mac OS X Snow Leopard (10.6) for my GeoDjango application.

I am following: http://docs.djangoproject.com/en/dev/ref/contrib/gis/install/#creating-a-spatial-database-template-for-postgis

I've managed to come up to the point where the provided postgis.sql should be run (i.e. psql -d template_postgis -f $POSTGIS_SQL_PATH/postgis.sql)

At that point I am getting an error at the first SQL statement that is tried to be run. When I try that on the psql prompt the result is as follows:

template_postgis=# CREATE OR REPLACE FUNCTION st_spheroid_in(cstring) RETURNS spheroid AS '/usr/local/pgsql/lib/postgis-1.5','ellipsoid_in' LANGUAGE 'C' IMMUTABLE STRICT;
NOTICE:  type "spheroid" is not yet defined
DETAIL:  Creating a shell type definition.
ERROR:  could not load library "/usr/local/pgsql/lib/postgis-1.5.so": dlopen(/usr/local/pgsql/lib/postgis-1.5.so, 10): Symbol not found: _DatumGetFloat4
  Referenced from: /usr/local/pgsql/lib/postgis-1.5.so
  Expected in: /opt/local/lib/postgresql83/bin/postgres 
 in /usr/local/pgsql/lib/postgis1.5.so

Any ideas what might have been messed up?

like image 297
onurmatik Avatar asked Apr 10 '26 11:04

onurmatik


1 Answers

Check that you have the correct pre-requisite libraries installed. I got this same error when I had GEOS v2 installed, and an upgrade to v3 fixed the issue.

like image 151
MrDBA Avatar answered Apr 12 '26 02:04

MrDBA



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!