<div dir="ltr"><div><div><div><div>Hey,<br></div>I think you misunderstood me,<br></div>of course array of geom are not a replacement of proper use of aggregate.<br></div>It's just that in some case you cannot do with aggregate and array function are very usefull, or the only solution.<br>
</div><div>(example :<br></div><div>WITH A AS (<br><br>)<br></div><div><br></div>for instance when<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-09-01 14:39 GMT+02:00 Paragon Corporation <span dir="ltr"><<a href="mailto:lr@pcorp.us" target="_blank">lr@pcorp.us</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>



<div>
<div dir="ltr" align="left"><font color="#0000ff" face="Arial"></font> </div>
<div>
<div><div class="">
<div><font color="#0000ff" face="Arial"></font> </div>
<div><font color="#0000ff" face="Arial"></font><br></div>
<div><span><font color="#0000ff" face="Arial"> >  </font></span>What I target is not the unioning 
between the layers but inside the same layer. The problem is the same -> to 
do something with more than two geometries involved.</div>
<div><font color="#0000ff" face="Arial"></font> </div>
</div><div>
<div>
<div>
<div>
<div>
<div>
<div><br><div class=""><span><font color="#0000ff" face="Arial"> >  </font></span>Adding aggregates is really less a 
priority than adding support for <br>></div></div><div class="">
<div>ARRAY[geom1,geom2,geom3...] for the relevant functions.<br>><span><font color="#0000ff" face="Arial"> </font></span></div>
</div><div class=""><div><span><font color="#0000ff" face="Arial">> 
<font color="#000000" face="Times New Roman" size="3">Are you sure that the planner 
and indexes will manage arrays better?</font></font></span></div>
<div><span></span> </div>
</div><div><span><font color="#0000ff" face="Arial">The 
reason I was thinking an array of aggregates is not as useful as an 
ST_Intersection aggregate is that as you intersect geometries you are using less 
memory rather than more</font></span></div>
<div><span><font color="#0000ff" face="Arial">with 
array you'd have to accumulate them first.</font></span></div>
<div><span><font color="#0000ff" face="Arial"></font></span> </div>
<div><span><font color="#0000ff" face="Arial">It 
really is a sequential thing.</font></span></div>
<div><span><font color="#0000ff" face="Arial"></font></span> </div>
<div><span><font color="#0000ff" face="Arial">That 
is not to say the ARRAY version isn't useful, but if you have a bunch of 
geometries and then have to array them to get an intersection, then it would be 
slower.</font></span></div>
<div><span><span><font color="#0000ff" face="Arial">I could be wrong on that of course. Paul and 
Nicklas can correct me on that since they are more familiar with the 
innards.</font></span></span></div>
<div><span><span><font color="#0000ff" face="Arial"></font></span></span> </div>
<div><span><font color="#0000ff" face="Arial">I have 
on occasion come into the situation where the things I want to get intersection 
of are in separate rows rather than separate layers and it is a tad bit annoying 
to work around it. Doesn't come up often though.</font></span></div>
<div><span><font color="#0000ff" face="Arial"></font></span> </div>
<div><span><span><font color="#0000ff" face="Arial">Now with 9.4 coming with the FILTER syntax now 
makes the across rows much easier if I actually had an ST_Intersection aggregate 
that could take advantage of it.</font></span></span></div><div class="">
<div><span><span><font color="#0000ff" face="Arial"></font></span></span> </div>
<div><span><span>
<div><span><font color="#0000ff" face="Arial"> >  </font></span>Yes, I guess you are right that it 
would be possible to write a function that does the job from a collection</div>
<div><br></div>
<div><span><font color="#0000ff" face="Arial"> >  </font></span>But the function will have to do the 
same thing. To calculate a result from 2 polygons, then use the resulting 
polygon for calculation against the third polygon and so on. Just like an 
aggregate function works.</div></span></span></div>
<div><span><font color="#0000ff" face="Arial"></font></span> </div>
</div><div><span><font color="#0000ff" face="Arial">I 
actually hadn't thought of our ST_UnaryUnion <a href="http://postgis.net/docs/manual-2.1/ST_UnaryUnion.html" target="_blank">http://postgis.net/docs/manual-2.1/ST_UnaryUnion.html</a>  
equivalent of ST_Intersection  which is what I think Nicklas is 
talking about here.  That would be useful as well.</font></span></div>
<div><span><font color="#0000ff" face="Arial">That 
introduces another question though?</font></span></div>
<div><span><font color="#0000ff" face="Arial"></font></span> </div>
<div><span><font color="#0000ff" face="Arial">Would 
an ST_Intersection aggregate double as an 
ST_UnaryIntersection?</font></span></div>
<div><span><font color="#0000ff" face="Arial">or we 
just keep them separate.</font></span></div>
<div><span><font color="#0000ff" face="Arial"></font></span> </div>
<div><span><font color="#0000ff" face="Arial">I 
would say keep them separate so that we have a parallel with ST_UnaryUnion and 
also you can use it NOT as an aggregate to satisfy the array like 
need.</font></span></div>
<div><span><font color="#0000ff" face="Arial"></font></span> </div>
<div><span><font color="#0000ff" face="Arial"></font></span> </div>
<div><span><font color="#0000ff" face="Arial"></font></span> </div>
<div><span><font color="#0000ff" face="Arial">Thanks,</font></span></div>
<div><span><font color="#0000ff" face="Arial">Regina</font></span></div>
<div><span><font color="#0000ff" face="Arial"></font></span> </div>
<div><span><font color="#0000ff" face="Arial"></font></span> </div></div></div></div></div></div></div></div></div></div>
<br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>