[postgis-users] gpc integration - geoprocessing
Nicolas Ribot
nicolas.ribot at scot.cnes.fr
Tue May 21 06:15:44 PDT 2002
Hi Robert,
I opened the thread concerning GPC to get some help about postgis C
interface.
My goal was to make a little interface between gpc geographic types and
postgis geographic types, to allow the use of some geographic operators into
postgis, and to test the GPC performance.
A postgis user was interested by this code, and I posted scot_gpc.c and
scot_gpc.h to this list.
These files do not belong to postgres nor postgis distributions.
This code was only tested on Windows 2000, postgres 7.1.3, postgis 0.6.2.
Tests were VERY basic, mainly calling the functions from postgis with simple
polygons.
To compile them, I just modified the postgis makefile to include scot_gpc.o
and ran the make command on it.
(the reason is that when I wrote my own makefile, I was able to produce a
DLL, but no chance to call functions from it.).
Then, the postgis.dll file produced by the makefile contains entries for the
following functions:
union_pg_pg
intersection_pg_pg
difference_pg_pg
sym_difference_pg_pg
These functions were defined to postgis with the CREATE FUNCTION command,
like this (path to dll must be changed, of course):
CREATE FUNCTION intersection(GEOMETRY,GEOMETRY)
RETURNS GEOMETRY
AS
'C:/cygwin/usr/src/postgresql-7.1.3-2/contrib/postgis-0.6.2/postgis.dll',
'intersection_pg_pg'
LANGUAGE 'c' with (isstrict);
CREATE FUNCTION union_pg_pg(GEOMETRY,GEOMETRY)
RETURNS GEOMETRY
AS
'C:/cygwin/usr/src/postgresql-7.1.3-2/contrib/postgis-0.6.2/postgis.dll',
'union_pg_pg'
LANGUAGE 'c' with (isstrict);
CREATE FUNCTION difference(GEOMETRY,GEOMETRY)
RETURNS GEOMETRY
AS
'C:/cygwin/usr/src/postgresql-7.1.3-2/contrib/postgis-0.6.2/postgis.dll',
'difference_pg_pg'
LANGUAGE 'c' with (isstrict);
CREATE FUNCTION sym_difference(GEOMETRY,GEOMETRY)
RETURNS GEOMETRY
AS
'C:/cygwin/usr/src/postgresql-7.1.3-2/contrib/postgis-0.6.2/postgis.dll',
'sym_difference_pg_pg'
LANGUAGE 'c' with (isstrict);
Once again, this code was not at all seriously tested :-)
Nicolas
"Robert W. Burgholzer" wrote:
> Hello,
> I am new to the list here, but caught a thread regarding the gpc
> geo-processing libraries in the archives. Some code was included, but as
> I am relatively inexperienced in compiling addons for postgres, I am a
> little uncertain.
> I moved the soot_gpc.c and .h codes into /postgres7.2--/src/include/ and
> tried executing:
> gcc soot_gpc.c
> but got the following errors and a couple other like it:
> access/gist.h:17:25: access/itup.h: No such file or directory
> Of course all of those files are there, and it seems as if the file
> gist.h is trying to look in a subdirectory for itup.h when in fact it is
> in the same dir. I could change the include lines in gist.h, but am
> I missing something here? Should I be "make-ing" the whole postgres app
> over again, or something else?
>
> Sorry for the lame question, but I am really looking forward to doing
> some geoprocessing in postgis, but am inexperienced with the coding
> procedures.
>
> Any help would be great,
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20020521/15def868/attachment.html>
More information about the postgis-users
mailing list