Skip to main content
Version: Next

randomPoint

描述

¥Description

返回一个随机的 point

¥Returns a random point.

参数

¥Parameters

名称类型描述
count?numberhow many geometries will be generated (default 1)
options?对象可选参数(默认
options.bbox?BBoxa bounding box inside of which geometries are placed.(默认 [-180,-90,180,90])

返回

¥Returns

FeatureCollection<> GeoJSON FeatureCollection of points

¥FeatureCollection<Point> GeoJSON FeatureCollection of points

示例

¥Examples

var points = turf.randomPoint(25, { bbox: [-180, -90, 180, 90] });
// => points

安装

¥Installation

$ npm install @turf/random

import { randomPoint } from "@turf/random";
const result = randomPoint(...);
$ npm install @turf/turf

import * as turf from "@turf/turf";
const result = turf.randomPoint(...);