geo_polygon: Random GeoJSON polygon

View source: R/geo_polygon.R

geo_polygonR Documentation

Random GeoJSON polygon

Description

Random GeoJSON polygon

Usage

geo_polygon(count = 1, num_vertices = 10, max_radial_length = 10, bbox = NULL)

Arguments

count

(integer/numeric) number of Polygons. Default: 1

num_vertices

(integer/numeric) how many coordinates each polygon will contain. Default: 10

max_radial_length

(integer/numeric) maximum distance that a vertex can reach out of the center of the polygon. Units are in degrees latitude (Approximately 69 miles or 111 km). Default: 10

bbox

(integer/numeric) lat/long bounding box for the centers of the polygons, numeric vector of the form west (long), south (lat), east (long), north (lat). optional

Value

GeoJSON; a list with one ore more Polygons in a FeatureCollection, with class geo_list - simple unclass() to remove the class

Examples

geo_polygon()
geo_polygon(10)
geo_polygon(bbox = c(50, 50, 60, 60))

ropensci/randgeo documentation built on Sept. 12, 2022, 2:01 p.m.