[postgis-users] Function for creating TIN using tripack fortran codes

Paul Ramsey pramsey at refractions.net
Wed Jun 5 08:12:48 PDT 2002


Wow, we are getting advanced functionality thoughts already! I suppose
one open question is "what is the best way to store a TIN in a spatial
database"? As a table of faces? As a single object? Too bad both the GPC
and tripack code is not quite open-source enough for actual inclusion in
the base package. Fortunately, the GEOS project (the new C++ JTS) will
provide us with the basic spatial operators. 

Does anyone have any thoughts, or academic references to ideas on
storing topological structures in a spatial DB? I am thinking
coverage-style topologies in particular. That seems like an obvious and
useful point of attack once SFSQL is covered.

P.

Hisaji ONO wrote:
> 
> Hello.
> 
>  I tried to create a function for creating TIN from MULTIPOINT
> experimentally using tripack(fortran TIN library ) available from
> http://cran.r-project.org/src/contrib/tripack_1.2-3.tar.gz. This function
> outputs TIN as a MULTIPOLYGON. I used tripack's two fortan codes. They are
> ACM's, and free for ***noncommercial*** use.
> 
>  I attached two files "tin.c" and "Makefile.g77", a modified original make
> file. For compiling my program, please execute "make -f Makefile.g77" in
> PostGIS's source existing directory.
> 
>  For defining this function, run following function in psql client
> program(this is an example in Cygwin Environment).
> 
>   CREATE FUNCTION tin(GEOMETRY)
>   RETURNS GEOMETRY
>   AS 'C:/cygwin/usr/src/postgresql-7.2.1/contrib/postgis-0.7.1/postgis.dll',
> 'create_tin'
>   LANGUAGE 'c'  with (isstrict);
> 
> For using this function:
> 
>    select tin(collect(the_geom)) from point_table;
> 
>  For creating TIN, your need more than 3 points.
> 
>   Sorry, I'm newbie for creating PostgreSQL's function by C, I don't know
> how to output each triangle with its ID, useful triangle's info(neighbor
> triangles, its lines' IDs and its points' IDs) in this function. Could you
> tell me any suggestion about this?
> 
>  Thanks for Mr. Nicholas Ribot's programs for functions using GPC,  I've
> managed to create this program.
> 
>  Best Regards.
> 
>   ------------------------------------------------------------------------
>             Name: tin.c
>    tin.c    Type: unspecified type (application/octet-stream)
>         Encoding: quoted-printable
> 
>                    Name: Makefile.g77
>    Makefile.g77    Type: unspecified type (application/octet-stream)
>                Encoding: quoted-printable




More information about the postgis-users mailing list