开发者

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 res开发者_StackOverflow社区ult 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?


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.


Here's how I set up my template database for PostGIS Landsliding Into PostGIS With KML Files


This error indicates that the Shared Object is not found. The most obvious reason is that PostGIS has not been installed (properly). Furthermore, the order in which the SQL Scripts from the contrib/postgis-1.5 folder are installed is important.

I have used this order and (Linux shell commands) successfully:

$ psql -U postgres -d database -f /usr/share/postgresql/9.0/contrib/_int.sql
$ psql -U postgres -d database  -f /usr/share/postgresql/9.0/contrib/pg_trgm.sql
$ psql -U postgres -d database  -f /usr/share/postgresql/9.0/contrib/postgis-1.5/postgis.sql
$ psql -U postgres -d database  -f /usr/share/postgresql/9.0/contrib/postgis-1.5/spatial_ref_sys.sql

After this, there should be somewhere around 800 functions, a few new types and some overloaded operator available.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜