[postgis-users] About AddPoint(linestring, point, [<position>])

strk at refractions.net strk at refractions.net
Tue Feb 8 00:03:13 PST 2005


A LINESTRING with less then 2 points is invalid.
You might want to try the MakeLine() aggregate or
the LineFromMultiPoint() function.

You'll have to take care of ordering, for example:

SELECT MakeLine(the_geom) FROM ( SELECT the_geom FROM points
	ORDER BY time ) foo;

Note that MakeLine allows construction of single-point LineString.
This is not a design decision, so do not rely on it (we should probably
avoid that)

--strk;

On Mon, Feb 07, 2005 at 04:53:37PM -0700, Seamus Thomas Carroll wrote:
> Hi,
> 
> I was hoping to use AddPoint to build a LINESTRING by adding POINTs from 
> time to time.  A problem arrises because innitially i want an empty 
> LINESTRING.  It appears i cant begin to add points until there are at 
> least two points in the LINESTRING (for that matter i cant create a 
> LINESTRING with less than two points).
> 
> Is this by design or is it something that has not been needed up to this 
> point?  Are there any suggestions on how i may accomplish this?
> 
> Thanks,
> 
> Seamus
> 
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list