3.0.12 • Published 9 years ago

turf-convex v3.0.12

Weekly downloads
11,510
License
ISC
Repository
github
Last release
9 years ago

turf-convex

build status

turf.convex(input)

Takes any GeoJSON object and returns a convex hull polygon.

Internally this implements a Monotone chain algorithm.

Parameters

parametertypedescription
inputGeoJSONany GeoJSON object

Example

var points = turf.featurecollection([
  turf.point([10.195312, 43.755225]),
  turf.point([10.404052, 43.8424511]),
  turf.point([10.579833, 43.659924]),
  turf.point([10.360107, 43.516688]),
  turf.point([10.14038, 43.588348]),
  turf.point([10.195312, 43.755225])]);

var hull = turf.convex(points);

var result = turf.featurecollection(
  points.features.concat(hull));

//=result

Returns Feature, a Polygon feature

Installation

Requires nodejs.

$ npm install turf-convex

Tests

$ npm test
3.0.12

9 years ago

3.0.10

9 years ago

3.0.7

9 years ago

3.0.5

10 years ago

3.0.1

10 years ago

1.0.1

11 years ago

1.0.0

11 years ago

0.1.1

11 years ago

0.0.2

11 years ago

0.1.0

11 years ago

0.0.1

11 years ago

0.0.0

11 years ago