Skip to main content
Version: 7.3.0

randomPoint

描述

🌐 Description

返回一个随机的

🌐 Returns a random point.

参数

🌐 Parameters

名称类型描述
count?number将生成多少几何体 (默认 1)
options?Object可选参数 (默认 {})
options.bbox?BBox一个边界框,几何图形被放置在其中。(默认 [-180,-90,180,90])

返回

🌐 Returns

FeatureCollection<Point> 点的 GeoJSON 特性集合

示例

🌐 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(...);