Split Polygon Demo

This interactive map uses the Turf.js geometry library to demonstrate one way to split up a polygon into n separate polygons. It steps through:

  1. Create a bunch of random points
  2. Cluster the points using K-Means.
  3. Create a centroid for each cluster
  4. Use the centroid points to generate polygons using the Voronoi algorithm (also called Thiessen polygons).
Author: Gavin Rehkemper
View Map