@turf/combine
Advanced tools
Comparing version 6.5.0 to 7.0.0-alpha.0
@@ -1,2 +0,2 @@ | ||
import { feature, featureCollection, } from "@turf/helpers"; | ||
import { feature, featureCollection } from "@turf/helpers"; | ||
import { featureEach } from "@turf/meta"; | ||
@@ -36,6 +36,5 @@ /** | ||
}; | ||
featureEach(fc, function (feature) { | ||
var _a, _b, _c; | ||
var _d; | ||
switch ((_d = feature.geometry) === null || _d === void 0 ? void 0 : _d.type) { | ||
featureEach(fc, (feature) => { | ||
var _a; | ||
switch ((_a = feature.geometry) === null || _a === void 0 ? void 0 : _a.type) { | ||
case "Point": | ||
@@ -46,3 +45,3 @@ groups.MultiPoint.coordinates.push(feature.geometry.coordinates); | ||
case "MultiPoint": | ||
(_a = groups.MultiPoint.coordinates).push.apply(_a, feature.geometry.coordinates); | ||
groups.MultiPoint.coordinates.push(...feature.geometry.coordinates); | ||
groups.MultiPoint.properties.push(feature.properties); | ||
@@ -55,3 +54,3 @@ break; | ||
case "MultiLineString": | ||
(_b = groups.MultiLineString.coordinates).push.apply(_b, feature.geometry.coordinates); | ||
groups.MultiLineString.coordinates.push(...feature.geometry.coordinates); | ||
groups.MultiLineString.properties.push(feature.properties); | ||
@@ -64,3 +63,3 @@ break; | ||
case "MultiPolygon": | ||
(_c = groups.MultiPolygon.coordinates).push.apply(_c, feature.geometry.coordinates); | ||
groups.MultiPolygon.coordinates.push(...feature.geometry.coordinates); | ||
groups.MultiPolygon.properties.push(feature.properties); | ||
@@ -67,0 +66,0 @@ break; |
@@ -1,3 +0,2 @@ | ||
import { MultiLineString, MultiPoint, MultiPolygon, Properties } from "@turf/helpers"; | ||
import { Point, LineString, Polygon, FeatureCollection } from "@turf/helpers"; | ||
import { GeoJsonProperties, FeatureCollection, LineString, MultiLineString, MultiPoint, MultiPolygon, Point, Polygon } from "geojson"; | ||
/** | ||
@@ -21,8 +20,5 @@ * Combines a {@link FeatureCollection} of {@link Point}, {@link LineString}, or {@link Polygon} features | ||
*/ | ||
declare function combine(fc: FeatureCollection<Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon>): FeatureCollection<{ | ||
type: "MultiPoint" | "MultiLineString" | "MultiPolygon"; | ||
coordinates: number[][] | number[][][] | number[][][][]; | ||
}, { | ||
collectedProperties: Properties[]; | ||
declare function combine(fc: FeatureCollection<Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon>): FeatureCollection<MultiPoint | MultiLineString | MultiPolygon, { | ||
collectedProperties: GeoJsonProperties[]; | ||
}>; | ||
export default combine; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var helpers_1 = require("@turf/helpers"); | ||
var meta_1 = require("@turf/meta"); | ||
const helpers_1 = require("@turf/helpers"); | ||
const meta_1 = require("@turf/meta"); | ||
/** | ||
@@ -38,6 +38,5 @@ * Combines a {@link FeatureCollection} of {@link Point}, {@link LineString}, or {@link Polygon} features | ||
}; | ||
meta_1.featureEach(fc, function (feature) { | ||
var _a, _b, _c; | ||
var _d; | ||
switch ((_d = feature.geometry) === null || _d === void 0 ? void 0 : _d.type) { | ||
meta_1.featureEach(fc, (feature) => { | ||
var _a; | ||
switch ((_a = feature.geometry) === null || _a === void 0 ? void 0 : _a.type) { | ||
case "Point": | ||
@@ -48,3 +47,3 @@ groups.MultiPoint.coordinates.push(feature.geometry.coordinates); | ||
case "MultiPoint": | ||
(_a = groups.MultiPoint.coordinates).push.apply(_a, feature.geometry.coordinates); | ||
groups.MultiPoint.coordinates.push(...feature.geometry.coordinates); | ||
groups.MultiPoint.properties.push(feature.properties); | ||
@@ -57,3 +56,3 @@ break; | ||
case "MultiLineString": | ||
(_b = groups.MultiLineString.coordinates).push.apply(_b, feature.geometry.coordinates); | ||
groups.MultiLineString.coordinates.push(...feature.geometry.coordinates); | ||
groups.MultiLineString.properties.push(feature.properties); | ||
@@ -66,3 +65,3 @@ break; | ||
case "MultiPolygon": | ||
(_c = groups.MultiPolygon.coordinates).push.apply(_c, feature.geometry.coordinates); | ||
groups.MultiPolygon.coordinates.push(...feature.geometry.coordinates); | ||
groups.MultiPolygon.properties.push(feature.properties); | ||
@@ -69,0 +68,0 @@ break; |
{ | ||
"name": "@turf/combine", | ||
"version": "6.5.0", | ||
"version": "7.0.0-alpha.0", | ||
"description": "turf combine module", | ||
@@ -59,6 +59,7 @@ "author": "Turf Authors", | ||
"dependencies": { | ||
"@turf/helpers": "^6.5.0", | ||
"@turf/meta": "^6.5.0" | ||
"@turf/helpers": "^7.0.0-alpha.0", | ||
"@turf/meta": "^7.0.0-alpha.0", | ||
"tslib": "^2.3.0" | ||
}, | ||
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e" | ||
"gitHead": "0edc4c491b999e5ace770a61e1cf549f7c004189" | ||
} |
@@ -10,7 +10,7 @@ # @turf/combine | ||
**Parameters** | ||
### Parameters | ||
- `fc` **[FeatureCollection][8]<([Point][9] \| [LineString][10] \| [Polygon][11])>** a FeatureCollection of any type | ||
* `fc` **[FeatureCollection][8]<([Point][9] | [LineString][10] | [Polygon][11])>** a FeatureCollection of any type | ||
**Examples** | ||
### Examples | ||
@@ -29,3 +29,3 @@ ```javascript | ||
Returns **[FeatureCollection][8]<([MultiPoint][12] \| [MultiLineString][13] \| [MultiPolygon][14])>** a FeatureCollection of corresponding type to input | ||
Returns **[FeatureCollection][8]<([MultiPoint][12] | [MultiLineString][13] | [MultiPolygon][14])>** a FeatureCollection of corresponding type to input | ||
@@ -32,0 +32,0 @@ [1]: https://tools.ietf.org/html/rfc7946#section-3.3 |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
11989
3
181
1
+ Addedtslib@^2.3.0
+ Added@turf/helpers@7.1.0(transitive)
+ Added@turf/meta@7.1.0(transitive)
+ Added@types/geojson@7946.0.15(transitive)
+ Addedtslib@2.8.1(transitive)
- Removed@turf/helpers@6.5.0(transitive)
- Removed@turf/meta@6.5.0(transitive)
Updated@turf/helpers@^7.0.0-alpha.0
Updated@turf/meta@^7.0.0-alpha.0