[postgis-users] Makeline help

strk strk at keybit.net
Tue Oct 12 02:19:59 PDT 2010


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



More information about the postgis-users mailing list