Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

turf-convex

Package Overview
Dependencies
Maintainers
8
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

turf-convex

[![build status](https://secure.travis-ci.org/Turfjs/turf-convex.png)](http://travis-ci.org/Turfjs/turf-convex)

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9.2K
decreased by-25.66%
Maintainers
8
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 06 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc