@turf/bbox-polygon 7.0.0 → 7.1.0-alpha.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -3
- package/dist/cjs/index.cjs +1 -5
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +0 -4
- package/dist/esm/index.js.map +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ var poly = turf.bboxPolygon(bbox);
|
|
|
25
25
|
var addToMap = [poly]
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
Returns **[Feature][6]<[Polygon][
|
|
28
|
+
Returns **[Feature][6]<[Polygon][1]>** a Polygon representation of the bounding box
|
|
29
29
|
|
|
30
30
|
[1]: https://tools.ietf.org/html/rfc7946#section-3.1.6
|
|
31
31
|
|
|
@@ -39,8 +39,6 @@ Returns **[Feature][6]<[Polygon][7]>** a Polygon representation of the bounding
|
|
|
39
39
|
|
|
40
40
|
[6]: https://tools.ietf.org/html/rfc7946#section-3.2
|
|
41
41
|
|
|
42
|
-
[7]: https://tools.ietf.org/html/rfc7946#section-3.1.6
|
|
43
|
-
|
|
44
42
|
<!-- This file is automatically generated. Please don't edit it directly. If you find an error, edit the source file of the module in question (likely index.js or index.ts), and re-run "yarn docs" from the root of the turf project. -->
|
|
45
43
|
|
|
46
44
|
---
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true})
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
|
-
// index.ts
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// index.ts
|
|
5
2
|
var _helpers = require('@turf/helpers');
|
|
6
3
|
function bboxPolygon(bbox, options = {}) {
|
|
7
4
|
const west = Number(bbox[0]);
|
|
@@ -23,7 +20,6 @@ function bboxPolygon(bbox, options = {}) {
|
|
|
23
20
|
{ bbox, id: options.id }
|
|
24
21
|
);
|
|
25
22
|
}
|
|
26
|
-
__name(bboxPolygon, "bboxPolygon");
|
|
27
23
|
var turf_bbox_polygon_default = bboxPolygon;
|
|
28
24
|
|
|
29
25
|
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../index.ts"],"names":[],"mappings":";AACA,SAAS,eAAmB;AAmB5B,SAAS,YACP,MACA,UAGI,CAAC,GACgB;AAIrB,QAAM,OAAO,OAAO,KAAK,CAAC,CAAC;AAC3B,QAAM,QAAQ,OAAO,KAAK,CAAC,CAAC;AAC5B,QAAM,OAAO,OAAO,KAAK,CAAC,CAAC;AAC3B,QAAM,QAAQ,OAAO,KAAK,CAAC,CAAC;AAE5B,MAAI,KAAK,WAAW,GAAG;AACrB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,QAAM,UAAU,CAAC,MAAM,KAAK;AAC5B,QAAM,UAAU,CAAC,MAAM,KAAK;AAC5B,QAAM,WAAW,CAAC,MAAM,KAAK;AAC7B,QAAM,WAAW,CAAC,MAAM,KAAK;AAE7B,SAAO;AAAA,IACL,CAAC,CAAC,SAAS,UAAU,UAAU,SAAS,OAAO,CAAC;AAAA,IAChD,QAAQ;AAAA,IACR,EAAE,MAAM,IAAI,QAAQ,GAAG;AAAA,EACzB;AACF;AAGA,IAAO,4BAAQ","sourcesContent":["import { BBox, Feature, Polygon, GeoJsonProperties } from \"geojson\";\nimport { polygon, Id } from \"@turf/helpers\";\n\n/**\n * Takes a bbox and returns an equivalent {@link Polygon|polygon}.\n *\n * @name bboxPolygon\n * @param {BBox} bbox extent in [minX, minY, maxX, maxY] order\n * @param {Object} [options={}] Optional parameters\n * @param {Properties} [options.properties={}] Translate properties to Polygon\n * @param {string|number} [options.id={}] Translate Id to Polygon\n * @returns {Feature<Polygon>} a Polygon representation of the bounding box\n * @example\n * var bbox = [0, 0, 10, 10];\n *\n * var poly = turf.bboxPolygon(bbox);\n *\n * //addToMap\n * var addToMap = [poly]\n */\nfunction bboxPolygon<P extends GeoJsonProperties = GeoJsonProperties>(\n bbox: BBox,\n options: {\n properties?: P;\n id?: Id;\n } = {}\n): Feature<Polygon, P> {\n // Convert BBox positions to Numbers\n // No performance loss for including Number()\n // https://github.com/Turfjs/turf/issues/1119\n const west = Number(bbox[0]);\n const south = Number(bbox[1]);\n const east = Number(bbox[2]);\n const north = Number(bbox[3]);\n\n if (bbox.length === 6) {\n throw new Error(\n \"@turf/bbox-polygon does not support BBox with 6 positions\"\n );\n }\n\n const lowLeft = [west, south];\n const topLeft = [west, north];\n const topRight = [east, north];\n const lowRight = [east, south];\n\n return polygon(\n [[lowLeft, lowRight, topRight, topLeft, lowLeft]],\n options.properties,\n { bbox, id: options.id }\n );\n}\n\nexport { bboxPolygon };\nexport default bboxPolygon;\n"]}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
1
|
// index.ts
|
|
5
2
|
import { polygon } from "@turf/helpers";
|
|
6
3
|
function bboxPolygon(bbox, options = {}) {
|
|
@@ -23,7 +20,6 @@ function bboxPolygon(bbox, options = {}) {
|
|
|
23
20
|
{ bbox, id: options.id }
|
|
24
21
|
);
|
|
25
22
|
}
|
|
26
|
-
__name(bboxPolygon, "bboxPolygon");
|
|
27
23
|
var turf_bbox_polygon_default = bboxPolygon;
|
|
28
24
|
export {
|
|
29
25
|
bboxPolygon,
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts"],"sourcesContent":["import { BBox, Feature, Polygon, GeoJsonProperties } from \"geojson\";\nimport { polygon, Id } from \"@turf/helpers\";\n\n/**\n * Takes a bbox and returns an equivalent {@link Polygon|polygon}.\n *\n * @name bboxPolygon\n * @param {BBox} bbox extent in [minX, minY, maxX, maxY] order\n * @param {Object} [options={}] Optional parameters\n * @param {Properties} [options.properties={}] Translate properties to Polygon\n * @param {string|number} [options.id={}] Translate Id to Polygon\n * @returns {Feature<Polygon>} a Polygon representation of the bounding box\n * @example\n * var bbox = [0, 0, 10, 10];\n *\n * var poly = turf.bboxPolygon(bbox);\n *\n * //addToMap\n * var addToMap = [poly]\n */\nfunction bboxPolygon<P extends GeoJsonProperties = GeoJsonProperties>(\n bbox: BBox,\n options: {\n properties?: P;\n id?: Id;\n } = {}\n): Feature<Polygon, P> {\n // Convert BBox positions to Numbers\n // No performance loss for including Number()\n // https://github.com/Turfjs/turf/issues/1119\n const west = Number(bbox[0]);\n const south = Number(bbox[1]);\n const east = Number(bbox[2]);\n const north = Number(bbox[3]);\n\n if (bbox.length === 6) {\n throw new Error(\n \"@turf/bbox-polygon does not support BBox with 6 positions\"\n );\n }\n\n const lowLeft = [west, south];\n const topLeft = [west, north];\n const topRight = [east, north];\n const lowRight = [east, south];\n\n return polygon(\n [[lowLeft, lowRight, topRight, topLeft, lowLeft]],\n options.properties,\n { bbox, id: options.id }\n );\n}\n\nexport { bboxPolygon };\nexport default bboxPolygon;\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../index.ts"],"sourcesContent":["import { BBox, Feature, Polygon, GeoJsonProperties } from \"geojson\";\nimport { polygon, Id } from \"@turf/helpers\";\n\n/**\n * Takes a bbox and returns an equivalent {@link Polygon|polygon}.\n *\n * @name bboxPolygon\n * @param {BBox} bbox extent in [minX, minY, maxX, maxY] order\n * @param {Object} [options={}] Optional parameters\n * @param {Properties} [options.properties={}] Translate properties to Polygon\n * @param {string|number} [options.id={}] Translate Id to Polygon\n * @returns {Feature<Polygon>} a Polygon representation of the bounding box\n * @example\n * var bbox = [0, 0, 10, 10];\n *\n * var poly = turf.bboxPolygon(bbox);\n *\n * //addToMap\n * var addToMap = [poly]\n */\nfunction bboxPolygon<P extends GeoJsonProperties = GeoJsonProperties>(\n bbox: BBox,\n options: {\n properties?: P;\n id?: Id;\n } = {}\n): Feature<Polygon, P> {\n // Convert BBox positions to Numbers\n // No performance loss for including Number()\n // https://github.com/Turfjs/turf/issues/1119\n const west = Number(bbox[0]);\n const south = Number(bbox[1]);\n const east = Number(bbox[2]);\n const north = Number(bbox[3]);\n\n if (bbox.length === 6) {\n throw new Error(\n \"@turf/bbox-polygon does not support BBox with 6 positions\"\n );\n }\n\n const lowLeft = [west, south];\n const topLeft = [west, north];\n const topRight = [east, north];\n const lowRight = [east, south];\n\n return polygon(\n [[lowLeft, lowRight, topRight, topLeft, lowLeft]],\n options.properties,\n { bbox, id: options.id }\n );\n}\n\nexport { bboxPolygon };\nexport default bboxPolygon;\n"],"mappings":";AACA,SAAS,eAAmB;AAmB5B,SAAS,YACP,MACA,UAGI,CAAC,GACgB;AAIrB,QAAM,OAAO,OAAO,KAAK,CAAC,CAAC;AAC3B,QAAM,QAAQ,OAAO,KAAK,CAAC,CAAC;AAC5B,QAAM,OAAO,OAAO,KAAK,CAAC,CAAC;AAC3B,QAAM,QAAQ,OAAO,KAAK,CAAC,CAAC;AAE5B,MAAI,KAAK,WAAW,GAAG;AACrB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,QAAM,UAAU,CAAC,MAAM,KAAK;AAC5B,QAAM,UAAU,CAAC,MAAM,KAAK;AAC5B,QAAM,WAAW,CAAC,MAAM,KAAK;AAC7B,QAAM,WAAW,CAAC,MAAM,KAAK;AAE7B,SAAO;AAAA,IACL,CAAC,CAAC,SAAS,UAAU,UAAU,SAAS,OAAO,CAAC;AAAA,IAChD,QAAQ;AAAA,IACR,EAAE,MAAM,IAAI,QAAQ,GAAG;AAAA,EACzB;AACF;AAGA,IAAO,4BAAQ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turf/bbox-polygon",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.1.0-alpha.70+948cdafaf",
|
|
4
4
|
"description": "turf bbox-polygon module",
|
|
5
5
|
"author": "Turf Authors",
|
|
6
6
|
"license": "MIT",
|
|
@@ -62,8 +62,9 @@
|
|
|
62
62
|
"typescript": "^5.2.2"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@turf/helpers": "^7.0.
|
|
65
|
+
"@turf/helpers": "^7.1.0-alpha.70+948cdafaf",
|
|
66
|
+
"@types/geojson": "^7946.0.10",
|
|
66
67
|
"tslib": "^2.6.2"
|
|
67
68
|
},
|
|
68
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "948cdafaf70606d2e27fcc79973fa48ee1182067"
|
|
69
70
|
}
|