lineStrings
描述
¥Description
Creates a LineString FeatureCollection from an Array of LineString coordinates.
参数
¥Parameters
名称 | 类型 | 描述 |
---|---|---|
coordinates | UNCERTAIN | |
properties? | GeoJsonProperties | an Object of key-value pairs to add as properties (default ) |
options? | 对象 | 可选参数(默认 ) |
options.bbox? | BBox | Bounding Box Array [west, south, east, north] associated with the FeatureCollection |
options.id? | ID | Identifier associated with the FeatureCollection |
返回
¥Returns
FeatureCollection<LineString, GeoJsonProperties> 线串要素集合
¥FeatureCollection<LineString, GeoJsonProperties> 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(...);