This project is read-only.

Code / Ideas on how to simplify polygons?

Jul 5, 2013 at 4:33 PM
I have an external app that can only accept a limited number of polygon vertices.
My goal is to take a typical US county of 3000 coordinates and reduce it down to 20 or so.

I think I need to consider both the line length - ie throw away the shortest lines
and possibly the line angle - throw away lines that are only slightly offset from the last line.


Any suggestions on how to do this?

Thanks

Bill
Jul 5, 2013 at 8:51 PM
Look in the Topology.Simplify namespace. There are a few simplifiers to choose from. I have used the Douglas Peucker simplifier which is a well-known one.
Kyle
Jul 10, 2013 at 6:39 PM
Thanks - I had no idea this was already there!
Is there any documentation on how the algorithm works etc?

Bill
Jul 11, 2013 at 1:47 PM
I'm not aware of any DotSpatial documentation. But, if you search for the Douglas Peucker algorithm on the internet, you should be able to find some.