turf-convex

WebJar for turf-convex

License

License

ISC
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

turf-convex
Last Version

Last Version

3.0.12
Release Date

Release Date

Type

Type

jar
Description

Description

turf-convex
WebJar for turf-convex
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/turf-junkyard/turf-convex

Download turf-convex

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/turf-convex/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>turf-convex</artifactId>
    <version>3.0.12</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/turf-convex/
implementation 'org.webjars.npm:turf-convex:3.0.12'
// https://jarcasting.com/artifacts/org.webjars.npm/turf-convex/
implementation ("org.webjars.npm:turf-convex:3.0.12")
'org.webjars.npm:turf-convex:jar:3.0.12'
<dependency org="org.webjars.npm" name="turf-convex" rev="3.0.12">
  <artifact name="turf-convex" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='turf-convex', version='3.0.12')
)
libraryDependencies += "org.webjars.npm" % "turf-convex" % "3.0.12"
[org.webjars.npm/turf-convex "3.0.12"]

Dependencies

compile (3)

Group / Artifact Type Version
org.webjars.npm : convex-hull jar [1.0.3,2)
org.webjars.npm : turf-meta jar [3.0.12,4)
org.webjars.npm : turf-helpers jar [3.0.12,4)

Project Modules

There are no modules declared in this project.

turf-convex

build status

turf.convex(input)

Takes a set of Point|points and returns a convex hull polygon.

Internally this uses the convex-hull module that implements a monotone chain hull.

Parameters

parameter type description
input FeatureCollection.<Point> input points

Example

var points = {
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [10.195312, 43.755225]
      }
    }, {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [10.404052, 43.8424511]
      }
    }, {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [10.579833, 43.659924]
      }
    }, {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [10.360107, 43.516688]
      }
    }, {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [10.14038, 43.588348]
      }
    }, {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [10.195312, 43.755225]
      }
    }
  ]
};

var hull = turf.convex(points);

var resultFeatures = points.features.concat(hull);
var result = {
  "type": "FeatureCollection",
  "features": resultFeatures
};

//=result

Returns Feature.<Polygon>, a convex hull

Installation

Requires nodejs.

$ npm install turf-convex

Tests

$ npm test
org.webjars.npm

deprecated turf modules: do not use or reference, for redirects only

turf is now a monorepo: all turf modules are in Turfjs/turf

Versions

Version
3.0.12