Scales each geometry by x_factor along the x axis and y_factor along the
y axis, about the geometry's own centroid. The geometry type of the output
matches the geometry type of the input.
Examples
sq <- geoarrow::as_geoarrow_array(sf::st_sfc(
sf::st_polygon(list(rbind(c(0, 0), c(2, 0), c(2, 2), c(0, 2), c(0, 0))))
))
# twice as wide, same height, so the area doubles
geoarrow::as_geoarrow_vctr(ga_scale_xy(sq, 2, 1))
#> <geoarrow_vctr geoarrow.polygon{list}[1]>
#> [1] <POLYGON ((-1 0, 3 0, 3 2, -1 2, -1 0))>
as.vector(ga_unsigned_area(ga_scale_xy(sq, 2, 1)))
#> [1] 8