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

List:       postgis-users
Subject:    Re: [postgis-users] points to polyline or polygon
From:       David Blasby <dblasby () refractions ! net>
Date:       2003-07-16 18:59:39
Message-ID: 3F15A09B.7050204 () refractions ! net
[Download RAW message or body]

Tyler Mitchell wrote:
> Thanks David, exactly what I was looking for.
> 
> Do you not see a benefit to using pl functions instead, since there is no
> library compilation requirement.

You cannot directly access the GEOMETRY datastructure in pl, only using "C".

You could use something like:

CREATE FUNCTION multipoint2linestring (GEOMETRY) returns GEOMETRY AS
'select 
GeometryFromText(replace(asText($1),''MULTIPOINT'',''LINESTRING''), 
srid($1))' language 'sql' with (iscachable,isstrict);

This one is doing it in text-land instead of in the object-land.
You could improve this function using plpgsql - making it easy to do 
error checking and the like.

dave




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

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