[postgis-devel] Is there a reason we don't have an ST_Intersection aggregate function

Rémi Cura remi.cura at gmail.com
Mon Sep 1 01:48:20 PDT 2014

I don't understand,
ST_Union is an agregate (or can be , there are several prototype for this
Are you talking about the Layer Union Layer use case?

Most of the time if you want  to use a function as an aggregate you can
simply do
ST_Function (ST_Collect()).

Adding aggregates is really less a priority than adding support for
ARRAY[geom1,geom2,geom3...] for the relevant functions.

The essential difference that is often blocking is that aggregates can't be
used in a lot of places
(FROM, WHERE, in ordering, in windows ...), and you can't stake theim
(aggregate(aggregate()) is forbiden).

So often going the array way is the only short solution(you have always the
possibility ot use lot's of CTE but with big data this has a cost).


2014-09-01 10:37 GMT+02:00 Nicklas Avén <nicklas.aven at jordogskog.no>:

> In general I think we could do a lot of cool things with aggregates.
> I have had a thought in my head for a very long time that I haven't had
> time to investigate.
>  Quite often people is asking for a function like union in the esri world.
> http://resources.arcgis.com/en/help/main/10.1/index.html#//000800000010000000
>  In PostGIS we have a problem to do calculations that involves more than
> 2 geoemtries.
> But as an aggregate function it vould be possible to do.
>  /Nicklas
> 2014-09-01 Paul Ramsey wrote:
> Only reason is nobody ever asked for it, it's hard to figure great use
> >cases for it.
> >
> >P
> >
> >On Sun, Aug 31, 2014 at 6:16 PM, Paragon Corporation  wrote:
> >> I wasn't sure if we just thought there wasn't much utility in it or if
> there
> >> was a technical obstacle.
> >>
> >> I would think that would be easier to build than the other aggregates
> since
> >> as you add more geometries it shrinks and the current aggregate state is
> >> always the result of the previous state plus new geometry (so no need
> for an
> >> accumulation function or a final state function) and if you ever end up
> with
> >> a geometry collection, you short-circuit out.
> >>
> >> Thanks,
> >> Regina
> >>
> >>
> >> _______________________________________________
> >> postgis-devel mailing list
> >> postgis-devel at lists.osgeo.org
> >> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel
> >_______________________________________________
> >postgis-devel mailing list
> >postgis-devel at lists.osgeo.org
> >http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel
> >
> >
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20140901/c93e2bac/attachment.html>

More information about the postgis-devel mailing list