lineStrings
描述
🌐 Description
从一组 LineString 坐标创建一个 LineString FeatureCollection。
🌐 Creates a LineString FeatureCollection from an Array of LineString coordinates.
参数
🌐 Parameters
| 名称 | 类型 | 描述 |
|---|---|---|
| coordinates | 不确定 | |
| properties? | GeoJsonProperties | 一个键值对对象,用作要添加的属性 (默认 {}) |
| options? | Object | 可选参数 (默认 {}) |
| options.bbox? | BBox | 与 FeatureCollection 关联的边界框数组 [西, 南, 东, 北] |
| options.id? | Id | 与 FeatureCollection 关联的标识符 |
返回
🌐 Returns
FeatureCollection<LineString, GeoJsonProperties> 线串要素集合
示例
🌐 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(...);