[postgis-users] how to convert GeometryCollection to multipolygon shape

2,008 views
Skip to first unread message

isl...@infomed.sld.cu

unread,
Apr 25, 2014, 1:08:00 PM4/25/14
to PostGIS Users Discussion
Hi people i need help in converting a shape that have a
GeometryCollection data to a multipolygon shape, at least a routine or
a function that do that.

thanks

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



--

Este mensaje le ha llegado mediante el servicio de correo electronico que ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema Nacional de Salud. La persona que envia este correo asume el compromiso de usar el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/

_______________________________________________
postgis-users mailing list
postgi...@lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users

Rémi Cura

unread,
Apr 25, 2014, 1:33:54 PM4/25/14
to PostGIS Users Discussion
Hey,
have a look at ST_CollectionExctract.
http://postgis.refractions.net/docs/ST_CollectionExtract.html

Cheers,
Rémi-C

isl...@infomed.sld.cu

unread,
Apr 25, 2014, 1:39:00 PM4/25/14
to PostGIS Users Discussion, Rémi Cura
"Rémi Cura" <remi...@gmail.com> escribió:

But what I want is to homogenize an entire layer, for example, a layer
containing both multipolygons and collections, bring all components of
this layer to multipolygons.

something like this is that i want.

isl...@infomed.sld.cu

unread,
Apr 25, 2014, 1:40:19 PM4/25/14
to PostGIS Users Discussion, isl...@infomed.sld.cu, PostGIS Users Discussion
isl...@infomed.sld.cu escribió:

> "Rémi Cura" <remi...@gmail.com> escribió:
>
> But what I want is to homogenize an entire layer, for example, a
> layer containing both multipolygons and collections, bring all
> components of this layer to multipolygons.
>
> something like this is that i want.
>
>> Hey,
>> have a look at ST_CollectionExctract.
>> http://postgis.refractions.net/docs/ST_CollectionExtract.html
>>
>> Cheers,
>> Rémi-C

How can i use it, please give an exmaple

Rémi Cura

unread,
Apr 27, 2014, 10:18:08 AM4/27/14
to J.Alejandro Martinez Linares, PostGIS Users Discussion
FROM your_table_with_mixed_geometry

It will not change polygon or multi polygon, but will extract it from geometry collection.

CHeers,
Rémi-C

Hugues François

unread,
Apr 28, 2014, 3:14:19 AM4/28/14
to PostGIS Users Discussion
Hello,

If you want also declare polygons as multipolygons ("bring all components of this layer to multipolygons"), you can use ST_Multi(ST_CollectionExtract(geom,3))

Hugues.


De : postgis-us...@lists.osgeo.org [mailto:postgis-us...@lists.osgeo.org] De la part de Rémi Cura
Envoyé : dimanche 27 avril 2014 16:18
À : J.Alejandro Martinez Linares
Cc : PostGIS Users Discussion
Objet : Re: [postgis-users] how to convert GeometryCollection tomultipolygon shape
Reply all
Reply to author
Forward
0 new messages