<div class="gmail_extra">Hi,</div><div class="gmail_extra"><br></div><div class="gmail_extra">As Julien suggested, you could st_dump to explode multipolygons into polygons, then union them.</div><div class="gmail_extra">It will produce a single polygon unioning all others:</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">with t as (</div><div class="gmail_extra">    select (st_dump(geom)).geom </div><div class="gmail_extra">    from my_table</div><div class="gmail_extra">) select st_union(geom) from t;</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Nicolas<br><br><div class="gmail_quote">On 26 April 2012 17:22, Mehmet Erkek <span dir="ltr"><<a href="mailto:merkek@reidin.com" target="_blank">merkek@reidin.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="white" lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="color:windowtext">Hi Juilen, thanks for quick answer. <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:windowtext"><u></u> <u></u></span></p><p class="MsoNormal"><span style="color:windowtext">I have </span><span style="color:windowtext">1 geometry and 1 row on the table. this geometry is multiploygon which consists of 4 polygons.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:windowtext">I want to convert this mutlipolygon to one single polygon..<u></u><u></u></span></p><p class="MsoNormal"><span style="color:windowtext"><u></u> <u></u></span></p><p class="MsoNormal">
<span style="color:windowtext">Any idea how I can do this?<u></u><u></u></span></p><p class="MsoNormal"><span style="color:windowtext">I hope it is clearer now.<u></u><u></u></span></p><p class="MsoNormal"><span style="color:windowtext"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:windowtext">Thanks.<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<div><div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext"> <a href="mailto:postgis-users-bounces@postgis.refractions.net" target="_blank">postgis-users-bounces@postgis.refractions.net</a> [mailto:<a href="mailto:postgis-users-bounces@postgis.refractions.net" target="_blank">postgis-users-bounces@postgis.refractions.net</a>] <b>On Behalf Of </b>ju<br>
<b>Sent:</b> 26 Nisan 2012 18:02<br><b>To:</b> PostGIS Users Discussion<br><b>Subject:</b> Re: [postgis-users] [!! SPAM] multipolygon to single polygon<u></u><u></u></span></p></div></div><div><div class="h5"><p class="MsoNormal">
<u></u> <u></u></p><p class="MsoNormal">not clear...<br><br>1) if you have 4 polygons in 4 rows table distinct, this is not a multi object issu. for  this case use<br> dissolve to group polygone into only one, this is not a topic of dump.<br>
<br><br>2) if you have 1 geometry and 1 row on the tablme, so this is a multi object topic<br>you must sperate the differents objet of the collection<br><br>here : <a href="http://www.postgis.org/docs/ST_GeometryN.html" target="_blank">http://www.postgis.org/docs/ST_GeometryN.html</a><u></u><u></u></p>
<pre>--Extracting all geometries (useful when you want to assign an id)<u></u><u></u></pre><pre>SELECT gid, n, ST_GeometryN(the_geom, n)<u></u><u></u></pre><pre>FROM sometable CROSS JOIN generate_series(1,100) n<u></u><u></u></pre>
<pre>WHERE n <= ST_NumGeometries(the_geom);<u></u><u></u></pre><p class="MsoNormal"><br>best regards, julien<br><br><br><br>Le 26/04/2012 16:27, Mehmet Erkek a écrit : <u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">I have multipolygons which I would like to convert a single polygon. is there a way to do this? please check the attached image. I tried st_dump and afterwards st_union , but eventually I get a multipolygon again, not polygon. <u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal"><img border="0" width="851" height="341" src="cid:image001.png@01CD23D8.DD4DE470"><u></u><u></u></p><p class="MsoNormal">
 <u></u><u></u></p><p class="MsoNormal"><b><span style="font-size:10.0pt">Mehmet Erkek</span></b><u></u><u></u></p><p class="MsoNormal"><a href="http://www.reidin.com/" target="_blank"><span style="font-size:7.0pt;font-family:"Verdana","sans-serif"">www.REIDIN.com</span></a><span style="font-size:7.0pt;font-family:"Verdana","sans-serif""> </span><u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""><br>This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. Please Consider the Environment Before Printing This Email <br>
<br><br><u></u><u></u></span></p><pre>_______________________________________________<u></u><u></u></pre><pre>postgis-users mailing list<u></u><u></u></pre><pre><a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.refractions.net</a><u></u><u></u></pre>
<pre><a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><u></u><u></u></pre><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""><br>
<br><u></u><u></u></span></p><pre>-- <u></u><u></u></pre><pre>Julien-Pierre Guilloux<u></u><u></u></pre><pre>Service scientifique - Géomatique<u></u><u></u></pre><pre>Parc National des Ecrins<u></u><u></u></pre><pre>Domaine de Charance<u></u><u></u></pre>
<pre>05 000 GAP<u></u><u></u></pre><pre>tél : 04.92.40.20.10<u></u><u></u></pre><pre>fax : 04.92.52.38.34<u></u><u></u></pre><pre><a href="mailto:julien.guilloux@ecrins-parcnational.fr" target="_blank">julien.guilloux@ecrins-parcnational.fr</a><u></u><u></u></pre>
</div></div></div><div><div class="h5"><br>This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.

Please Consider the Environment Before Printing This Email </div></div></div><br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
<br></blockquote></div><br></div>