开发者社区> 镜像站> NPM> turf-convex
turf-convex

# convex

Turf packages are now namespaced: please use @turf/convex instead
Last updated 4 years ago by tmcw .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install turf-convex 
SYNC missed versions from official npm registry.

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

parameter type description
input GeoJSON any 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

Current Tags

  • 3.0.7-canary.ae89c8b3                                ...           canary (4 years ago)
  • 3.0.12                                ...           latest (4 years ago)

15 Versions

  • 3.0.12 [deprecated]           ...           4 years ago
  • 3.0.10 [deprecated]           ...           4 years ago
  • 3.0.7-canary.ae89c8b3                                ...           4 years ago
  • 3.0.7 [deprecated]           ...           4 years ago
  • 3.0.5 [deprecated]           ...           5 years ago
  • 3.0.1 [deprecated]           ...           5 years ago
  • 3.0.0-canary.7879bf6c                                ...           5 years ago
  • 3.0.0-canary.2f5f7167                                ...           5 years ago
  • 1.0.1 [deprecated]           ...           6 years ago
  • 1.0.0 [deprecated]           ...           6 years ago
  • 0.1.1 [deprecated]           ...           6 years ago
  • 0.0.2 [deprecated]           ...           6 years ago
  • 0.1.0 [deprecated]           ...           6 years ago
  • 0.0.1 [deprecated]           ...           7 years ago
  • 0.0.0 [deprecated]           ...           7 years ago
Downloads
Today 1
This Week 145
This Month 110
Last Day 39
Last Week 196
Last Month 821
Dependencies (3)
Dev Dependencies (3)
Dependents (2)