INSERT INTO bar
 SELECT ST_Makeline(the_geom)
FROM (SELECT the_geom FROM foo ORDER BY some_ordering_attribute) AS my_sub_query;

The reason for the subquery is to order your points based on some attribute ... like a timestamp.

Those ordered points are then passed to your makeline function call.

Hope this clarifies things.
-- Kevin

-------------
Kevin Neufeld
Software Developer
Refractions Research Inc.
300-1207 Douglas St.
Victoria, B.C., V8W 2E7

Phone: (250) 383-3022
Email: [EMAIL PROTECTED]



David Potts wrote:
hi List,

I am trying to make a linestring from a serries of points,  I have tried
things like

update linetable set the_geom=makeline(select the_geom from points_table);

witch did'nt work, having looked at the documentation for making making
linestrings (addpoint,makeline, etc) and seen a previous example from
(http://postgis.refractions.net/pipermail/postgis-users/2005-February/006916.html)

SELECT MakeLine(the_geom) FROM ( SELECT the_geom FROM points
        ORDER BY time ) foo;
I am still confused,  I can't see how the last example is designed to work!


So if I have table called bar with an empty linestring geometry column and
I have another table foo with a series of valid point geometry entires,
how do I populate bar from foo?
David
_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to