[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] gpc integration - geoprocessing
From:       Nicolas Ribot <nicolas.ribot () scot ! cnes ! fr>
Date:       2002-05-21 13:15:44
Message-ID: 200205211316.g4LDGTs04532 () cnes ! fr
[Download RAW message or body]

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,
>

[Attachment #3 (text/html)]

<!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>&nbsp; RETURNS GEOMETRY</tt>
<br><tt>&nbsp; AS 'C:/cygwin/usr/src/postgresql-7.1.3-2/contrib/postgis-0.6.2/postgis.dll',
'intersection_pg_pg'</tt>
<br><tt>&nbsp; LANGUAGE 'c'&nbsp; with (isstrict);</tt><tt></tt>
<p><tt>CREATE FUNCTION union_pg_pg(GEOMETRY,GEOMETRY)</tt>
<br><tt>&nbsp; RETURNS GEOMETRY</tt>
<br><tt>&nbsp; AS 'C:/cygwin/usr/src/postgresql-7.1.3-2/contrib/postgis-0.6.2/postgis.dll',
'union_pg_pg'</tt>
<br><tt>&nbsp; LANGUAGE 'c'&nbsp; with (isstrict);</tt><tt></tt>
<p><tt>CREATE FUNCTION difference(GEOMETRY,GEOMETRY)</tt>
<br><tt>&nbsp; RETURNS GEOMETRY</tt>
<br><tt>&nbsp; AS 'C:/cygwin/usr/src/postgresql-7.1.3-2/contrib/postgis-0.6.2/postgis.dll',
'difference_pg_pg'</tt>
<br><tt>&nbsp; LANGUAGE 'c'&nbsp; with (isstrict);</tt><tt></tt>
<p><tt>CREATE FUNCTION sym_difference(GEOMETRY,GEOMETRY)</tt>
<br><tt>&nbsp; RETURNS GEOMETRY</tt>
<br><tt>&nbsp; AS 'C:/cygwin/usr/src/postgresql-7.1.3-2/contrib/postgis-0.6.2/postgis.dll',
'sym_difference_pg_pg'</tt>
<br><tt>&nbsp; LANGUAGE 'c'&nbsp; 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>&nbsp;&nbsp; gcc soot_gpc.c
<br>but got the following errors and a couple other like it:
<br>&nbsp;&nbsp;&nbsp; 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>&nbsp;</blockquote>
</html>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic