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

@turf/centroid

Package Overview
Dependencies
Maintainers
4
Versions
61
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 4.1.0 to 4.2.0

20

index.js

@@ -14,3 +14,3 @@ var each = require('@turf/meta').coordEach;

* @example
* var poly = {
* var polygon = {
* "type": "Feature",

@@ -20,20 +20,10 @@ * "properties": {},

* "type": "Polygon",
* "coordinates": [[
* [105.818939,21.004714],
* [105.818939,21.061754],
* [105.890007,21.061754],
* [105.890007,21.004714],
* [105.818939,21.004714]
* ]]
* "coordinates": [[[-81, 41], [-88, 36], [-84, 31], [-80, 33], [-77, 39], [-81, 41]]]
* }
* };
*
* var centroidPt = turf.centroid(poly);
* var centroid = turf.centroid(polygon);
*
* var result = {
* "type": "FeatureCollection",
* "features": [poly, centroidPt]
* };
*
* //=result
* //addToMap
* var addToMap = [polygon, centroid]
*/

@@ -40,0 +30,0 @@ module.exports = function (features) {

{
"name": "@turf/centroid",
"version": "4.1.0",
"version": "4.2.0",
"description": "turf centroid module",

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

"dependencies": {
"@turf/meta": "^4.1.0",
"@turf/helpers": "^4.1.0"
"@turf/meta": "^4.2.0",
"@turf/helpers": "^4.2.0"
}
}

@@ -17,3 +17,3 @@ # @turf/centroid

```javascript
var poly = {
var polygon = {
"type": "Feature",

@@ -23,20 +23,10 @@ "properties": {},

"type": "Polygon",
"coordinates": [[
[105.818939,21.004714],
[105.818939,21.061754],
[105.890007,21.061754],
[105.890007,21.004714],
[105.818939,21.004714]
]]
"coordinates": [[[-81, 41], [-88, 36], [-84, 31], [-80, 33], [-77, 39], [-81, 41]]]
}
};
var centroidPt = turf.centroid(poly);
var centroid = turf.centroid(polygon);
var result = {
"type": "FeatureCollection",
"features": [poly, centroidPt]
};
//=result
//addToMap
var addToMap = [polygon, centroid]
```

@@ -43,0 +33,0 @@

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