you can always break up the geometry collection into individuals geometries like so...<br><br><span style="font-family: courier new,monospace;">create or replace function breakup (geometry) returns void as $$</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">declare</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; geom&nbsp;&nbsp;&nbsp; geometry;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">begin</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; for i in 1..NumGeometries($1) loop</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; geom := GeometryN($1, i);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // add to new table</span>
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; end loop;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; return;
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">end;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">$$ language plpgsql;
</span><br style="font-family: courier new,monospace;"><br>you can also write a PL/PGSQL function that returns a set of geometries from the geometrycollection, like&nbsp; this...<br><br><span style="font-family: courier new,monospace;">
create or replace function foobar (geometry) returns setof geometry as $$</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">declare</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; geom&nbsp;&nbsp;&nbsp; geometry;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">begin</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; for i in 1..NumGeometries($1) loop</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return next GeometryN($1, i);
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; end loop;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp;&nbsp; return;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">end;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
$$ language plpgsql;</span><br><br>the call like this...<br><br><span style="font-family: courier new,monospace;">select * from foobar(Collect(GeomFromText('POINT(1 1)'),GeomFromText('POINT(1 2)')));</span><br><br>of course a wrapper function could be used to iterate over all geoms in a table, all geoms in a bbox, etc.
<br><div><span class="gmail_quote">On 12/4/06, <b class="gmail_sendername">Akio Takubo</b> &lt;<a href="mailto:takubo@saruga-tondara.net">takubo@saruga-tondara.net</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello Alessandro,<br><br>I'm also trying to use a geometry collection column<br>with PostGIS layer just now. It is a interesting topic for me.<br>Does anyone have a nice experience with Geometry Collection<br>column?<br><br>
As far as I know, Mapserver and other some applications<br>do not support Geometry collection column perfectly.<br>In Mapserver, as I tested some cases and saw mappostgis.c,<br>each layer type works following.<br>* POINT shows point and all nodes of linestring and polygon
<br>&nbsp;&nbsp;if there is no nested geometry collction.<br>* LINE shows all linestrings and polygons<br>&nbsp;&nbsp;If there are point or geometry collection, it does not work correctly<br>* POLYGON shows all polygons.<br>&nbsp;&nbsp;If three are other types of geometry, it does not work collectly.
<br><br>Totally, now it is no consideration of mixed geometry types or<br>includes nested geometry collction in PostGIS.<br><br>Is it a bug or specification for no consideration for these geometry<br>at force_to_~ functions in 
mappostgis.c?<br>And Mapserver uses force_collection function for fetching geometry,<br>but force_collection does not extract a nested geometry collection.<br>I think it is better force_collection (or other new function)<br>
works all nested geometry collection (and multi~ types).<br><br>Best regards,<br><br>&nbsp;&nbsp;Akio Takubo<br><br>On Mon, 4 Dec 2006 11:15:12 +0100<br>Alessandro Pasotti &lt;<a href="mailto:ale.pas@TISCALI.IT">ale.pas@TISCALI.IT</a>
&gt; wrote:<br><br>&gt; Hello,<br>&gt;<br>&gt; I have a layer where the_geom is a geometrycollection (of linestrings), is it<br>&gt; possible to show it in mapserver 4.10?<br>&gt;<br>&gt; What &quot;type&quot; (POINT, POLYGON or whatever) should I set?
<br>&gt;<br>&gt; --<br>&gt; Alessandro Pasotti<br>&gt; itOpen - &quot;Open Solutions for the Net Age&quot;<br>&gt; w3:&nbsp;&nbsp;<a href="http://www.itopen.it">www.itopen.it</a><br>&gt; Linux User# 167502<br>&gt;<br></blockquote></div>
<br><br clear="all"><br>-- <br>Regards,<br><br>Mark Thomas<br><a href="mailto:spatialguru.net@gmail.com">spatialguru.net@gmail.com</a><br>205.529.9013<br><br>&quot;Commit to the Lord whatever you do,<br>&nbsp;&nbsp;&nbsp;&nbsp;and your plans will succeed.&quot; - Proverbs 16:3