st_round: Rounding of geometry coordinates

View source: R/utils.R

st_roundR Documentation

Rounding of geometry coordinates

Description

Rounding of geometry coordinates

Usage

st_round(x, digits = 0)

Arguments

x

An object of class sf or sfc.

digits

Integer indicating the number of decimal places to be used.

Value

An object of class sf or sfc with rounded coordinates.

See Also

round

Examples

library(sf, quietly = TRUE)

p1 = st_sfc(st_point(c(1.123, 1.123)))
p2 = st_sfc(st_point(c(0.789, 0.789)))
p3 = st_sfc(st_point(c(1.123, 0.789)))

st_round(st_as_sf(c(p1, p2, p2, p3, p1)), digits = 1)


luukvdmeer/sfnetworks documentation built on Nov. 21, 2024, 4:54 a.m.