[postgis-users] ESRI-style dissolve polygons
Tom Glancy
Tom.Glancy at dnr.state.mn.us
Tue May 27 07:02:51 PDT 2008
We have a state-wide polygon shapefile (National Wetland Inventory) that originated as a tiled Arc/Info coverage. As a first step to normalizing the data, we wanted to do an ESRI-style dissolve to eliminate the tile boundaries. We were unsuccessful using ArcView, Arc/Info and ArcGIS, but PostGIS worked just fine.
We imported the shapefile data into PostGIS, starting with 1.44M records in 6800 tiles. Here is the process we followed:
1 - use ST_Intersects to build a new table of gids of intersecting geometries
2 - examine the table of gids and identify new (dissolved) polygons
3 - assign all intersecting gids to the new polygons
4 - check that the new polygons don't overlap
5 - use ST_Union to union the new polygons and add back to the original table
6 - delete "dissolved" records from the original table.
We created a function that ran all the steps automatically. The process ran overnight and completed in 8-16 hours. It found 48,000 intersecting polygons that were combined to produce 5200 polygons. The biggest combination was about 80 polygons, the smallest was 2.
We thought you might like to hear another PostGIS success story!
Regards,
Tom
---------------------------------------
Tom Glancy
Ecological Services Division IT Supervisor
tom.glancy at dnr.state.mn.us
651-259-5097
Minnesota Department of Natural Resources
500 Lafayette Road - Box 25
St. Paul, MN 55155-4025
---------------------------------------
More information about the postgis-users
mailing list