
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 = 10,
max_radial_length = 10,
max_length = 1e-04,
max_rotation = pi/8
)
Type of features desired: 'position', 'points', 'polygons', or 'lines'
(integer) Number of features to generate.
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.
(numeric) the number of vertices added to
polygon features. default: 10
(numeric) The total number of decimal
degrees longitude or latitude that a polygon can extent outwards to
from its center. default: 10
(numeric) maximum number of decimal degrees that a
vertex can be from its predecessor. default: 0.0001
(numeric) maximum number of radians that a line
segment can turn from the previous segment. default: pi/8
Other data functions:
lawn_featurecollection()
,
lawn_feature()
,
lawn_filter()
,
lawn_geometrycollection()
,
lawn_linestring()
,
lawn_multilinestring()
,
lawn_multipoint()
,
lawn_multipolygon()
,
lawn_point()
,
lawn_polygon()
,
lawn_remove()
,
lawn_sample()
# NOT RUN {
## a position
lawn_random("position")
## set of points
lawn_random(n = 2)
lawn_random(n = 10)
## set of polygons
lawn_random('polygons', 2)
lawn_random('polygons', 10)
## set of lines
lawn_random('lines', 2)
lawn_random('lines', 10)
# with options
lawn_random(bbox = c(-70, 40, -60, 60))
lawn_random(num_vertices = 5)
# }
Run the code above in your browser using DataLab