There are several answers for this question on GIS stackexchange but none using open/free software.
How can someone without access to the Esri suite remove interior holes from a polygon?
Example data is available here
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
so i took the data given by Hugh_Kelley and i was able to find a good postgis solution.
I imported both shapefiles in PostgresSql and used this query.
I expected to find a lot of polygons with holes but it was mainly multi geometry as you can see on the picture.
CREATE TABLE public.result_union as ( SELECT St_SetSrid( ST_MakePolygon (St_ExteriorRing( St_union( (polys.geom)))),27700) AS poly_boundary from polys)
With this query, I found the same geometry as the boundary shapefile given by Hugh.
The St_exteriorRing function only accept polygon, so you can not just St_Collect them.
You really need to do a St_Union to dissolve the boundary and if it gives back a MultiGeometrie which is possible, you will have to dump it with St_Dump and do a St_ExteriorRing on each part.
The performance here was ok , 13 secondes , but with the union involved, I suspect it can be hard to use this on a very high number of geometry.
This may be possible to do in PostGIS using
ST_Dump but when I tried I got an error saying:
Can't resolve struct type geometry_dump
A search for the error seemed to indicate that this meant that PostGIS wasn't installed correctly, but that seems unlikely in my case. I never resolved this error.
Instead I used QGIS, which is easily connected to a PostgreSQL database.
There is a
Delete Holes function you can find by searching in the processing toolbox.