28 lines
1.1 KiB
TypeScript
Executable File
28 lines
1.1 KiB
TypeScript
Executable File
import { MultiLineString, MultiPoint, MultiPolygon, Properties } from "@turf/helpers";
|
|
import { Point, LineString, Polygon, FeatureCollection } from "@turf/helpers";
|
|
/**
|
|
* Combines a {@link FeatureCollection} of {@link Point}, {@link LineString}, or {@link Polygon} features
|
|
* into {@link MultiPoint}, {@link MultiLineString}, or {@link MultiPolygon} features.
|
|
*
|
|
* @name combine
|
|
* @param {FeatureCollection<Point|LineString|Polygon>} fc a FeatureCollection of any type
|
|
* @returns {FeatureCollection<MultiPoint|MultiLineString|MultiPolygon>} a FeatureCollection of corresponding type to input
|
|
* @example
|
|
* var fc = turf.featureCollection([
|
|
* turf.point([19.026432, 47.49134]),
|
|
* turf.point([19.074497, 47.509548])
|
|
* ]);
|
|
*
|
|
* var combined = turf.combine(fc);
|
|
*
|
|
* //addToMap
|
|
* var addToMap = [combined]
|
|
*/
|
|
declare function combine(fc: FeatureCollection<Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon>): FeatureCollection<{
|
|
type: "MultiPoint" | "MultiLineString" | "MultiPolygon";
|
|
coordinates: number[][] | number[][][] | number[][][][];
|
|
}, {
|
|
collectedProperties: Properties[];
|
|
}>;
|
|
export default combine;
|