@turf/convex 7.1.0 → 7.2.0
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/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +10 -10
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-convex/dist/cjs/index.cjs","../../index.ts"],"names":[],"mappings":"AAAA;ACCA,wCAAoC;AACpC,kCAA0B;AAC1B,gGAAuB;AA8BvB,SAAS,MAAA,CACP,OAAA,EACA,QAAA,EAGI,CAAC,CAAA,EACuB;AAE5B,EAAA,OAAA,CAAQ,UAAA,EAAY,OAAA,CAAQ,UAAA,GAAa,QAAA;AAGzC,EAAA,MAAM,OAAA,EAAqB,CAAC,CAAA;AAG5B,EAAA,6BAAA,OAAU,EAAS,CAAC,KAAA,EAAA,GAAU;AAC5B,IAAA,MAAA,CAAO,IAAA,CAAK,CAAC,KAAA,CAAM,CAAC,CAAA,EAAG,KAAA,CAAM,CAAC,CAAC,CAAC,CAAA;AAAA,EAClC,CAAC,CAAA;AACD,EAAA,GAAA,CAAI,CAAC,MAAA,CAAO,MAAA,EAAQ;AAClB,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,MAAM,WAAA,EAAa,kCAAA,MAAW,EAAQ,OAAA,CAAQ,SAAS,CAAA;AAGvD,EAAA,GAAA,CAAI,UAAA,CAAW,OAAA,EAAS,CAAA,EAAG;AACzB,IAAA,OAAO,8BAAA,CAAS,UAAU,CAAC,CAAA;AAAA,EAC7B;AACA,EAAA,OAAO,IAAA;AACT;AAGA,IAAO,oBAAA,EAAQ,MAAA;AD5Cf;AACE;AACA;AACF,+DAAC","file":"/home/runner/work/turf/turf/packages/turf-convex/dist/cjs/index.cjs","sourcesContent":[null,"import { Feature, GeoJsonProperties, Polygon } from \"geojson\";\nimport { AllGeoJSON, polygon } from \"@turf/helpers\";\nimport { coordEach } from \"@turf/meta\";\nimport concaveman from \"concaveman\";\n\n/**\n * Takes a {@link Feature} or a {@link FeatureCollection} and returns a convex hull {@link Polygon}.\n *\n * Internally this uses\n * the [convex-hull](https://github.com/mikolalysenko/convex-hull) module that implements a\n * [monotone chain hull](http://en.wikibooks.org/wiki/Algorithm_Implementation/Geometry/Convex_hull/Monotone_chain).\n *\n * @function\n * @param {GeoJSON} geojson input Feature or FeatureCollection\n * @param {Object} [options={}] Optional parameters\n * @param {number} [options.concavity=Infinity] 1 - thin shape. Infinity - convex hull.\n * @param {Object} [options.properties={}] Translate Properties to Feature\n * @returns {Feature<Polygon>} a convex hull\n * @example\n * var points = turf.featureCollection([\n * turf.point([10.195312, 43.755225]),\n * turf.point([10.404052, 43.8424511]),\n * turf.point([10.579833, 43.659924]),\n * turf.point([10.360107, 43.516688]),\n * turf.point([10.14038, 43.588348]),\n * turf.point([10.195312, 43.755225])\n * ]);\n *\n * var hull = turf.convex(points);\n *\n * //addToMap\n * var addToMap = [points, hull]\n */\nfunction convex<P extends GeoJsonProperties = GeoJsonProperties>(\n geojson: AllGeoJSON,\n options: {\n concavity?: number;\n properties?: P;\n } = {}\n): Feature<Polygon, P> | null {\n // Default parameters\n options.concavity = options.concavity || Infinity;\n\n // Container\n const points: number[][] = [];\n\n // Convert all points to flat 2D coordinate Array\n coordEach(geojson, (coord) => {\n points.push([coord[0], coord[1]]);\n });\n if (!points.length) {\n return null;\n }\n\n const convexHull = concaveman(points, options.concavity);\n\n // Convex hull should have at least 3 different vertices in order to create a valid polygon\n if (convexHull.length > 3) {\n return polygon([convexHull]);\n }\n return null;\n}\n\nexport { convex };\nexport default convex;\n"]}
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -8,7 +8,7 @@ import { AllGeoJSON } from '@turf/helpers';
|
|
|
8
8
|
* the [convex-hull](https://github.com/mikolalysenko/convex-hull) module that implements a
|
|
9
9
|
* [monotone chain hull](http://en.wikibooks.org/wiki/Algorithm_Implementation/Geometry/Convex_hull/Monotone_chain).
|
|
10
10
|
*
|
|
11
|
-
* @
|
|
11
|
+
* @function
|
|
12
12
|
* @param {GeoJSON} geojson input Feature or FeatureCollection
|
|
13
13
|
* @param {Object} [options={}] Optional parameters
|
|
14
14
|
* @param {number} [options.concavity=Infinity] 1 - thin shape. Infinity - convex hull.
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { AllGeoJSON } from '@turf/helpers';
|
|
|
8
8
|
* the [convex-hull](https://github.com/mikolalysenko/convex-hull) module that implements a
|
|
9
9
|
* [monotone chain hull](http://en.wikibooks.org/wiki/Algorithm_Implementation/Geometry/Convex_hull/Monotone_chain).
|
|
10
10
|
*
|
|
11
|
-
* @
|
|
11
|
+
* @function
|
|
12
12
|
* @param {GeoJSON} geojson input Feature or FeatureCollection
|
|
13
13
|
* @param {Object} [options={}] Optional parameters
|
|
14
14
|
* @param {number} [options.concavity=Infinity] 1 - thin shape. Infinity - convex hull.
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts"],"sourcesContent":["import { Feature, GeoJsonProperties, Polygon } from \"geojson\";\nimport { AllGeoJSON, polygon } from \"@turf/helpers\";\nimport { coordEach } from \"@turf/meta\";\nimport concaveman from \"concaveman\";\n\n/**\n * Takes a {@link Feature} or a {@link FeatureCollection} and returns a convex hull {@link Polygon}.\n *\n * Internally this uses\n * the [convex-hull](https://github.com/mikolalysenko/convex-hull) module that implements a\n * [monotone chain hull](http://en.wikibooks.org/wiki/Algorithm_Implementation/Geometry/Convex_hull/Monotone_chain).\n *\n * @
|
|
1
|
+
{"version":3,"sources":["../../index.ts"],"sourcesContent":["import { Feature, GeoJsonProperties, Polygon } from \"geojson\";\nimport { AllGeoJSON, polygon } from \"@turf/helpers\";\nimport { coordEach } from \"@turf/meta\";\nimport concaveman from \"concaveman\";\n\n/**\n * Takes a {@link Feature} or a {@link FeatureCollection} and returns a convex hull {@link Polygon}.\n *\n * Internally this uses\n * the [convex-hull](https://github.com/mikolalysenko/convex-hull) module that implements a\n * [monotone chain hull](http://en.wikibooks.org/wiki/Algorithm_Implementation/Geometry/Convex_hull/Monotone_chain).\n *\n * @function\n * @param {GeoJSON} geojson input Feature or FeatureCollection\n * @param {Object} [options={}] Optional parameters\n * @param {number} [options.concavity=Infinity] 1 - thin shape. Infinity - convex hull.\n * @param {Object} [options.properties={}] Translate Properties to Feature\n * @returns {Feature<Polygon>} a convex hull\n * @example\n * var points = turf.featureCollection([\n * turf.point([10.195312, 43.755225]),\n * turf.point([10.404052, 43.8424511]),\n * turf.point([10.579833, 43.659924]),\n * turf.point([10.360107, 43.516688]),\n * turf.point([10.14038, 43.588348]),\n * turf.point([10.195312, 43.755225])\n * ]);\n *\n * var hull = turf.convex(points);\n *\n * //addToMap\n * var addToMap = [points, hull]\n */\nfunction convex<P extends GeoJsonProperties = GeoJsonProperties>(\n geojson: AllGeoJSON,\n options: {\n concavity?: number;\n properties?: P;\n } = {}\n): Feature<Polygon, P> | null {\n // Default parameters\n options.concavity = options.concavity || Infinity;\n\n // Container\n const points: number[][] = [];\n\n // Convert all points to flat 2D coordinate Array\n coordEach(geojson, (coord) => {\n points.push([coord[0], coord[1]]);\n });\n if (!points.length) {\n return null;\n }\n\n const convexHull = concaveman(points, options.concavity);\n\n // Convex hull should have at least 3 different vertices in order to create a valid polygon\n if (convexHull.length > 3) {\n return polygon([convexHull]);\n }\n return null;\n}\n\nexport { convex };\nexport default convex;\n"],"mappings":";AACA,SAAqB,eAAe;AACpC,SAAS,iBAAiB;AAC1B,OAAO,gBAAgB;AA8BvB,SAAS,OACP,SACA,UAGI,CAAC,GACuB;AAE5B,UAAQ,YAAY,QAAQ,aAAa;AAGzC,QAAM,SAAqB,CAAC;AAG5B,YAAU,SAAS,CAAC,UAAU;AAC5B,WAAO,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;AAAA,EAClC,CAAC;AACD,MAAI,CAAC,OAAO,QAAQ;AAClB,WAAO;AAAA,EACT;AAEA,QAAM,aAAa,WAAW,QAAQ,QAAQ,SAAS;AAGvD,MAAI,WAAW,SAAS,GAAG;AACzB,WAAO,QAAQ,CAAC,UAAU,CAAC;AAAA,EAC7B;AACA,SAAO;AACT;AAGA,IAAO,sBAAQ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turf/convex",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0",
|
|
4
4
|
"description": "turf convex module",
|
|
5
5
|
"author": "Turf Authors",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,23 +51,23 @@
|
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@types/benchmark": "^2.1.5",
|
|
53
53
|
"@types/concaveman": "^1.1.6",
|
|
54
|
-
"@types/tape": "^4.
|
|
54
|
+
"@types/tape": "^4.13.4",
|
|
55
55
|
"benchmark": "^2.1.4",
|
|
56
56
|
"glob": "^10.3.10",
|
|
57
57
|
"load-json-file": "^7.0.1",
|
|
58
58
|
"npm-run-all": "^4.1.5",
|
|
59
|
-
"tape": "^5.
|
|
60
|
-
"tsup": "^8.
|
|
61
|
-
"tsx": "^4.
|
|
62
|
-
"typescript": "^5.
|
|
59
|
+
"tape": "^5.9.0",
|
|
60
|
+
"tsup": "^8.3.5",
|
|
61
|
+
"tsx": "^4.19.2",
|
|
62
|
+
"typescript": "^5.5.4",
|
|
63
63
|
"write-json-file": "^5.0.0"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@turf/helpers": "^7.
|
|
67
|
-
"@turf/meta": "^7.
|
|
66
|
+
"@turf/helpers": "^7.2.0",
|
|
67
|
+
"@turf/meta": "^7.2.0",
|
|
68
68
|
"@types/geojson": "^7946.0.10",
|
|
69
69
|
"concaveman": "^1.2.1",
|
|
70
|
-
"tslib": "^2.
|
|
70
|
+
"tslib": "^2.8.1"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "7b0f0374c4668cd569f8904c71e2ae7d941be867"
|
|
73
73
|
}
|