Thanks Nicolas. I thought there was a simple way of doing this :)<br><br><div class="gmail_quote">On Mon, Apr 2, 2012 at 8:22 PM, Nicolas Ribot <span dir="ltr"><<a href="mailto:nicolas.ribot@gmail.com">nicolas.ribot@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 2 April 2012 19:38, Ed Linde <<a href="mailto:edolinde@gmail.com">edolinde@gmail.com</a>> wrote:<br>

> Hi All,<br>
> I see that ST_Segmentize allows me to introduce points to a line string "x"<br>
> meters apart. I was wondering if<br>
> there was a way to break the line string so that I can get lines "x" meters<br>
> in length returned as separate rows..<br>
> all belonging to the one segment ID?<br>
><br>
> Cheers,<br>
> Ed<br>
><br>
<br>
</div></div>Hi,<br>
<br>
You could dump the line points and create lines from 2 consecutive<br>
points, using st_makeline:<br>
<br>
with points as (<br>
        select (st_dumpPoints(line)).path[1], (st_dumpPoints(line)).geom from (<br>
                select st_segmentize('LINESTRING(0 0, 100 100)'::geometry, 20) as line<br>
        ) as foo<br>
) select p1.path, p2.path, st_makeline(p1.geom, p2.geom)<br>
from points as p1, points as p2<br>
where p1.path <> p2.path<br>
and p2.path = p1.path+1;<br>
<br>
One could replace the self join by a smart "group by" clause grouping<br>
2 points together.<br>
<br>
Nicolas<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</blockquote></div><br>