AkHil,

It could be you don't have holes at all and what you have are invalid
multipolygons that intersect each other.  On screen they may appear to be
holes because one polygon is within another.

One way to turn the overlapping/inner polygons into holes is to do a
ST_BuildArea on them.
http://www.postgis.org/documentation/manual-svn/ST_BuildArea.html

So 
1) Take your original set of data and do a

SELECT gid, ST_BuildArea(the_geom) As the_geom
INTO newtable
FROM origtable

2) Then reapply what we mentioned ST_ExteriorRing to get the holes out.

Hope that helps,
Regina 

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Akhil
Jaggarwal
Sent: Tuesday, November 03, 2009 4:54 PM
To: [email protected]
Subject: [postgis-users] Removing holes from polygons

Thanks Paragon Corp and strk.

I've tried both the queries but I'm getting back the same multipolygon which
I had to explode to do subsetting.

The exploded table had 416 geometries (holes + polygons) as compared to the
original table with multipolygons which has 234 geometries.

I've also tried union to get the bigger of the contained geometries but that
doesn't seem to work either.


Regards
AKhil
_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users



_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to