<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Geomunion</TITLE>

<META content="MSHTML 6.00.2900.2180" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=079392211-30082007><FONT face=Arial color=#0000ff size=2>OK, I 
found a solution:</FONT></SPAN></DIV>
<DIV><SPAN class=079392211-30082007><FONT face=Arial color=#0000ff size=2>SELECT 
multi(geomunion(geom)) from table1.</FONT></SPAN></DIV>
<DIV><SPAN class=079392211-30082007><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=079392211-30082007><FONT face=Arial color=#0000ff size=2>Now I 
want to use this query to get the number of holes in the union of all 
geometries:</FONT></SPAN></DIV>
<DIV><SPAN class=079392211-30082007><FONT face=Arial color=#0000ff size=2>SELECT 
NumInteriorRings(multi(geomunion(geom))) FROM table1</FONT></SPAN></DIV><SPAN 
class=079392211-30082007></SPAN><FONT face=Tahoma>
<DIV><FONT size=2><SPAN class=079392211-30082007><FONT face=Arial 
color=#0000ff></FONT></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=079392211-30082007>This 
queries perform very very bad. I cancelled a query on a table with about 10000 
geometries because it takes over an hour without being completed. Is there a 
better way to union such a big number of geometries?</SPAN></FONT></DIV>
<DIV><FONT size=2><SPAN class=079392211-30082007></SPAN></FONT> </DIV>
<DIV><FONT size=2><SPAN class=079392211-30082007> </SPAN>-----Ursprüngliche 
Nachricht-----<BR><B>Von:</B> postgis-users-bounces@postgis.refractions.net 
[mailto:postgis-users-bounces@postgis.refractions.net]<B>Im Auftrag von 
</B>Thorsten Kraus<BR><B>Gesendet:</B> Donnerstag, 30. August 2007 
12:54<BR><B>An:</B> PostGisMailingList (E-Mail)<BR><B>Betreff:</B> 
[postgis-users] Geomunion<BR><BR></DIV></FONT></FONT>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><!-- Converted from text/rtf format -->
  <P><FONT face=Arial size=2>Hello,</FONT> </P>
  <P><FONT face=Arial size=2>I want to union all geometries of a table into one 
  big geometry. Do you know how this task can be performed the best 
  way?</FONT></P>
  <P><FONT face=Arial size=2>Regards,</FONT> <BR><FONT face=Arial 
  size=2>Thorsten</FONT> </P></BLOCKQUOTE></BODY></HTML>