rpolygon | R Documentation |
Generates a single, random polygon.
rpolygon(crs = 3395, origin = c(0, 0), area = 1e+05,
composite = 64, square = FALSE)
crs |
An integer EPSG code specifying the coordinate reference system of the polygon to be generated. Default: 3395 (World Mercator, https://epsg.io/3395) |
origin |
Numeric. The approximate origin coordinates of the polygon to be generated (x,y). |
area |
Integer. The approximate area of the polygon to be generated,
in map units (see |
composite |
Integer. Higher values take longer, but generate more complex polygons with more sides. See details. Default: 64. |
square |
Logical. If |
rpolygon()
generates a random tessellation using mosaic()
and returns a
random polygon sampled for it. If composite
> 1, several contiguious tiles
are dissolved, creating more complex polygons with more sides. The polygon
may contain holes.
An sf
object containing a single polygon.
# Simple polygon
polygon <- rpolygon()
plot(polygon)
# More complex polygon
polygon <- rpolygon(composite = 8)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.