Skip to content

描述 ​

返回随机 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(...);