The purpose of this project is to split a given JTS polygon into any number of equal areas, while ensuring minimum length of line based cuts. The solution is based on this algorithm by Sumit Khetarpal. It works for both convex and concave polygons, as long as they don't have any intersecting edges and are defined by a single exterior ring.
Polygon polygon = (Polygon) new WKTReader().read("POLYGON ((0 0, 100 0, 90 50, 10 50, 0 0))");
List<Polygon> parts = new GreedyPolygonSplitter().split(polygon, 2);
Caution: carefuly test the code before considering it production-ready!
A list of known issues can be found under the issues tab.
The project is built using Maven.
Currently requires JDK 8.
Unit tests are present for most methods.
Test cases covering real-world or randomly generated scenarios could be added.
Developed by: Gediminas Rimša
Sponsored by: Incentergy GmbH
Contributions are welcome!
Licensed under the MIT license.