randomPoint
Description
Returns a random point.
Parameters
Name | Type | Description |
---|---|---|
count? | number | how many geometries will be generated (default 1) |
options? | Object | Optional parameters (default {}) |
options.bbox? | Array<number> | a bounding box inside of which geometries are placed. (default [-180,-90,180,90]) |
Returns
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(...);