[postgis-users] create multipolygon

eehab hamzeh eehab40 at hotmail.com
Thu Sep 24 03:18:30 PDT 2009


Hello 

I have the following table which has polygons, i need to create a multipolygon from these polygons
i tried to use the following query, but the result are strange

331;"POLYGON((-14161.75 2241.76 2600,-14161.75 2241.76 2900,-14161.75 1941.76 2900,-14161.75 1941.76 2600,-14161.75 2241.76 2600))"
338;"POLYGON((-9336.75 2241.76 2600,-9336.75 2241.76 2900,-9336.75 1941.76 2900,-9336.75 1941.76 2600,-9336.75 2241.76 2600))"
341;"POLYGON((-14161.75 1941.76 2600,-14161.75 2241.76 2600,-9336.75 2241.76 2600,-9336.75 1941.76 2600,-14161.75 1941.76 2600))"
344;"POLYGON((-14161.75 1941.76 2900,-14161.75 1941.76 2600,-9336.75 1941.76 2600,-9336.75 1941.76 2900,-14161.75 1941.76 2900))"
347;"POLYGON((-14161.75 2241.76 2900,-14161.75 1941.76 2900,-9336.75 1941.76 2900,-9336.75 2241.76 2900,-14161.75 2241.76 2900))"
350;"POLYGON((-14161.75 2241.76 2600,-14161.75 2241.76 2900,-9336.75 2241.76 2900,-9336.75 2241.76 2600,-14161.75 2241.76 2600))"
331;"POLYGON((-14161.75 2241.76 2600,-14161.75 2241.76 2900,-14161.75 1941.76 2900,-14161.75 1941.76 2600,-14161.75 2241.76 2600))"

SELECT asEwkt(ST_Multi(ST_Union(ARRAY(SELECT the_geom FROM faces_obj))));

the result

"MULTIPOLYGON(((-14161.75 1941.76 2750,-14161.75 2241.76 2750,-9336.75 2241.76 2600,-9336.75 1941.76 2750,-14161.75 1941.76 2600)))"

Kind regards

Ihab 

 		 	   		  
_________________________________________________________________
Show them the way! Add maps and directions to your party invites. 
http://www.microsoft.com/windows/windowslive/products/events.aspx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20090924/d0baa271/attachment.html>


More information about the postgis-users mailing list