geokit/geokit — pull request #147 by tmeusburger (2014-08-05 08:28:42+00:00)
Title: Implementation and tests for generating a polygons centroid

Logic to generate the centroid of a polygon.
http://en.wikipedia.org/wiki/Centroid

Can be used as a ruff center of a polygon if necessary but is logically different.

Here is the test data with the proper centroid for demonstration. The centroid is the last point in the list of points so you can easily remove and add it back in to see where it is.

Simple Polygon
http://www.darrinward.com/lat-long/?id=224260

Complex Polygon
http://www.darrinward.com/lat-long/?id=224264

Open Polygon
http://www.darrinward.com/lat-long/?id=224259

Please let me know if you'd like me to create a separate test file instead of renaming the polygon_contains test and using it for both pieces of logic.