| Hi James, I'd do this fairly easily under Linux with a script to iterate through the tasks. In fact I've done it, we have tracklines recorded for an underwater cammera. It takes a picture every 15 seconds, so I navigate along the line in 15 second intervals to get the points. As you describe, it is a matter of defining the line by temporal extents & using % of time to navigate the distance along the line. You already have the algorithm, but I'd suggest implementing it using a suitable scripting language rather than doing it entirely in SQL. Which scripting language is up to you, but as pseudocode, something along the lines of create a table to store the points: psql -d <db> -c "create table <points> ( line id, percent, time, point )" iterate through the lines: for line_id in (list of line_ids) ; do get distance of line in seconds (psql) measure = 0 while measure >= distance ; do measure = measure + 1 percent = measure / distance time = psql -d <db> -c "select (start time plus number of seconds) as interval " psql -d <db> -c "insert into <points> values line id, percent, time, line_interpolate_point(line, percent/100)" done done HTH, Brent --- On Sat, 8/18/12, James David Smith <james.da...@gmail.com> wrote: |
-----Inline Attachment Follows----- |
You could certainly either add measures to your lines -- 'update table set line=st_addmeasure(line,0,series)' or do something similar to the above just using st_locatebetween;CREATE OR REPLACE FUNCTION everysecond(g geometry)
RETURNS geometry AS
$BODY$
select st_makeline(st_locate_along_measure($1,g)) from generate_series(0,floor(st_m(st_endpoint($1)))::int,1) g;
$BODY$
LANGUAGE sql VOLATILE
COST 100;
_______________________________________________
postgis-users mailing list
postgi...@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
>> || > _______________________________________________
> postgis-users mailing list
> postgi...@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
_______________________________________________
postgis-users mailing list
postgi...@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users