randomPosition
Description
Returns a random position within a bounding box.
Parameters
Name | Type | Description |
---|---|---|
bbox? | BBox | a bounding box inside of which positions are placed. (default [-180,-90,180,90]) |
Returns
Position Position [longitude, latitude]
Examples
var position = turf.randomPosition([-180, -90, 180, 90]);
// => position
Installation
$ npm install @turf/random
import { randomPosition } from "@turf/random";
const result = randomPosition(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.randomPosition(...);