lineStrings
Description
Creates a LineString FeatureCollection from an Array of LineString coordinates.
Parameters
Name | Type | Description |
---|---|---|
coordinates | Array<Array<Array<number>>> | an array of LinearRings |
properties? | Object | an Object of key-value pairs to add as properties (default {}) |
options? | Object | Optional Parameters (default {}) |
options.bbox? | Array<number> | Bounding Box Array [west, south, east, north] associated with the FeatureCollection |
options.id? | string | number | Identifier associated with the FeatureCollection |
Returns
FeatureCollection<LineString> LineString FeatureCollection
Examples
var linestrings = turf.lineStrings([
[
[-24, 63],
[-23, 60],
[-25, 65],
[-20, 69],
],
[
[-14, 43],
[-13, 40],
[-15, 45],
[-10, 49],
],
]);
//=linestrings
Installation
$ npm install @turf/helpers
import { lineStrings } from "@turf/helpers";
const result = lineStrings(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.lineStrings(...);