[prev in list] [next in list] [prev in thread] [next in thread]
List: postgis-users
Subject: Re: [postgis-users] Creating points along a line for every second?
From: Robert Burgholzer <rburghol () vt ! edu>
Date: 2012-08-31 16:28:51
Message-ID: CACT-NGJrXiGQrxLrFKyiwBOhjDO9fzbdmK9DN3Z307barKFeAA () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Very nice when it actually is that simple :).
rb
On Friday, August 31, 2012, James David Smith wrote:
> Hi Robert,
>
> Thanks for your suggestion - this worked great - and was easier than
> learning how to do loops and similar! (though thanks for the
> suggestions from others too!). I knew just a bit of lateral thinking
> was required!
>
> James
>
>
>
> On 17 August 2012 20:48, Robert Burgholzer <rburghol@vt.edu> wrote:
> > If i understand this right, the series field tells you which second in
> total
> > time of N seconds that it took to move along the line. (end_time -
> > start_time)::float should give you the total time in seconds, and
> > series/total_time should give you the parameter that you want for
> > st_line_interpolate_point
> >
> > HTH
> > r.b.
> > On Friday, August 17, 2012, James David Smith wrote:
> >>
> >> Hi everyone,
> >>
> >> I'm flirted around this problem for a while, so I hope I'm not bein
> >> annoying by being repetative, but I've been tearing my hair out trying
> to do
> >> it. The problem is that I have a file of lines (geometry). in a table
> called
> >> temp4 The format of the table is, simplified,
> >>
> >> line
> >> start_time
> >> end_time
> >> series (I generated this as a count of the seconds difference between
> the
> >> above time fields. I thought it would be useful)
> >>
> >> So for example my table (temp4) might look like this:
> >>
> >> line || start_time || end_time
> ||
> >> series
> >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >> line_geom || 12:07:17 || 12:07:20 ||
> >> 3
> >> line_geom || 12:07:17 || 12:07:20 ||
> >> 2
> >> line_geom || 12:07:17 || 12:07:20 ||
> >> 1
> >>
> >> line_geom || 12:07:21 || 12:07:26 ||
> >> 6
> >> line_geom || 12:07:21 || 12:07:26 ||
> >> 5
> >> line_geom || 12:07:21 || 12:07:26 ||
> >> 4
> >> line_geom || 12:07:21 || 12:07:26 ||
> >> 3
> >> line_geom || 12:07:21 || 12:07:26 ||
> >> 2
> >> line_geom || 12:07:21 || 12:07:26 ||
> >> 1
> >>
> >>
> >> Now what I want to do is split the lines into points, with a point for
> >> each second. Evenly spaced along the line. So if the line is 10 metres
> long
> >> and the difference between the start and end is 10 seconds then I want
> to
> >> create 9 points at 10% along the line, 20% along the line, 30% along the
> >> line etc up to a point which is 100% along the line i.e. the end of the
> >> line. I don't need a new point at the start of the line as I have that
> >> stored already.
> >>
> >> So I've been trying something like this, but it's wrong. But maybe along
> >> the right lines.
> >>
> >> SELECT st_line_interpolate_point(line, 1/series::float)) as new_point
> >> FROM temp4
> >>
> >> Taking the first few rows of my data, the percentages along the lines I
> >> want to generate are as follows. I need to find a way to get these
> values
> >> into the st_line_interpolate_line function.
> >>
> >> line || start_time || end_time ||
> >> series || percentage along line
> >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >> line_geom || 12:07:17 || 12:07:20 || 3
> >> || 0.33%
> >> line_geom || 12:07:17 || 12:07:20 || 2
> >> || > _______________________________________________
> > postgis-users mailing list
> > postgis-users@postgis.refractions.net <javascript:;>
> > http://postgis.refractions.net/mailman/listinfo/postgis-users
> >
> _______________________________________________
> postgis-users mailing list
> postgis-users@postgis.refractions.net <javascript:;>
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
--
--
Robert W. Burgholzer
http://www.findingfreestyle.com/
On Facebook -
http://www.facebook.com/pages/Finding-Freestyle/151918511505970
Twitter - http://www.twitter.com/findfreestyle
What's a tweeted swim set? A Sweet? No, a #swaiku! Get them by following
http://twitter.com/findfreestyle
[Attachment #5 (text/html)]
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>
_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic