This project has moved and is read-only. For the latest updates, please go here.

Merging Polygons

Topics: Algorithms, SharpMap v2.0
Sep 6, 2008 at 7:17 PM

Is there a method to merge polygons or does anyone know of a library that will do it? I have zip code boundaries and I would like to merge a group of them together to produce one simple polygon.

Sep 10, 2008 at 12:16 AM
Damn, no ideas from anyone? How about any tools that will do it from a command line execution? I can export a shapefile from Sharpmap and then merge?
Sep 10, 2008 at 12:42 AM
If they are adjacent then geom.Union(otherGeom) may be what you need.. hth jd
Sep 10, 2008 at 3:09 AM
Thanks, I looked into that and I wasnt able to figure it out. Probably quite easy but for whatever reason (most likely hangover on Saturday) I wasnt able to do it. But today I decided to upgrade my Dev instance of SQL from 2005 to 2008 and realized it has quite a few powerful spatial features built in. I also found a little toolkit on CodePlex ( that had a new aggregate with a buffer. That did the trick for me.
Sep 10, 2008 at 8:39 PM
To solve this problem I use NTS and sharpmap.

Dim _geo01 As Geometry = New WKTReader().Read(Me.txtWKT01.Text)
Dim _geo02 As Geometry = New WKTReader().Read(Me.txtWKT02.Text)
Dim _geo03 As GisSharpBlog.NetTopologySuite.Geometries.Geometry = Nothing

_geo03 = _geo01.Union(_geo02)