View source: R/geo_translate.R
geo_translate | R Documentation |
Translate geometric objects by adding a constant in x and y dimension.
geo_translate(obj, x = NULL, y = NULL, fid = NULL, update = TRUE)
obj |
gridded(1) |
x |
numeric(1) |
y |
numeric(1) |
fid |
integerish(.) |
update |
logical(1) |
geom
of the mathematically translated obj
.
Other geometry tools:
geo_filter()
,
geo_locate()
,
geo_pull()
,
geo_reflect()
,
geo_rotate()
,
geo_scale()
,
geo_skew()
,
geo_stretch()
# translate several features
geo_vis(gtGeoms$polygon, linewidth = 3)
newPoly <- geo_translate(obj = gtGeoms$polygon, x = 5, y = c(-10, 5),
update = FALSE)
geo_vis(geom = newPoly, linecol = "green", new = FALSE)
# translate a single feature
geo_vis(gtGeoms$polygon, linewidth = 3)
newPoly <- geo_translate(obj = gtGeoms$polygon, x = 5, fid = 2,
update = FALSE)
geo_vis(geom = newPoly, linecol = "green", new = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.