描述
返回随机 point。
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| count? | number | 将生成多少个几何体 (默认 1) |
| options? | Object | 可选参数 (默认 {}) |
| options.bbox? | BBox | 几何体放置在其内的边界框。 (默认 [-180,-90,180,90]) |
返回值
FeatureCollection<Point> GeoJSON FeatureCollection 点
示例
javascript
var points = turf.randomPoint(25, { bbox: [-180, -90, 180, 90] });
// => points安装
javascript
$ npm install @turf/random
import { randomPoint } from "@turf/random";
const result = randomPoint(...);javascript
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.randomPoint(...);