Skip to contents

Internal function to construct plot area around coordinates

Usage

construct_buffer(
  coords,
  shape,
  size,
  return_vec = TRUE,
  crs = "",
  verbose = TRUE
)

Arguments

coords

SpatVector, sf object or 2-column matrix with coordinates of sample points

shape

String specifying plot shape. Either "circle" or "square"

size

Size of sample plot. Equals the radius for circles or the side-length for squares in map units

return_vec

If TRUE, vector objects are returned.

crs

The coordinate reference system used for vector objects.

verbose

Print warning messages.

Value

matrix or SpatVector object

Examples

coords <- matrix(c(10, 5, 25, 15, 5, 25), ncol = 2, byrow = TRUE)
construct_buffer(coords = coords, shape = "square", size = 5)
#>  class       : SpatVector 
#>  geometry    : polygons 
#>  dimensions  : 3, 0  (geometries, attributes)
#>  extent      : 0, 30, 0, 30  (xmin, xmax, ymin, ymax)
#>  coord. ref. :