diff --git a/R/geom-transformers.R b/R/geom-transformers.R index fa92c1f0b..0149fffbd 100644 --- a/R/geom-transformers.R +++ b/R/geom-transformers.R @@ -6,9 +6,13 @@ #' Geometric unary operations on simple feature geometries. These are all generics, with methods for \code{sfg}, \code{sfc} and \code{sf} objects, returning an object of the same class. All operations work on a per-feature basis, ignoring all other features. #' @name geos_unary #' @param x object of class \code{sfg}, \code{sfc} or \code{sf} -#' @param dist numeric; buffer distance for all, or for each of the elements in \code{x}; in case -#' \code{dist} is a \code{units} object, it should be convertible to \code{arc_degree} if -#' \code{x} has geographic coordinates, and to \code{st_crs(x)$units} otherwise +#' @param dist numeric or object of class `units`; buffer distance for all, or for each of the elements in \code{x}. +#' In case \code{x} has geodetic coordinates (lon/lat) and `sf_use_s2()` is `TRUE`, a numeric +#' `dist` is taken as distance in meters and a `units` object in `dist` is converted to meters. +#' In case \code{x} has geodetic coordinates (lon/lat) and `sf_use_s2()` is `FALSE`, a numeric +#' `dist` is taken as degrees, and a `units` object in `dist` is converted to `arc_degree` (and warnings are issued). +#' In case \code{x} does not have geodetic coordinates (projected) then +#' numeric `dist` is assumed to have the units of the coordinates, and a `units` `dist` is converted to those if `st_crs(x)` is not `NA`. #' @param nQuadSegs integer; number of segments per quadrant (fourth of a circle), for all or per-feature; see details #' @param endCapStyle character; style of line ends, one of 'ROUND', 'FLAT', 'SQUARE'; see details #' @param joinStyle character; style of line joins, one of 'ROUND', 'MITRE', 'BEVEL'; see details diff --git a/man/geos_unary.Rd b/man/geos_unary.Rd index 99cb9c42f..2d9da346e 100644 --- a/man/geos_unary.Rd +++ b/man/geos_unary.Rd @@ -67,9 +67,13 @@ st_segmentize(x, dfMaxLength, ...) \arguments{ \item{x}{object of class \code{sfg}, \code{sfc} or \code{sf}} -\item{dist}{numeric; buffer distance for all, or for each of the elements in \code{x}; in case -\code{dist} is a \code{units} object, it should be convertible to \code{arc_degree} if -\code{x} has geographic coordinates, and to \code{st_crs(x)$units} otherwise} +\item{dist}{numeric or object of class \code{units}; buffer distance for all, or for each of the elements in \code{x}. +In case \code{x} has geodetic coordinates (lon/lat) and \code{sf_use_s2()} is \code{TRUE}, a numeric +\code{dist} is taken as distance in meters and a \code{units} object in \code{dist} is converted to meters. +In case \code{x} has geodetic coordinates (lon/lat) and \code{sf_use_s2()} is \code{FALSE}, a numeric +\code{dist} is taken as degrees, and a \code{units} object in \code{dist} is converted to \code{arc_degree} (and warnings are issued). +In case \code{x} does not have geodetic coordinates (projected) then +numeric \code{dist} is assumed to have the units of the coordinates, and a \code{units} \code{dist} is converted to those if \code{st_crs(x)} is not \code{NA}.} \item{nQuadSegs}{integer; number of segments per quadrant (fourth of a circle), for all or per-feature; see details}