<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>getting different geometries with geomunion()</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=2 FACE="Arial">Hi everyone,</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">can't find a solution in the archive, but maybe somebody asked this before:</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">With GeomUnion postgis returns one single geometry. In my case the returned geometry is a multipolygon containing multiple geometries which don't adjoin. Is it possible to get one polygon for each area? Unfortunately there is no attribute to group by. The only attribute is the geometry, but I can't use the aggregated the_geom in the GROUP BY clause.</FONT></P>

<P><FONT SIZE=2 FACE="Arial">For example, if you have a polygon database of all states of the US and your statement is this:</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">SELECT geomunion(the_geom)</FONT>

<BR><FONT SIZE=2 FACE="Arial">FROM states</FONT>

<BR><FONT SIZE=2 FACE="Arial">WHERE name like 'I%'</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">the result would be *one* multipolygon containing Illinois and Indiana, but also Idaho. How can you get seperated polygons containing only the respectively adjacent geometries?  </FONT></P>

<P><FONT SIZE=2 FACE="Arial">thanks and greetings</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Markus</FONT>
</P>
<BR>
<BR>

<P><FONT SIZE=2 FACE="Arial">____________</FONT>

<BR><FONT SIZE=2 FACE="Arial">Virus checked by G DATA AntiVirusKit</FONT>

<BR><FONT SIZE=2 FACE="Arial">Version: AVK 16.7985 from 19.06.2006</FONT>

<BR><FONT SIZE=2 FACE="Arial">Virus news: www.antiviruslab.com</FONT>
</P>

</BODY>
</HTML>