Rotates each geometry counter-clockwise by degrees about the center of its
own axis-aligned bounding rectangle. The geometry type of the output matches
the geometry type of the input.
See also
Other affine:
ga_affine_transform(),
ga_rotate_around_centroid(),
ga_scale_xy(),
ga_skew(),
ga_skew_xy(),
ga_translate()
Examples
# the same triangle, turned about its bounding box center instead
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_center(tri, 90))
#> <geoarrow_vctr geoarrow.polygon{list}[1]>
#> [1] <POLYGON ((3.5 -0.5, 3.5 3.5, 0.5 -0.5, 3.5 -0.5))>