Generates random data-GeoJSON data, including data-Point's and data-Polygon's, for testing and experimentation

lawn_random(
  type = "points",
  n = 10,
  bbox = NULL,
  num_vertices = NULL,
  max_radial_length = NULL
)

Arguments

type

Type of features desired: 'points' or 'polygons'.

n

(integer) Number of features to generate.

bbox

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.

num_vertices

Number options.vertices the number of vertices added to polygon features.

max_radial_length

(Number) 10 The total number of decimal degrees longitude or latitude that a polygon can extent outwards to from its center.

Value

A data-FeatureCollection

See also

Examples

## set of points lawn_random(n = 2)
#> <FeatureCollection> #> Bounding box: -9.6 -46.5 144.0 16.6 #> No. features: 2 #> No. points: 4 #> Properties: NULL
lawn_random(n = 10)
#> <FeatureCollection> #> Bounding box: -158.4 -73.6 119.6 84.5 #> No. features: 10 #> No. points: 20 #> Properties: NULL
## set of polygons lawn_random('polygons', 2)
#> <FeatureCollection> #> Bounding box: 28.9 30.1 151.1 63.0 #> No. features: 2 #> No. points: 44 #> Properties: NULL
lawn_random('polygons', 10)
#> <FeatureCollection> #> Bounding box: -106.6 -94.2 165.8 97.1 #> No. features: 10 #> No. points: 220 #> Properties: NULL
# with options lawn_random(bbox = c(-70, 40, -60, 60))
#> <FeatureCollection> #> Bounding box: -69.1 42.3 -60.6 59.3 #> No. features: 10 #> No. points: 20 #> Properties: NULL
lawn_random(num_vertices = 5)
#> <FeatureCollection> #> Bounding box: -135.7 -89.3 68.7 28.3 #> No. features: 10 #> No. points: 20 #> Properties: NULL