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

turf-centroid

Package Overview
Dependencies
Maintainers
9
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

turf-centroid - npm Package Compare versions

Comparing version 3.0.10 to 3.0.12

6

package.json
{
"name": "turf-centroid",
"version": "3.0.10",
"version": "3.0.12",
"description": "turf centroid module",

@@ -31,5 +31,5 @@ "main": "index.js",

"dependencies": {
"turf-meta": "^3.0.10",
"turf-helpers": "^3.0.10"
"turf-meta": "^3.0.12",
"turf-helpers": "^3.0.12"
}
}
# turf-centroid
[![build status](https://secure.travis-ci.org/Turfjs/turf-centroid.png)](http://travis-ci.org/Turfjs/turf-centroid)
# centroid
turf centroid module
### `turf.centroid(features)`
Takes one or more features and calculates the centroid using the arithmetic mean of all vertices.
Takes one or more features and calculates the centroid using
the mean of all vertices.
This lessens the effect of small islands and artifacts when calculating
the centroid of a set of polygons.
**Parameters**
### Parameters
- `features` **(Feature | FeatureCollection)** input features
| parameter | type | description |
| ---------- | -------------------------- | -------------- |
| `features` | Feature\,FeatureCollection | input features |
**Examples**
### Example
```js
```javascript
var poly = {

@@ -50,9 +42,15 @@ "type": "Feature",

Returns **Feature<Point>** the centroid of the input features
**Returns** `Feature.<Point>`, the centroid of the input features
---
## Installation
This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.
Requires [nodejs](http://nodejs.org/).
### Installation
Install this module individually:
```sh

@@ -62,8 +60,6 @@ $ npm install turf-centroid

## Tests
Or install the Turf module that includes it as a function:
```sh
$ npm test
$ npm install turf
```
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