morgan herlocker

about twitter github posts rss

Convex Hull in Javascript

Using turf, we can a create convex hull from a set of points with just a few lines of javacript.

var t = require('turf')

t.load('../test/testIn/convexIn.geojson', function(err, points){
  t.convex(points, function(err, hull){
    if(err) throw err

Here is the input:

and here is the result: