@turf/bbox
Advanced tools
Comparing version 6.0.0 to 6.0.1
24
index.js
@@ -19,15 +19,19 @@ "use strict"; | ||
function bbox(geojson) { | ||
var BBox = [Infinity, Infinity, -Infinity, -Infinity]; | ||
var result = [Infinity, Infinity, -Infinity, -Infinity]; | ||
meta_1.coordEach(geojson, function (coord) { | ||
if (BBox[0] > coord[0]) | ||
BBox[0] = coord[0]; | ||
if (BBox[1] > coord[1]) | ||
BBox[1] = coord[1]; | ||
if (BBox[2] < coord[0]) | ||
BBox[2] = coord[0]; | ||
if (BBox[3] < coord[1]) | ||
BBox[3] = coord[1]; | ||
if (result[0] > coord[0]) { | ||
result[0] = coord[0]; | ||
} | ||
if (result[1] > coord[1]) { | ||
result[1] = coord[1]; | ||
} | ||
if (result[2] < coord[0]) { | ||
result[2] = coord[0]; | ||
} | ||
if (result[3] < coord[1]) { | ||
result[3] = coord[1]; | ||
} | ||
}); | ||
return BBox; | ||
return result; | ||
} | ||
exports.default = bbox; |
{ | ||
"name": "@turf/bbox", | ||
"version": "6.0.0", | ||
"version": "6.0.1", | ||
"description": "turf bbox module", | ||
"main": "index", | ||
"types": "index.d.ts", | ||
"files": [ | ||
"index.js", | ||
"index.ts" | ||
"index.d.ts" | ||
], | ||
"scripts": { | ||
"prepare": "tsc", | ||
"pretest": "tsc", | ||
@@ -37,3 +39,5 @@ "test": "node test.js", | ||
"typescript": "*", | ||
"tape": "*" | ||
"tape": "*", | ||
"tslint": "*", | ||
"@types/tape": "*" | ||
}, | ||
@@ -40,0 +44,0 @@ "dependencies": { |
@@ -11,3 +11,3 @@ # @turf/bbox | ||
- `geojson` **[GeoJSON](https://tools.ietf.org/html/rfc7946#section-3)** any GeoJSON object | ||
- `geojson` **[GeoJSON][1]** any GeoJSON object | ||
@@ -25,4 +25,8 @@ **Examples** | ||
Returns **[BBox](https://tools.ietf.org/html/rfc7946#section-5)** bbox extent in [minX, minY, maxX, maxY] order | ||
Returns **[BBox][2]** bbox extent in [minX, minY, maxX, maxY] order | ||
[1]: https://tools.ietf.org/html/rfc7946#section-3 | ||
[2]: https://tools.ietf.org/html/rfc7946#section-5 | ||
<!-- This file is automatically generated. Please don't edit it directly: | ||
@@ -29,0 +33,0 @@ if you find an error, edit the source file (likely index.js), and re-run |
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
54
4911
5
52