Skip to contents

Return an sf object with a buffer based on dist or a proportion of the diagonal distance defined by diag_ratio. If x uses geographic coordinates, the coordinate reference system is transformed into EPSG:3857 and then transformed back into the original CRS after the buffer has been applied.

Usage

st_buffer_ext(
  x,
  dist = NULL,
  diag_ratio = NULL,
  unit = "meter",
  dist_limits = NULL,
  single_side = FALSE,
  ...
)

st_edge(x, dist = NULL, diag_ratio = NULL, unit = "meter", ...)

Arguments

x

sf or bbox object.

dist

buffer distance in units. Optional.

diag_ratio

ratio of diagonal distance of area's bounding box used as buffer distance. e.g. if the diagonal distance is 3000 meters and the "diag_ratio = 0.1" a 300 meter will be used. Ignored when dist is provided.

unit

Units for buffer. Supported options include "meter", "foot", "kilometer", and "mile", "nautical mile" Common abbreviations (e.g. "km" instead of "kilometer") are also supported. Distance in units is converted to units matching GDAL units for x; defaults to "meter"

dist_limits

Numeric vector of any length (minimum and maximum values used as lower and upper limits on distance buffer). Units must match the provided units; defaults to NULL.

single_side

If TRUE, single-sided buffers are returned for linear geometries, in which case negative dist values give buffers on the right-hand side, positive on the left.

...

additional parameters passed to sf::st_buffer()

Details

st_edge is a variation on st_buffer_ext where dist or diag_ratio is used to define the width of the edge to return either outside the existing geometry (for positive dist values) or inside the existing geometry (for negative dist values).