@turf/bbox
Advanced tools
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) { |
{ | ||
"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)<[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)<[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: |
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
6258
91
56
Updated@turf/meta@^3.5.3