3.0.12 • Published 8 years ago

turf-convex v3.0.12

Weekly downloads
11,510
License
ISC
Repository
github
Last release
8 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

8 years ago

3.0.10

8 years ago

3.0.7

8 years ago

3.0.5

8 years ago

3.0.1

8 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.1.1

10 years ago

0.0.2

10 years ago

0.1.0

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago