g_buffer: Compute buffer of a WKB/WKT geometry

View source: R/geom.R

g_bufferR Documentation

Compute buffer of a WKB/WKT geometry

Description

g_buffer() builds a new geometry containing the buffer region around the geometry on which it is invoked. The buffer is a polygon containing the region within the buffer distance of the original geometry. Wrapper of OGR_G_Buffer()in the GDAL API (GEOS via GDAL headers).

Usage

g_buffer(
  geom,
  dist,
  quad_segs = 30L,
  as_wkb = TRUE,
  as_iso = FALSE,
  byte_order = "LSB",
  quiet = FALSE
)

Arguments

geom

Either a raw vector of WKB or list of raw vectors, or a character vector containing one or more WKT strings.

dist

Numeric buffer distance in units of the input geom.

quad_segs

Integer number of segments used to define a 90 degree curve (quadrant of a circle). Large values result in large numbers of vertices in the resulting buffer geometry while small numbers reduce the accuracy of the result.

as_wkb

Logical value, TRUE to return the output geometry in WKB format (the default), or FALSE to return as WKT.

as_iso

Logical value, TRUE to export as ISO WKB/WKT (ISO 13249 SQL/MM Part 3), or FALSE (the default) to export as "Extended WKB/WKT".

byte_order

Character string specifying the byte order when output is WKB. One of "LSB" (the default) or "MSB" (uncommon).

quiet

Logical value, TRUE to suppress warnings. Defaults to FALSE.

Value

A polygon as WKB raw vector or WKT string, or a list/character vector of polygons as WKB/WKT with length equal to the number of input geometries. NA is returned with a warning if WKB input cannot be converted into an OGR geometry object, or if an error occurs in the call to the underlying OGR API.

Examples

g_buffer("POINT (0 0)", dist = 10, as_wkb = FALSE)

gdalraster documentation built on June 8, 2025, 12:37 p.m.