randomLineString
描述
🌐 Description
返回一个随机的 LineString。
🌐 Returns a random LineString.
参数
🌐 Parameters
| 名称 | 类型 | 描述 |
|---|---|---|
| count? | 数字 | 将生成多少几何体 (默认 1) |
| options? | 对象 | 可选参数 (默认 {}) |
| options.bbox? | BBox | 放置几何图形的边界框。(默认 [-180,-90,180,90]) |
| options.num_vertices? | 数字 | 每条 LineString 将包含多少坐标。(默认 10) |
| options.max_length? | 数字 | 顶点与其前一个顶点之间的最大十进制度数 (默认 0.0001) |
| options.max_rotation? | 数字 | 是线段相对于前一段可以转动的最大弧度数。 (默认 Math.PI/8) |
返回
🌐 Returns
FeatureCollection<LineString> GeoJSON 线串要素集合
示例
🌐 Examples
var lineStrings = turf.randomLineString(25, { bbox: [-180, -90, 180, 90] });
// => lineStrings
安装
🌐 Installation
$ npm install @turf/random
import { randomLineString } from "@turf/random";
const result = randomLineString(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.randomLineString(...);