georandom | R Documentation |
Return a FeatureCollection with N number of features with random coordinates
gr_point(n = 10, bbox = NULL) gr_position(bbox = NULL) gr_polygon(n = 1, vertices = 10, max_radial_length = 10, bbox = NULL)
n |
(integer) Number of features to create. Default: 10 (points), 1 (polygons) |
bbox |
(numeric) A bounding box of length 4, of the form west, south, east, north order. By default, no bounding box is passed in. |
vertices |
(integer) Number coordinates each Polygon will contain. Default: 10 |
max_radial_length |
(integer) Maximum number of decimal degrees latitude or longitude that a vertex can reach out of the center of the Polygon. Default: 10 |
These functions create either random points, polygons, or positions (single long/lat coordinate pairs).
A data-FeatureCollection for point and polygon, or numeric vector for position.
lawn_random
# Random points gr_point(5) gr_point(10) gr_point(1000) ## with bounding box gr_point(5, c(50, 50, 60, 60)) # Random positions gr_position() ## with bounding box gr_position(c(0, 0, 10, 10)) # Random polygons ## number of polygons, default is 1 polygon gr_polygon() gr_polygon(5) ## number of vertices, 3 vs. 100 gr_polygon(1, 3) gr_polygon(1, 100) ## max radial length, compare the following three gr_polygon(1, 10, 5) gr_polygon(1, 10, 30) gr_polygon(1, 10, 100) ## use a bounding box gr_polygon(1, 5, 5, c(50, 50, 60, 60))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.