Rotates each geometry counter-clockwise by degrees about its own centroid.
The geometry type of the output matches the geometry type of the input.
See also
Other affine:
ga_affine_transform(),
ga_rotate_around_center(),
ga_scale_xy(),
ga_skew(),
ga_skew_xy(),
ga_translate()
Examples
# a right triangle, whose centroid is not its bounding box center
tri <- geoarrow::as_geoarrow_array(sf::st_sfc(
sf::st_polygon(list(rbind(c(0, 0), c(4, 0), c(0, 3), c(0, 0))))
))
geoarrow::as_geoarrow_vctr(ga_rotate_around_centroid(tri, 90))
#> <geoarrow_vctr geoarrow.polygon{list}[1]>
#> [1] <POLYGON ((2.3333333 -0.3333333, 2.3333333 3.6666667, -0.6666667 -0.333>