Skip to content

KBE3D / KBCore / turf / randomPoint

函数: randomPoint()

randomPoint(count?: number, options?: { bbox?: BBox; }): FeatureCollection<Point, any>

Function

Returns a random point.

参数

count?

number

how many geometries will be generated

options?

Optional parameters

bbox?

BBox

a bounding box inside of which geometries are placed.

返回

FeatureCollection<Point, any>

GeoJSON FeatureCollection of points

抛出

if bbox is invalid

示例

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

KBE3D @3.0.0 Copyright © 2024-present KBE3D