Description Usage Arguments Value See Also Examples
Rotate geometric objects by a certain angle about center coordinates
1 |
obj |
[ |
x |
[ |
y |
[ |
angle |
[ |
fid |
[ |
update |
[ |
geom
of the rotated obj
.
Other geometry tools:
gt_filter()
,
gt_locate()
,
gt_pull()
,
gt_reflect()
,
gt_scale()
,
gt_skew()
,
gt_stretch()
,
gt_translate()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # rotate all geoms
visualise(gtGeoms$polygon, linewidth = 3)
newPoly <- gt_rotate(obj = gtGeoms$polygon, x = 0, y = 0, angle = 135,
update = FALSE)
visualise(geom = newPoly, linecol = "green", new = FALSE)
# rotate a single geom
visualise(gtGeoms$polygon, linewidth = 3)
newPoly <- gt_rotate(obj = gtGeoms$polygon, x = -10, y = 0, angle = -180,
update = FALSE, fid = 2)
visualise(geom = newPoly, linecol = "green", new = FALSE)
# rotate different geoms about different centers by different angles
visualise(gtGeoms$polygon, linewidth = 3)
newPoly <- gt_rotate(obj = gtGeoms$polygon,
x = c(0, -10),
y = c(-10, 0),
angle = c(75, -135),
update = FALSE)
visualise(geom = newPoly, linecol = "green", new = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.