@turf/combine 7.1.0 → 7.3.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 +2 -2
- 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 +2 -2
- package/dist/esm/index.js.map +1 -1
- package/package.json +11 -11
package/dist/cjs/index.cjs
CHANGED
|
@@ -59,9 +59,9 @@ function combine(fc) {
|
|
|
59
59
|
})
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
|
-
var
|
|
62
|
+
var index_default = combine;
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
|
|
66
|
-
exports.combine = combine; exports.default =
|
|
66
|
+
exports.combine = combine; exports.default = index_default;
|
|
67
67
|
//# sourceMappingURL=index.cjs.map
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts"],"names":["feature"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-combine/dist/cjs/index.cjs","../../index.ts"],"names":["feature"],"mappings":"AAAA;ACUA,wCAA2C;AAC3C,kCAA4B;AAoB5B,SAAS,OAAA,CACP,EAAA,EAGA;AACA,EAAA,IAAI,OAAA,EAAS;AAAA,IACX,UAAA,EAAY;AAAA,MACV,WAAA,EAAa,CAAC,CAAA;AAAA,MACd,UAAA,EAAY,CAAC;AAAA,IACf,CAAA;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,WAAA,EAAa,CAAC,CAAA;AAAA,MACd,UAAA,EAAY,CAAC;AAAA,IACf,CAAA;AAAA,IACA,YAAA,EAAc;AAAA,MACZ,WAAA,EAAa,CAAC,CAAA;AAAA,MACd,UAAA,EAAY,CAAC;AAAA,IACf;AAAA,EACF,CAAA;AAEA,EAAA,+BAAA,EAAY,EAAI,CAACA,QAAAA,EAAAA,GAAY;A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A,MAAA,CAAO,YAAA,CAAa,UAAA,CAAW,IAAA,CAAKA,QAAAA,CAAQ,UAAU,CAAA;AACtD,QAAA,KAAA;AAAA,MACF,KAAK,cAAA;AACH,QAAA,MAAA,CAAO,YAAA,CAAa,WAAA,CAAY,IAAA,CAAK,GAAGA,QAAAA,CAAQ,QAAA,CAAS,WAAW,CAAA;AACpE,QAAA,MAAA,CAAO,YAAA,CAAa,UAAA,CAAW,IAAA,CAAKA,QAAAA,CAAQ,UAAU,CAAA;AACtD,QAAA,KAAA;AAAA,MACF,OAAA;AACE,QAAA,KAAA;AAAA,IACJ;AAAA,EACF,CAAC,CAAA;AAED,EAAA,OAAO,wCAAA;AAAA,IACJ,MAAA,CAAO,IAAA,CAAK,MAAM,CAAA,CAChB,MAAA,CAAO,QAAA,CAAU,GAAA,EAAK;AACrB,MAAA,OAAO,MAAA,CAAO,GAAG,CAAA,CAAE,WAAA,CAAY,MAAA;AAAA,IACjC,CAAC,CAAA,CACA,IAAA,CAAK,CAAA,CACL,GAAA,CAAI,QAAA,CAAU,GAAA,EAAK;AAClB,MAAA,IAAI,SAAA,EAAW,EAAE,IAAA,EAAM,GAAA,EAAK,WAAA,EAAa,MAAA,CAAO,GAAG,CAAA,CAAE,YAAY,CAAA;AAIjE,MAAA,IAAI,WAAA,EAAa,EAAE,mBAAA,EAAqB,MAAA,CAAO,GAAG,CAAA,CAAE,WAAW,CAAA;AAC/D,MAAA,OAAO,8BAAA,QAAQ,EAAU,UAAU,CAAA;AAAA,IACrC,CAAC;AAAA,EACL,CAAA;AACF;AAGA,IAAO,cAAA,EAAQ,OAAA;ADxCf;AACE;AACA;AACF,2DAAC","file":"/home/runner/work/turf/turf/packages/turf-combine/dist/cjs/index.cjs","sourcesContent":[null,"import {\n GeoJsonProperties,\n FeatureCollection,\n LineString,\n MultiLineString,\n MultiPoint,\n MultiPolygon,\n Point,\n Polygon,\n} from \"geojson\";\nimport { feature, featureCollection } from \"@turf/helpers\";\nimport { featureEach } from \"@turf/meta\";\n\n/**\n * Combines a {@link FeatureCollection} of {@link Point}, {@link LineString}, or {@link Polygon} features\n * into {@link MultiPoint}, {@link MultiLineString}, or {@link MultiPolygon} features.\n *\n * @function\n * @param {FeatureCollection<Point|LineString|Polygon>} fc a FeatureCollection of any type\n * @returns {FeatureCollection<MultiPoint|MultiLineString|MultiPolygon>} a FeatureCollection of corresponding type to input\n * @example\n * var fc = turf.featureCollection([\n * turf.point([19.026432, 47.49134]),\n * turf.point([19.074497, 47.509548])\n * ]);\n *\n * var combined = turf.combine(fc);\n *\n * //addToMap\n * var addToMap = [combined]\n */\nfunction combine(\n fc: FeatureCollection<\n Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon\n >\n) {\n var groups = {\n MultiPoint: {\n coordinates: [] as number[][],\n properties: [] as GeoJsonProperties[],\n },\n MultiLineString: {\n coordinates: [] as number[][][],\n properties: [] as GeoJsonProperties[],\n },\n MultiPolygon: {\n coordinates: [] as number[][][][],\n properties: [] as GeoJsonProperties[],\n },\n };\n\n featureEach(fc, (feature) => {\n switch (feature.geometry?.type) {\n case \"Point\":\n groups.MultiPoint.coordinates.push(feature.geometry.coordinates);\n groups.MultiPoint.properties.push(feature.properties);\n break;\n case \"MultiPoint\":\n groups.MultiPoint.coordinates.push(...feature.geometry.coordinates);\n groups.MultiPoint.properties.push(feature.properties);\n break;\n case \"LineString\":\n groups.MultiLineString.coordinates.push(feature.geometry.coordinates);\n groups.MultiLineString.properties.push(feature.properties);\n break;\n case \"MultiLineString\":\n groups.MultiLineString.coordinates.push(\n ...feature.geometry.coordinates\n );\n groups.MultiLineString.properties.push(feature.properties);\n break;\n case \"Polygon\":\n groups.MultiPolygon.coordinates.push(feature.geometry.coordinates);\n groups.MultiPolygon.properties.push(feature.properties);\n break;\n case \"MultiPolygon\":\n groups.MultiPolygon.coordinates.push(...feature.geometry.coordinates);\n groups.MultiPolygon.properties.push(feature.properties);\n break;\n default:\n break;\n }\n });\n\n return featureCollection(\n (Object.keys(groups) as (keyof typeof groups)[])\n .filter(function (key) {\n return groups[key].coordinates.length;\n })\n .sort()\n .map(function (key) {\n var geometry = { type: key, coordinates: groups[key].coordinates } as\n | MultiPoint\n | MultiLineString\n | MultiPolygon;\n var properties = { collectedProperties: groups[key].properties };\n return feature(geometry, properties);\n })\n );\n}\n\nexport { combine };\nexport default combine;\n"]}
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -4,7 +4,7 @@ import { FeatureCollection, Point, MultiPoint, LineString, MultiLineString, Poly
|
|
|
4
4
|
* Combines a {@link FeatureCollection} of {@link Point}, {@link LineString}, or {@link Polygon} features
|
|
5
5
|
* into {@link MultiPoint}, {@link MultiLineString}, or {@link MultiPolygon} features.
|
|
6
6
|
*
|
|
7
|
-
* @
|
|
7
|
+
* @function
|
|
8
8
|
* @param {FeatureCollection<Point|LineString|Polygon>} fc a FeatureCollection of any type
|
|
9
9
|
* @returns {FeatureCollection<MultiPoint|MultiLineString|MultiPolygon>} a FeatureCollection of corresponding type to input
|
|
10
10
|
* @example
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { FeatureCollection, Point, MultiPoint, LineString, MultiLineString, Poly
|
|
|
4
4
|
* Combines a {@link FeatureCollection} of {@link Point}, {@link LineString}, or {@link Polygon} features
|
|
5
5
|
* into {@link MultiPoint}, {@link MultiLineString}, or {@link MultiPolygon} features.
|
|
6
6
|
*
|
|
7
|
-
* @
|
|
7
|
+
* @function
|
|
8
8
|
* @param {FeatureCollection<Point|LineString|Polygon>} fc a FeatureCollection of any type
|
|
9
9
|
* @returns {FeatureCollection<MultiPoint|MultiLineString|MultiPolygon>} a FeatureCollection of corresponding type to input
|
|
10
10
|
* @example
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts"],"sourcesContent":["import {\n GeoJsonProperties,\n FeatureCollection,\n LineString,\n MultiLineString,\n MultiPoint,\n MultiPolygon,\n Point,\n Polygon,\n} from \"geojson\";\nimport { feature, featureCollection } from \"@turf/helpers\";\nimport { featureEach } from \"@turf/meta\";\n\n/**\n * Combines a {@link FeatureCollection} of {@link Point}, {@link LineString}, or {@link Polygon} features\n * into {@link MultiPoint}, {@link MultiLineString}, or {@link MultiPolygon} features.\n *\n * @
|
|
1
|
+
{"version":3,"sources":["../../index.ts"],"sourcesContent":["import {\n GeoJsonProperties,\n FeatureCollection,\n LineString,\n MultiLineString,\n MultiPoint,\n MultiPolygon,\n Point,\n Polygon,\n} from \"geojson\";\nimport { feature, featureCollection } from \"@turf/helpers\";\nimport { featureEach } from \"@turf/meta\";\n\n/**\n * Combines a {@link FeatureCollection} of {@link Point}, {@link LineString}, or {@link Polygon} features\n * into {@link MultiPoint}, {@link MultiLineString}, or {@link MultiPolygon} features.\n *\n * @function\n * @param {FeatureCollection<Point|LineString|Polygon>} fc a FeatureCollection of any type\n * @returns {FeatureCollection<MultiPoint|MultiLineString|MultiPolygon>} a FeatureCollection of corresponding type to input\n * @example\n * var fc = turf.featureCollection([\n * turf.point([19.026432, 47.49134]),\n * turf.point([19.074497, 47.509548])\n * ]);\n *\n * var combined = turf.combine(fc);\n *\n * //addToMap\n * var addToMap = [combined]\n */\nfunction combine(\n fc: FeatureCollection<\n Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon\n >\n) {\n var groups = {\n MultiPoint: {\n coordinates: [] as number[][],\n properties: [] as GeoJsonProperties[],\n },\n MultiLineString: {\n coordinates: [] as number[][][],\n properties: [] as GeoJsonProperties[],\n },\n MultiPolygon: {\n coordinates: [] as number[][][][],\n properties: [] as GeoJsonProperties[],\n },\n };\n\n featureEach(fc, (feature) => {\n switch (feature.geometry?.type) {\n case \"Point\":\n groups.MultiPoint.coordinates.push(feature.geometry.coordinates);\n groups.MultiPoint.properties.push(feature.properties);\n break;\n case \"MultiPoint\":\n groups.MultiPoint.coordinates.push(...feature.geometry.coordinates);\n groups.MultiPoint.properties.push(feature.properties);\n break;\n case \"LineString\":\n groups.MultiLineString.coordinates.push(feature.geometry.coordinates);\n groups.MultiLineString.properties.push(feature.properties);\n break;\n case \"MultiLineString\":\n groups.MultiLineString.coordinates.push(\n ...feature.geometry.coordinates\n );\n groups.MultiLineString.properties.push(feature.properties);\n break;\n case \"Polygon\":\n groups.MultiPolygon.coordinates.push(feature.geometry.coordinates);\n groups.MultiPolygon.properties.push(feature.properties);\n break;\n case \"MultiPolygon\":\n groups.MultiPolygon.coordinates.push(...feature.geometry.coordinates);\n groups.MultiPolygon.properties.push(feature.properties);\n break;\n default:\n break;\n }\n });\n\n return featureCollection(\n (Object.keys(groups) as (keyof typeof groups)[])\n .filter(function (key) {\n return groups[key].coordinates.length;\n })\n .sort()\n .map(function (key) {\n var geometry = { type: key, coordinates: groups[key].coordinates } as\n | MultiPoint\n | MultiLineString\n | MultiPolygon;\n var properties = { collectedProperties: groups[key].properties };\n return feature(geometry, properties);\n })\n );\n}\n\nexport { combine };\nexport default combine;\n"],"mappings":";AAUA,SAAS,SAAS,yBAAyB;AAC3C,SAAS,mBAAmB;AAoB5B,SAAS,QACP,IAGA;AACA,MAAI,SAAS;AAAA,IACX,YAAY;AAAA,MACV,aAAa,CAAC;AAAA,MACd,YAAY,CAAC;AAAA,IACf;AAAA,IACA,iBAAiB;AAAA,MACf,aAAa,CAAC;AAAA,MACd,YAAY,CAAC;AAAA,IACf;AAAA,IACA,cAAc;AAAA,MACZ,aAAa,CAAC;AAAA,MACd,YAAY,CAAC;AAAA,IACf;AAAA,EACF;AAEA,cAAY,IAAI,CAACA,aAAY;AAnD/B;AAoDI,aAAQ,KAAAA,SAAQ,aAAR,mBAAkB,MAAM;AAAA,MAC9B,KAAK;AACH,eAAO,WAAW,YAAY,KAAKA,SAAQ,SAAS,WAAW;AAC/D,eAAO,WAAW,WAAW,KAAKA,SAAQ,UAAU;AACpD;AAAA,MACF,KAAK;AACH,eAAO,WAAW,YAAY,KAAK,GAAGA,SAAQ,SAAS,WAAW;AAClE,eAAO,WAAW,WAAW,KAAKA,SAAQ,UAAU;AACpD;AAAA,MACF,KAAK;AACH,eAAO,gBAAgB,YAAY,KAAKA,SAAQ,SAAS,WAAW;AACpE,eAAO,gBAAgB,WAAW,KAAKA,SAAQ,UAAU;AACzD;AAAA,MACF,KAAK;AACH,eAAO,gBAAgB,YAAY;AAAA,UACjC,GAAGA,SAAQ,SAAS;AAAA,QACtB;AACA,eAAO,gBAAgB,WAAW,KAAKA,SAAQ,UAAU;AACzD;AAAA,MACF,KAAK;AACH,eAAO,aAAa,YAAY,KAAKA,SAAQ,SAAS,WAAW;AACjE,eAAO,aAAa,WAAW,KAAKA,SAAQ,UAAU;AACtD;AAAA,MACF,KAAK;AACH,eAAO,aAAa,YAAY,KAAK,GAAGA,SAAQ,SAAS,WAAW;AACpE,eAAO,aAAa,WAAW,KAAKA,SAAQ,UAAU;AACtD;AAAA,MACF;AACE;AAAA,IACJ;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACJ,OAAO,KAAK,MAAM,EAChB,OAAO,SAAU,KAAK;AACrB,aAAO,OAAO,GAAG,EAAE,YAAY;AAAA,IACjC,CAAC,EACA,KAAK,EACL,IAAI,SAAU,KAAK;AAClB,UAAI,WAAW,EAAE,MAAM,KAAK,aAAa,OAAO,GAAG,EAAE,YAAY;AAIjE,UAAI,aAAa,EAAE,qBAAqB,OAAO,GAAG,EAAE,WAAW;AAC/D,aAAO,QAAQ,UAAU,UAAU;AAAA,IACrC,CAAC;AAAA,EACL;AACF;AAGA,IAAO,gBAAQ;","names":["feature"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turf/combine",
|
|
3
|
-
"version": "7.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "7.3.0",
|
|
4
|
+
"description": "Combines a FeatureCollection of Point, LineString, or Polygon features into MultiPoint, MultiLineString, or MultiPolygon features.",
|
|
5
5
|
"author": "Turf Authors",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bugs": {
|
|
@@ -53,19 +53,19 @@
|
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/benchmark": "^2.1.5",
|
|
56
|
-
"@types/tape": "^
|
|
56
|
+
"@types/tape": "^5.8.1",
|
|
57
57
|
"benchmark": "^2.1.4",
|
|
58
58
|
"npm-run-all": "^4.1.5",
|
|
59
|
-
"tape": "^5.
|
|
60
|
-
"tsup": "^8.0
|
|
61
|
-
"tsx": "^4.
|
|
62
|
-
"typescript": "^5.
|
|
59
|
+
"tape": "^5.9.0",
|
|
60
|
+
"tsup": "^8.4.0",
|
|
61
|
+
"tsx": "^4.19.4",
|
|
62
|
+
"typescript": "^5.8.3"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@turf/helpers": "
|
|
66
|
-
"@turf/meta": "
|
|
65
|
+
"@turf/helpers": "7.3.0",
|
|
66
|
+
"@turf/meta": "7.3.0",
|
|
67
67
|
"@types/geojson": "^7946.0.10",
|
|
68
|
-
"tslib": "^2.
|
|
68
|
+
"tslib": "^2.8.1"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "9f58a103e8f9a587ab640307ed03ba5233913ddd"
|
|
71
71
|
}
|