[postgis-users] merging islands with state to create single multipoly geom

Muhammad Imran imranserver at yahoo.com
Mon Jan 14 04:56:53 PST 2013


Hi Gaurav,

You can try the following query,

SELECT gid, ST_Collect(ST_ExteriorRing(the_geom)) AS erings
	FROM (SELECT gid, (ST_Dump(the_geom)).geom As the_geom
			FROM sometable) As foo
GROUP BY gid;

--3d Example
SELECT ST_AsEWKT(
	ST_ExteriorRing(
	ST_GeomFromEWKT('POLYGON((0 0 1, 1 1 1, 1 2 1, 1 1 1, 0 0 1))')
	)
);

regards
- Imran

--- On Mon, 1/14/13, Gaurav Singh <singh09721 at itc.nl> wrote:

From: Gaurav Singh <singh09721 at itc.nl>
Subject: [postgis-users] merging islands with state to create single multipoly geom
To: "postgis-users at postgis.refractions.net" <postgis-users at postgis.refractions.net>
Cc: "postgis-users at lists.osgeo.org" <postgis-users at lists.osgeo.org>
Date: Monday, January 14, 2013, 5:54 PM

Hi All,  I have a multipologon geometry of a state with islands as shown in attached Fig1 and I want to convert that state boundary by merging  the islands and filling the gaps as shown in Fig2. Can someone please tell me how can I get the Fig2.  Thanks Gaurav 
-----Inline Attachment Follows-----

_______________________________________________
postgis-users mailing list
postgis-users at lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130114/2169e1c8/attachment.html>


More information about the postgis-users mailing list