turf-random

WebJar for turf-random

License

License

ISC
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

turf-random
Last Version

Last Version

3.0.12
Release Date

Release Date

Type

Type

jar
Description

Description

turf-random
WebJar for turf-random
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/turf-junkyard/turf-random

Download turf-random

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/turf-random/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>turf-random</artifactId>
    <version>3.0.12</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/turf-random/
implementation 'org.webjars.npm:turf-random:3.0.12'
// https://jarcasting.com/artifacts/org.webjars.npm/turf-random/
implementation ("org.webjars.npm:turf-random:3.0.12")
'org.webjars.npm:turf-random:jar:3.0.12'
<dependency org="org.webjars.npm" name="turf-random" rev="3.0.12">
  <artifact name="turf-random" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='turf-random', version='3.0.12')
)
libraryDependencies += "org.webjars.npm" % "turf-random" % "3.0.12"
[org.webjars.npm/turf-random "3.0.12"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : geojson-random jar [0.2.2,0.3)

Project Modules

There are no modules declared in this project.

turf-random

build status

generate random features

turf.random([type='point'], [count=1], options, options.bbox, [options.num_vertices=10], [options.max_radial_length=10])

Generates random GeoJSON data, including Point|Points and Polygon|Polygons, for testing and experimentation.

Parameters

parameter type description
[type='point'] String optional: type of features desired: 'points' or 'polygons'
[count=1] Number optional: how many geometries should be generated.
options Object options relevant to the feature desired. Can include:
options.bbox Array.<number> a bounding box inside of which geometries are placed. In the case of Point features, they are guaranteed to be within this bounds,
while Polygon features have their centroid within the bounds.
[options.num_vertices=10] Number optional: options.vertices the number of vertices added to polygon features.
[options.max_radial_length=10] Number optional: the total number of decimal degrees longitude or latitude that a polygon can extent outwards to
from its center.

Example

var points = turf.random('points', 100, {
  bbox: [-70, 40, -60, 60]
});

//=points

var polygons = turf.random('polygons', 4, {
  bbox: [-70, 40, -60, 60]
});

//=polygons

Returns FeatureCollection, generated random features

Installation

Requires nodejs.

$ npm install turf-random

Tests

$ npm test
org.webjars.npm

deprecated turf modules: do not use or reference, for redirects only

turf is now a monorepo: all turf modules are in Turfjs/turf

Versions

Version
3.0.12