st_translate: Translate a simple feature

View source: R/geometry.R

st_translateR Documentation

Translate a simple feature

Description

Translate a simple feature

Usage

st_translate(x, d = c(0, 0))

Arguments

x

sf object

d

numeric, values to translate by in order of [x, y]

Value

a translated version of the input x

See Also

https://r-spatial.github.io/sf/articles/sf3.html#affine-transformations-1

Examples

## Not run: 
  v <- volcano_multi(what = 'bands')
  x <-  volcano_polygon()
  x2 <- st_translate(x, c(-250, 120))
  plot(v[,,,1], reset = FALSE, axes = TRUE)
  plot(sf::st_geometry(x), add = TRUE, border = "purple", col = NA, lwd = 3)
  plot(sf::st_geometry(x2), add = TRUE, border = "orange", col = NA, lwd = 3)

## End(Not run)

BigelowLab/twinkle documentation built on Jan. 26, 2025, 6:34 a.m.