Skip to contents

Return a polygon from (WGS84) coordinates

Usage

polygon_from_coords(coords, dfMaxLength = units::set_units(1, "km"))

Arguments

coords

coordinates defining a polygon

dfMaxLength

maximum length of a line segment. If x has geographical coordinates (long/lat), dfMaxLength is either a numeric expressed in meter, or an object of class units with length units rad or degree; segmentation in the long/lat case takes place along the great circle, using st_geod_segmentize.

Value

an sf polygon

Examples

if (FALSE) {
coords <- list(rbind(c(0, 0), c(1, 0), c(1, 1), c(0.5, 1.5), c(0, 1), c(0, 0)))
polygon_from_coords(coords)
}