<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML lang=en><HEAD><TITLE>Scalix message content</TITLE>

<STYLE type=text/css>.Normal {
        MARGIN-TOP: 0pt; FONT-SIZE: 12pt; MARGIN-BOTTOM: 0pt; TEXT-INDENT: 0pt; FONT-FAMILY: Arial; TEXT-ALIGN: left
}
.Default_Paragraph_Font {
        FONT-WEIGHT: normal; FONT-SIZE: 12pt; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: Arial; BACKGROUND-COLOR: white; FONT-VARIANT: normal; TEXT-DECORATION: none
}
DIV.ltTOCtitle {
        FONT-WEIGHT: bold; FONT-SIZE: 8pt; FONT-FAMILY: Verdana; TEXT-ALIGN: center
}
DIV.ltTOCl1 {
        FONT-WEIGHT: bold; FONT-SIZE: 8pt; MARGIN-LEFT: 32pt; TEXT-INDENT: -32pt; FONT-FAMILY: Verdana
}
DIV.ltTOCl2 {
        FONT-WEIGHT: bold; FONT-SIZE: 8pt; MARGIN-LEFT: 40pt; TEXT-INDENT: -32pt; FONT-FAMILY: Verdana
}
DIV.ltTOCl3 {
        FONT-WEIGHT: bold; FONT-SIZE: 8pt; MARGIN-LEFT: 48pt; TEXT-INDENT: -32pt; FONT-FAMILY: Verdana
}
DIV.ltTOCl4 {
        FONT-WEIGHT: bold; FONT-SIZE: 8pt; MARGIN-LEFT: 56pt; TEXT-INDENT: -32pt; FONT-FAMILY: Verdana
}
DIV.ltTOCl5 {
        FONT-WEIGHT: bold; FONT-SIZE: 8pt; MARGIN-LEFT: 64pt; TEXT-INDENT: -32pt; FONT-FAMILY: Verdana
}
DIV.ltTOCl6 {
        FONT-WEIGHT: bold; FONT-SIZE: 8pt; MARGIN-LEFT: 72pt; TEXT-INDENT: -32pt; FONT-FAMILY: Verdana
}
</STYLE>

<META content="MSHTML 5.50.4522.1800" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=281460314-23042008><FONT face=Arial color=#0000ff 
size=2>Regina</FONT></SPAN>
</DIV>
<DIV><SPAN class=281460314-23042008><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> 
</DIV>
<DIV><SPAN class=281460314-23042008><FONT face=Arial color=#0000ff size=2>Thank 
you for your response. Mmmm.. your trick doesn't solve my problem. Perhaps I 
should tell you why I do have a geometrycollection. My startingpoint is a 
sequence of single polygons. My aim is to merge them together to one 
multipolygon. I do this with st_collect. This works fine with two polygons: 
</FONT></SPAN>
</DIV>
<DIV><SPAN class=281460314-23042008><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> 
</DIV>
<DIV><SPAN class=281460314-23042008><FONT face=Arial color=#0000ff 
size=2>st_collect(polygon1,polygon2) => multipolygon(1,2). 
</FONT></SPAN>
</DIV>
<DIV><SPAN class=281460314-23042008><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> 
</DIV>
<DIV><SPAN class=281460314-23042008><FONT face=Arial color=#0000ff size=2>When I 
Process the third polygon with: st_collect(multipolygon(1,2), polygon3) 
 => Geometrycollection(multipolygon(1,2),polygon3)</FONT></SPAN>
</DIV>
<DIV><SPAN class=281460314-23042008><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> 
</DIV>
<DIV><SPAN class=281460314-23042008><FONT face=Arial color=#0000ff size=2>I do 
get the geomtrycollection and so on.</FONT></SPAN>
</DIV>
<DIV><SPAN class=281460314-23042008><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> 
</DIV>
<DIV><SPAN class=281460314-23042008><FONT face=Arial color=#0000ff size=2>My 
main problem is to merge the three polygons into one multipolygon with 3 
geometries. </FONT></SPAN>
</DIV>
<DIV><SPAN class=281460314-23042008><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> 
</DIV>
<DIV><SPAN class=281460314-23042008><FONT face=Arial color=#0000ff size=2>When I 
solve this problem I can offer a procedure to clean invalid 
geometries.</FONT></SPAN>
</DIV>
<DIV><SPAN class=281460314-23042008><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> 
</DIV>
<DIV><SPAN class=281460314-23042008><FONT face=Arial color=#0000ff 
size=2>Regards</FONT></SPAN>
</DIV>
<DIV><SPAN class=281460314-23042008><FONT face=Arial color=#0000ff 
size=2>Horst</FONT></SPAN>
</DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> 
</DIV>
<P>
<FONT face=Arial color=#000000 
size=2>------------------------------------------------</FONT> 

</P>
<P><FONT face=Arial color=#000000 size=2>Dr. Horst Düster</FONT> <BR>
<FONT 
face=Arial color=#000000 size=2>GIS-Koordinator, Stv. Amtschef</FONT> 

</P>
<P><FONT face=Arial color=#000000 size=2>Kanton Solothurn</FONT> <BR>
<FONT 
face=Arial color=#000000 size=2>Bau- und Justizdepartement</FONT> <BR>
<FONT 
face=Arial color=#000000 size=2>Amt für Geoinformation</FONT> <BR>
<FONT 
face=Arial color=#000000 size=2>SO!GIS Koordination</FONT> <BR>
<FONT face=Arial 
color=#000000 size=2>Rötistrasse 4</FONT> <BR>
<FONT face=Arial color=#000000 
size=2>CH-4501 Solothurn</FONT> 

</P>
<P><FONT face=Arial color=#000000 size=2>Telefon ++41(0)32 627 25 32</FONT> 
<BR>
<FONT face=Arial color=#000000 size=2>Telefax ++41(0)32 627 22 14</FONT> 


</P>
<P><FONT face=Arial color=#000000 size=2><A target=_blank 
href="mailto:horst.duester@bd.so.ch">mailto:horst.duester@bd.so.ch</A></FONT> 
<BR>
<FONT face=Arial color=#000000 size=2><A target=_blank 
href="http://www.agi.so.ch/">http://www.agi.so.ch</A></FONT> 

</P>
<DIV> 
</DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">

  <DIV><FONT face="Times New Roman" size=2>-----Ursprüngliche 
  Nachricht-----<BR>
<B>Von:</B> Obe, Regina 
  [mailto:robe.dnd@cityofboston.gov]<BR>
<B>Gesendet am:</B> Mittwoch, 23. April 
  2008 14:24<BR>
<B>An:</B> PostGIS Users Discussion<BR>
<B>Betreff:</B> RE: 
  [postgis-users] Geometrycollection to Multipolygon<BR>

</DIV></FONT>
  <P>

  
<DIV dir=ltr align=left><SPAN class=085351212-23042008><FONT face=Arial 
  color=#0000ff size=2>This sometimes does the trick for me if they actually can 
  be unioned</FONT></SPAN>
</DIV>
  <DIV dir=ltr align=left><SPAN class=085351212-23042008><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN> 
</DIV>
  <DIV dir=ltr align=left><SPAN class=085351212-23042008><FONT face=Arial 
  color=#0000ff size=2> ST_Union(GEOMCOLL, 
  ST_GeomFromText('GEOMETRYCOLLECTION(EMPTY)', yoursridhere) 
  )</FONT></SPAN>
</DIV>
  <DIV dir=ltr align=left><SPAN class=085351212-23042008><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN> 
</DIV>
  <DIV dir=ltr align=left><SPAN class=085351212-23042008><FONT face=Arial 
  color=#0000ff size=2>(your number 2 doesn't work because that is the aggregate 
  form, not because ST_Union can't handle geometry collections I 
  think)</FONT></SPAN>
</DIV>
  <DIV dir=ltr align=left><SPAN class=085351212-23042008><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN> 
</DIV>
  <DIV dir=ltr align=left><SPAN class=085351212-23042008><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN> 
</DIV>
  <DIV><SPAN class=085351212-23042008></SPAN><FONT face=Arial><FONT 
  color=#0000ff><FONT 
  size=2>Hope that helps,</FONT></FONT></FONT>
</DIV>
  <DIV><FONT size=+0><FONT color=#0000ff><FONT size=2><SPAN 
  class=085351212-23042008></SPAN></FONT></FONT></FONT><SPAN 
  class=085351212-23042008></SPAN><FONT face=Arial><FONT color=#0000ff><FONT 
  size=2>R<SPAN 
  class=085351212-23042008>egina</SPAN></FONT></FONT></FONT><BR>

</DIV>
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
  <HR tabIndex=-1>  


  <FONT face=Tahoma size=2><B>From:</B> 
  postgis-users-bounces@postgis.refractions.net 
  [mailto:postgis-users-bounces@postgis.refractions.net] <B>On Behalf Of 
  </B>Düster Horst<BR>
<B>Sent:</B> Wednesday, April 23, 2008 2:25 
  AM<BR>
<B>To:</B> postgis-users<BR>
<B>Subject:</B> [postgis-users] 
  Geometrycollection to Multipolygon<BR>
</FONT><BR>

</DIV>
  <DIV></DIV>
  <DIV class=Normal><SPAN style="FONT-SIZE: 10pt">I do have a Geometrycollection 
  which consists of a collection of Multipolygons and Polygons. My aim is to 
  create one single Multipolygon from the mentioned Geometry 
  collection.</SPAN>
</DIV><BR>

  <DIV class=Normal><SPAN style="FONT-SIZE: 10pt">Until now I tried the 
  following steps without result:</SPAN>
</DIV><BR>

  <DIV class=Normal><SPAN style="FONT-SIZE: 10pt">1. ST_BUFFER(GEOMCOLL,0.0) 
  => It works but all inner rings of my input geometry are 
  lost.</SPAN><BR>
<SPAN style="FONT-SIZE: 10pt">2. ST_UNION(GEOMCOLL) => 
  doesn't work with Geometrycollections</SPAN>
</DIV><BR>

  <DIV class=Normal><SPAN style="FONT-SIZE: 10pt">Does anyone has a solution to 
  solve my problem?</SPAN>
</DIV><BR>

  <DIV class=Normal><SPAN style="FONT-SIZE: 10pt">Best regards</SPAN><BR>
<SPAN 
  style="FONT-SIZE: 10pt">Horst</SPAN>
</DIV><BR>

  <DIV class=Normal><SPAN 
  style="FONT-SIZE: 10pt">------------------------------------------------</SPAN>
</DIV><BR>

  <DIV class=Normal><SPAN style="FONT-SIZE: 10pt">Dr. Horst 
  Düster</SPAN><BR>
<SPAN style="FONT-SIZE: 10pt">GIS-Koordinator, Stv. 
  Amtschef</SPAN>
</DIV><BR>

  <DIV class=Normal><SPAN style="FONT-SIZE: 10pt">Kanton 
  Solothurn</SPAN><BR>
<SPAN style="FONT-SIZE: 10pt">Bau- und 
  Justizdepartement</SPAN><BR>
<SPAN style="FONT-SIZE: 10pt">Amt für 
  Geoinformation</SPAN><BR>
<SPAN style="FONT-SIZE: 10pt">SO!GIS 
  Koordination</SPAN><BR>
<SPAN style="FONT-SIZE: 10pt">Rötistrasse 
  4</SPAN><BR>
<SPAN style="FONT-SIZE: 10pt">CH-4501 Solothurn</SPAN>
</DIV><BR>

  <DIV class=Normal><SPAN style="FONT-SIZE: 10pt">Telefon ++41(0)32 627 25 
  32</SPAN><BR>
<SPAN style="FONT-SIZE: 10pt">Telefax ++41(0)32 627 22 
  14</SPAN>
</DIV><BR>

  <DIV class=Normal><SPAN 
  style="FONT-SIZE: 10pt">mailto:horst.duester@bd.so.ch</SPAN><BR>
<SPAN 
  style="FONT-SIZE: 10pt">http://www.agi.so.ch</SPAN>
</DIV><BR>

  <P>

  
<HR SIZE=1>  



  <P>


</P>
  <P><STRONG>The substance of this message, including any attachments, may be 
  confidential, legally privileged and/or exempt from disclosure pursuant to 
  Massachusetts law. It is intended solely for the addressee. If you received 
  this in error, please contact the sender and delete the material from any 
  computer. </STRONG>

</P>
  <P>
  
<HR SIZE=1>  



  <P>


</P>
  <P><STRONG><FONT color=#339900 size=2>Help make the earth a greener place. If 
  at all possible resist printing this email and join us in saving paper. 

</P>
  <P></FONT></STRONG>

</P>
  <P>

</P></BLOCKQUOTE></BODY></HTML>