[postgis-users] [!! SPAM] multipolygon to single polygon

Nicolas Ribot nicolas.ribot at gmail.com
Thu Apr 26 08:32:55 PDT 2012


Hi,

As Julien suggested, you could st_dump to explode multipolygons into
polygons, then union them.
It will produce a single polygon unioning all others:

with t as (
    select (st_dump(geom)).geom
    from my_table
) select st_union(geom) from t;

Nicolas

On 26 April 2012 17:22, Mehmet Erkek <merkek at reidin.com> wrote:

> Hi Juilen, thanks for quick answer. ****
>
> ** **
>
> I have 1 geometry and 1 row on the table. this geometry is multiploygon
> which consists of 4 polygons.****
>
> I want to convert this mutlipolygon to one single polygon..****
>
> ** **
>
> Any idea how I can do this?****
>
> I hope it is clearer now.****
>
> ** **
>
> Thanks.****
>
> ** **
>
> ** **
>
> *From:* postgis-users-bounces at postgis.refractions.net [mailto:
> postgis-users-bounces at postgis.refractions.net] *On Behalf Of *ju
> *Sent:* 26 Nisan 2012 18:02
> *To:* PostGIS Users Discussion
> *Subject:* Re: [postgis-users] [!! SPAM] multipolygon to single polygon***
> *
>
> ** **
>
> not clear...
>
> 1) if you have 4 polygons in 4 rows table distinct, this is not a multi
> object issu. for  this case use
>  dissolve to group polygone into only one, this is not a topic of dump.
>
>
> 2) if you have 1 geometry and 1 row on the tablme, so this is a multi
> object topic
> you must sperate the differents objet of the collection
>
> here : http://www.postgis.org/docs/ST_GeometryN.html****
>
> --Extracting all geometries (useful when you want to assign an id)****
>
> SELECT gid, n, ST_GeometryN(the_geom, n)****
>
> FROM sometable CROSS JOIN generate_series(1,100) n****
>
> WHERE n <= ST_NumGeometries(the_geom);****
>
>
> best regards, julien
>
>
>
> Le 26/04/2012 16:27, Mehmet Erkek a écrit : ****
>
>  ****
>
> 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. ****
>
>  ****
>
>  ****
>
> ****
>
>  ****
>
> *Mehmet Erkek*****
>
> www.REIDIN.com <http://www.reidin.com/> ****
>
>  ****
>
>
> 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
>
>
> ****
>
> _______________________________________________****
>
> postgis-users mailing list****
>
> postgis-users at postgis.refractions.net****
>
> http://postgis.refractions.net/mailman/listinfo/postgis-users****
>
>
>
> ****
>
> -- ****
>
> Julien-Pierre Guilloux****
>
> Service scientifique - Géomatique****
>
> Parc National des Ecrins****
>
> Domaine de Charance****
>
> 05 000 GAP****
>
> tél : 04.92.40.20.10****
>
> fax : 04.92.52.38.34****
>
> julien.guilloux at ecrins-parcnational.fr****
>
>
> 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
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120426/c0dff3c8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 11627 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120426/c0dff3c8/attachment.png>


More information about the postgis-users mailing list