Socket
Socket
Sign inDemoInstall

@turf/bbox

Package Overview
Dependencies
Maintainers
2
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/bbox - npm Package Compare versions

Comparing version 3.5.2 to 3.5.3

53

index.js

@@ -8,51 +8,18 @@ var each = require('@turf/meta').coordEach;

* @param {(Feature|FeatureCollection)} geojson input features
* @return {Array<number>} the bounding box of `input` given
* as an array in WSEN order (west, south, east, north)
* @return {Array<number>} bbox extent in [minX, minY, maxX, maxY] order
* @example
* var input = {
* "type": "FeatureCollection",
* "features": [
* {
* "type": "Feature",
* "properties": {},
* "geometry": {
* "type": "Point",
* "coordinates": [114.175329, 22.2524]
* }
* }, {
* "type": "Feature",
* "properties": {},
* "geometry": {
* "type": "Point",
* "coordinates": [114.170007, 22.267969]
* }
* }, {
* "type": "Feature",
* "properties": {},
* "geometry": {
* "type": "Point",
* "coordinates": [114.200649, 22.274641]
* }
* }, {
* "type": "Feature",
* "properties": {},
* "geometry": {
* "type": "Point",
* "coordinates": [114.186744, 22.265745]
* }
* }
* ]
* };
* var pt1 = point([114.175329, 22.2524])
* var pt2 = point([114.170007, 22.267969])
* var pt3 = point([114.200649, 22.274641])
* var pt4 = point([114.200649, 22.274641])
* var pt5 = point([114.186744, 22.265745])
* var features = featureCollection([pt1, pt2, pt3, pt4, pt5])
*
* var bbox = turf.bbox(input);
* var bbox = turf.bbox(features);
*
* var bboxPolygon = turf.bboxPolygon(bbox);
*
* var resultFeatures = input.features.concat(bboxPolygon);
* var result = {
* "type": "FeatureCollection",
* "features": resultFeatures
* };
* //=bbox
*
* //=result
* //=bboxPolygon
*/

@@ -59,0 +26,0 @@ module.exports = function (geojson) {

4

package.json
{
"name": "@turf/bbox",
"version": "3.5.2",
"version": "3.5.3",
"description": "turf bbox module",

@@ -32,4 +32,4 @@ "main": "index.js",

"dependencies": {
"@turf/meta": "^3.5.2"
"@turf/meta": "^3.5.3"
}
}

@@ -14,52 +14,19 @@ # @turf/bbox

```javascript
var input = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [114.175329, 22.2524]
}
}, {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [114.170007, 22.267969]
}
}, {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [114.200649, 22.274641]
}
}, {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [114.186744, 22.265745]
}
}
]
};
var pt1 = point([114.175329, 22.2524])
var pt2 = point([114.170007, 22.267969])
var pt3 = point([114.200649, 22.274641])
var pt4 = point([114.200649, 22.274641])
var pt5 = point([114.186744, 22.265745])
var features = featureCollection([pt1, pt2, pt3, pt4, pt5])
var bbox = turf.bbox(input);
var bbox = turf.bbox(features);
var bboxPolygon = turf.bboxPolygon(bbox);
var resultFeatures = input.features.concat(bboxPolygon);
var result = {
"type": "FeatureCollection",
"features": resultFeatures
};
//=bbox
//=result
//=bboxPolygon
```
Returns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>** the bounding box of `input` given
as an array in WSEN order (west, south, east, north)
Returns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>** bbox extent in [minX, minY, maxX, maxY] order

@@ -66,0 +33,0 @@ <!-- This file is automatically generated. Please don't edit it directly:

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