<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hi Robert,
<p>I opened the thread concerning GPC to get some help about postgis C
interface.
<br>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.
<p>A postgis user was interested by this code, and I posted scot_gpc.c
and scot_gpc.h to this list.
<br>These files do not belong to postgres nor postgis distributions.
<br>This code was only tested on Windows 2000, postgres 7.1.3, postgis
0.6.2.
<br>Tests were VERY basic, mainly calling the functions from postgis with
simple polygons.
<p>To compile them, I just modified the postgis makefile to include scot_gpc.o
and ran the make command on it.
<br>(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.).
<br>Then, the postgis.dll file produced by the makefile contains entries
for the following functions:
<br>union_pg_pg
<br>intersection_pg_pg
<br>difference_pg_pg
<br>sym_difference_pg_pg
<p>These functions were defined to postgis with the CREATE FUNCTION command,
like this (path to dll must be changed, of course):
<p><tt>CREATE FUNCTION intersection(GEOMETRY,GEOMETRY)</tt>
<br><tt> RETURNS GEOMETRY</tt>
<br><tt> AS 'C:/cygwin/usr/src/postgresql-7.1.3-2/contrib/postgis-0.6.2/postgis.dll',
'intersection_pg_pg'</tt>
<br><tt> LANGUAGE 'c' with (isstrict);</tt><tt></tt>
<p><tt>CREATE FUNCTION union_pg_pg(GEOMETRY,GEOMETRY)</tt>
<br><tt> RETURNS GEOMETRY</tt>
<br><tt> AS 'C:/cygwin/usr/src/postgresql-7.1.3-2/contrib/postgis-0.6.2/postgis.dll',
'union_pg_pg'</tt>
<br><tt> LANGUAGE 'c' with (isstrict);</tt><tt></tt>
<p><tt>CREATE FUNCTION difference(GEOMETRY,GEOMETRY)</tt>
<br><tt> RETURNS GEOMETRY</tt>
<br><tt> AS 'C:/cygwin/usr/src/postgresql-7.1.3-2/contrib/postgis-0.6.2/postgis.dll',
'difference_pg_pg'</tt>
<br><tt> LANGUAGE 'c' with (isstrict);</tt><tt></tt>
<p><tt>CREATE FUNCTION sym_difference(GEOMETRY,GEOMETRY)</tt>
<br><tt> RETURNS GEOMETRY</tt>
<br><tt> AS 'C:/cygwin/usr/src/postgresql-7.1.3-2/contrib/postgis-0.6.2/postgis.dll',
'sym_difference_pg_pg'</tt>
<br><tt> LANGUAGE 'c' with (isstrict);</tt>
<p>Once again, this code was not at all seriously tested :-)
<p>Nicolas
<p>"Robert W. Burgholzer" wrote:
<blockquote TYPE=CITE>Hello,
<br>I am new to the list here, but caught a thread regarding the gpc
<br>geo-processing libraries in the archives. Some code was included, but
as
<br>I am relatively inexperienced in compiling addons for postgres, I am
a
<br>little uncertain.
<br>I moved the soot_gpc.c and .h codes into /postgres7.2--/src/include/
and
<br>tried executing:
<br> gcc soot_gpc.c
<br>but got the following errors and a couple other like it:
<br> access/gist.h:17:25: access/itup.h: No such file
or directory
<br>Of course all of those files are there, and it seems as if the file
<br>gist.h is trying to look in a subdirectory for itup.h when in fact
it is
<br>in the same dir. I could change the include lines in gist.h, but am
<br>I missing something here? Should I be "make-ing" the whole postgres
app
<br>over again, or something else?
<p>Sorry for the lame question, but I am really looking forward to doing
<br>some geoprocessing in postgis, but am inexperienced with the coding
<br>procedures.
<p>Any help would be great,
<br> </blockquote>
</html>