[postgis-users] Makeline help

dicky1980 michael.harrop at newcastle.gov.uk
Tue Oct 12 03:42:29 PDT 2010


Thanks for your help,

Would you have an example of the type of aggregate function to use. Afraid
we're relative novices with postgres

Cheers



strk-2 wrote:
> 
> On Tue, Oct 12, 2010 at 02:14:55AM -0700, dicky1980 wrote:
> 
>> For eaxmple we have
>> 
>> EVENT_ID Time
>> 1             12.00
>> 1             12:01
>> 1             12:02 etc
>> 1
>> 1
>> 2
>> 2
>> 2
>> 2
>> 1
>> 1
>> 
>> What we'd like to be able to do is have it draw one line for the first
>> event
>> id group of 1s, then stop, draw a line for 2's, stop that line then start
>> a
>> new line for the next group of ones. What 
> 
> You'll need to roll your own aggregate function to do that.
> Aggregates maintain a state and visit each row in turn.
> By feeding the aggregate with your table ordered on Time
> you can have a state function checking for EVENT_ID changes
> and closing the line there (or at end of input).
> 
> Interesting use case indeed.
> 
> --strk; 
> 
>   ()   Free GIS & Flash consultant/developer
>   /\   http://strk.keybit.net/services.html
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 
> 

-- 
View this message in context: http://old.nabble.com/Makeline-help-tp29941457p29942017.html
Sent from the PostGIS - User mailing list archive at Nabble.com.




More information about the postgis-users mailing list