Very nice when it actually is that simple :).<div><br></div><div>rb<span></span><br><br>On Friday, August 31, 2012, James David Smith  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Robert,<br>
<br>
Thanks for your suggestion - this worked great - and was easier than<br>
learning how to do loops and similar! (though thanks for the<br>
suggestions from others too!). I knew just a bit of lateral thinking<br>
was required!<br>
<br>
James<br>
<br>
<br>
<br>
On 17 August 2012 20:48, Robert Burgholzer <<a>rburghol@vt.edu</a>> wrote:<br>
> If i understand this right, the series field tells you which second in total<br>
> time of N seconds that it took to move along the line. (end_time -<br>
> start_time)::float should give you the total time in seconds, and<br>
> series/total_time should give you the parameter that you want for<br>
> st_line_interpolate_point<br>
><br>
> HTH<br>
> r.b.<br>
> On Friday, August 17, 2012, James David Smith wrote:<br>
>><br>
>> Hi everyone,<br>
>><br>
>> I'm flirted around this problem for a while, so I hope I'm not bein<br>
>> annoying by being repetative, but I've been tearing my hair out trying to do<br>
>> it. The problem is that I have a file of lines (geometry). in a table called<br>
>> temp4 The format of the table is, simplified,<br>
>><br>
>> line<br>
>> start_time<br>
>> end_time<br>
>> series (I generated this as a count of the seconds difference between the<br>
>> above time fields. I thought it would be useful)<br>
>><br>
>> So for example my table (temp4) might look like this:<br>
>><br>
>> line                    ||    start_time           ||  end_time        ||<br>
>> series<br>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
>> line_geom         || 12:07:17                || 12:07:20         ||<br>
>> 3<br>
>> line_geom         || 12:07:17                || 12:07:20         ||<br>
>> 2<br>
>> line_geom         || 12:07:17                || 12:07:20         ||<br>
>> 1<br>
>><br>
>> line_geom         || 12:07:21                || 12:07:26         ||<br>
>> 6<br>
>> line_geom         || 12:07:21                || 12:07:26         ||<br>
>> 5<br>
>> line_geom         || 12:07:21                || 12:07:26         ||<br>
>> 4<br>
>> line_geom         || 12:07:21                || 12:07:26         ||<br>
>> 3<br>
>> line_geom         || 12:07:21                || 12:07:26         ||<br>
>> 2<br>
>> line_geom         || 12:07:21                || 12:07:26         ||<br>
>> 1<br>
>><br>
>><br>
>> Now what I want to do is split the lines into points, with a point for<br>
>> each second. Evenly spaced along the line. So if the line is 10 metres long<br>
>> and the difference between the start and end is 10 seconds then I want to<br>
>> create 9 points at 10% along the line, 20% along the line, 30% along the<br>
>> line etc up to a point which is 100% along the line i.e. the end of the<br>
>> line. I don't need a new point at the start of the line as I have that<br>
>> stored already.<br>
>><br>
>> So I've been trying something like this, but it's wrong. But maybe along<br>
>> the right lines.<br>
>><br>
>> SELECT st_line_interpolate_point(line, 1/series::float)) as new_point<br>
>> FROM temp4<br>
>><br>
>> Taking the first few rows of my data, the percentages along the lines I<br>
>> want to generate are as follows. I need to find a way to get these values<br>
>> into the st_line_interpolate_line  function.<br>
>><br>
>> line                   || start_time             || end_time      ||<br>
>> series      ||  percentage along line<br>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
>> line_geom        || 12:07:17               || 12:07:20      || 3<br>
>> ||   0.33%<br>
>> line_geom        || 12:07:17               || 12:07:20      || 2<br>
>> || > _______________________________________________<br>
> postgis-users mailing list<br>
> <a href="javascript:;" onclick="_e(event, 'cvml', '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>
><br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', '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><br>-- <br>--<br>Robert W. Burgholzer<br><a href="http://www.findingfreestyle.com/" target="_blank">http://www.findingfreestyle.com/</a><br>On Facebook - <a href="http://www.facebook.com/pages/Finding-Freestyle/151918511505970" target="_blank">http://www.facebook.com/pages/Finding-Freestyle/151918511505970</a><br>
Twitter - <a href="http://www.twitter.com/findfreestyle" target="_blank">http://www.twitter.com/findfreestyle</a><br>What's a tweeted swim set? A Sweet? No, a #swaiku!  Get them by following <a href="http://twitter.com/findfreestyle" target="_blank">http://twitter.com/findfreestyle</a><br>