Skip to contents

Return clipping extent with buffer radius. It assumes the input CRS is projected and linear unit is meters.

Usage

get_clip_ext(pnts, radius, extrusion = 1.1)

Arguments

pnts

One of sf or SpatVector object. Target points of computation.

radius

numeric(1). Buffer radius. It is assumed to be in meters

extrusion

numeric(1). The extent extrusion factor. Default is 1.1, meaning that the actual padding is 10 percent wider than radius.

Value

A terra::ext or sfc_POLYGON object of the computation extent.

See also

Other Helper functions: datamod(), dep_check(), dep_switch(), par_def_q(), reproject_std(), reproject_to_raster()

Author

Insang Song

Examples

if (FALSE) { # \dontrun{
library(sf)
library(terra)
options(sf_use_s2 = FALSE)

nc_path <- system.file("gpkg/nc.gpkg", package = "sf")
nc_sf <- sf::st_read(nc_path)
nc_sf <- sf::st_transform(nc_sf, "EPSG:5070")
get_clip_ext(nc_sf, 2.5e4)
nc_vect <- terra::vect(nc_sf)
get_clip_ext(nc_vect, 2.5e4)
} # }