[postgis-users] RESOLVED: could not find function "centroid" in file "/usr/lib/postgresql/postgis.dll"

Rudolf Nottrott rnott at alexandria.UCSB.edu
Sun Jun 27 14:48:20 PDT 2004


Following Strk's question about my PostGIS version, I decided to switch to 
the latest postgis-0.8.2
(I was using postgis-0.8.1 before).

With this, the error went away (the error about missing function "centroid").

Since now all of the following commands execute ok, I think that I finally 
succeeded in installing PostGIS (under Cygwin / Windows XP Pro):
$ createdb  testdb
$ createlang plpgsql testdb
$ psql -d testdb -f 
/cygdrive/c/cygwin/usr/src/postgresql-7.4.3-1/contrib/postgis-0.8.2/postgis.sql
$ psql -d testdb -f 
/cygdrive/c/cygwin/usr/src/postgresql-7.4.3-1/contrib/postgis-0.8.2/spatial_ref_sys.sql

Not knowing the code, I can only speculate about the difference between 
postgis-0.8.2 and 0.8.1, but again following Strk's suggestion I checked
postgis_fn.c c.  In postgis-0.8.2 it has the line
            "#if ! USE_GEOS" in postgis_fn.c,
instead of the following in postgis-0.8.1
            "#ifndef USE_GEOS" in postgis_fn.c

THANKS to all who responded about this tricky error and helped me resolve it.

Rudolf

>From: strk <strk at keybit.net>
>Date: Sun, 27 Jun 2004 12:33:40 +0200
>To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
>Subject: Re: [postgis-users] could not find function "centroid" in file 
>"/usr/lib/postgresql/postgis.dll"
>
>What version of postgis are you trying to build ?
>Check if postgis_fn.c contains a line in the form:
>#if ! USE_GEOS
>If it does try substituting it with:
>#ifndef USE_GEOS
>and recompile
>
>--strk;
>
>On Sat, Jun 26, 2004 at 07:57:00AM -0700, Rudolf Nottrott wrote:
> > I installed PostGIS with PostgreSQL on Windows XP / Cygwin, after 
> switching
> > off proj4 and geos in the Makefile (USE_PROJ=0 and
> > USE_GEOS=0).  I switched off proj4 and geos because I was getting PostGIS
> > compilition errors without them installed, and I felt a bit daunted
> > about  two more installs.
> >
> > WIth
> > USE_PROJ=0 and USE_GEOS=0
> > PostGIS  compiles and installes ok -- I just wanted to get the basic
> > PostGIS going first.
> >
> > Unfortunatley, now when loading the postgis.sql definitions file
> > psql    -d   drg_usgs   -f   postgis.sql
> > I get an error
> >
> > could not find function "centroid" in file 
> "/usr/lib/postgresql/postgis.dll"
> >
> > Any idea what that means, and what to do?
> >
> > Thanks,
> >
> > Rudolf
> >
> > P.S.  I thought that perhaps it relates to the uninstalled geos, so I
> > downloaded and unpacked geos, but then found no installation instructions
> > for it (only an empty README file).
> >
> > >Subject: RE: Using/Compiling PostGIS on WindowsXP/Cygwin for use with
> > >PostgreSQL
> > >Date: Fri, 25 Jun 2004 17:45:25 -0600
> > >From: "Chapman, Martin" <MChapman at sanz.com>
> > >To: "PostGIS Users Discussion" <postgis-users at postgis.refractions.net>
> > >
> > >That is correct, fortunately the builds for these projects are really
> > >good and work on both linux and windows.  Just download them and follow
> > >the build instructions.  It's easier than you might think.
> > >
> > >Martin
> > >
> > >-----Original Message-----
> > >From: Rudolf Nottrott [mailto:rnott at alexandria.UCSB.edu]
> > >Sent: Friday, June 25, 2004 5:25 PM
> > >To: PostGIS Users Discussion
> > >Subject: RE: [postgis-users] Using/Compiling PostGIS on WindowsXP/Cygwin
> > >for use with PostgreSQL
> > >
> > >Are you saying that proj4 and geos are required to run
> > >PostGIS with PostgreSQL on Windows/Cygwin?
> > >
> > >Are they also required to run PostGIS with PostgreSQL on other
> > >platforms, in particular Linux?
> > >
> > >If so, that adds up to quite an installation chore, mostly because of
> > >the potential errors that can occur.
> > >I feel a bit daunted!
> > >
> > >Rudolf
> > >
> > >At 05:01 PM 6/25/2004 -0600, you wrote:
> > >>You need to download and install proj4.  It's the projection library
> > >>used by postgis to handle projecting lat/lons into x,y and the inverse.
> > >
> > >>The zip can be found at http://www.remotesensing.org:16080/proj/ .
> > >>Follow the build instructions for windows using the vc compiler.  Let
> > >>me know if you have problems.  You also need geos which can be found at
> > >
> > >>http://geos.refractions.net .
> > >>
> > >>Martin Chapman
> >
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at postgis.refractions.net
> > http://postgis.refractions.net/mailman/listinfo/postgis-users
>_______________________________________________
>postgis-users mailing list
>postgis-users at postgis.refractions.net
>http://postgis.refractions.net/mailman/listinfo/postgis-users

Rudolf Nottrott
University of California Santa Barbara     Phone: (805) 893-6146
Department of Computer Science           E-mail: RNott at Alexandria.UCSB.edu
Alexandria Digital 
Library                       Web:    www.alexandria.ucsb.edu
Santa Barbara, California  93106




More information about the postgis-users mailing list