[postgis-users] Cumulative sum

Nicolas Ribot nicolas.ribot at gmail.com
Tue Feb 5 10:33:41 PST 2013


Hi,

You may look at Recursive Common Table Expression (
http://www.postgresql.org/docs/current/static/queries-with.html)
It is very powerful to walk a network.

Nicolas


On 5 February 2013 18:47, Delton Moraes <deltoncm at yahoo.com.br> wrote:

> Hello.****
> ** **
> I need to build a view that contains data of accumulated contribution to
> the sewage network (linestrings). Each section of the sewer system has its
> own contribution. I need a function (i think this is the only way to solve
> this, but if have another way, please tell me) to calculate that cumulative
> contribution. The function would have to add cumulative values of the
> contributions of previous linestrings to the local contribution (WHERE
> st_touches(st_startpoint(sewer1.geom), st_endpoint(sewer2.geom)) until the
> “end” (the top/start of sewage network, where don’t have another previous
> linestring. I think a WHILE solve this, but how?). Can anyone help me?****
>
> Thanks.****
>
> Delton Moraes****
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130205/ea9affbe/attachment.html>


More information about the postgis-users mailing list