Skip to main content
Version: Next

randomPoint

Description

Returns a random point.

Parameters

NameTypeDescription
count?numberhow many geometries will be generated (default 1)
options?ObjectOptional parameters (default {})
options.bbox?Array<number>a bounding box inside of which geometries are placed. (default [-180,-90,180,90])

Returns

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