[postgis-users] how to convert GeometryCollection tomultipolygon shape

Hugues François hugues.francois at irstea.fr
Mon Apr 28 00:14:19 PDT 2014


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-users-bounces at lists.osgeo.org [mailto:postgis-users-bounces at 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

SELECT ST_CollectionExtract(geom,3) AS geom
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

2014-04-25 19:40 GMT+02:00 <islanis at infomed.sld.cu>:
islanis at infomed.sld.cu escribió:

"Rémi Cura" <remi.cura at 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



2014-04-25 19:08 GMT+02:00 <islanis at infomed.sld.cu>:
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
postgis-users at lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users




----------------------------------------------------------------
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
postgis-users at lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users



----------------------------------------------------------------
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/



More information about the postgis-users mailing list