turf-centroid
Advanced tools
Comparing version 3.0.10 to 3.0.12
{ | ||
"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 | ||
``` | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4952
64
Updatedturf-helpers@^3.0.12
Updatedturf-meta@^3.0.12