Returns "clockwise" or "counterclockwise" for each geometry. A polygon
reports the winding of its exterior ring.
Details
A multipolygon reports a winding only when every part's exterior ring
agrees, and a multilinestring only when every part agrees; a geometry whose
parts disagree is NA, since it has no single winding. Any other geometry
type, a null geometry, or a ring with fewer than three distinct points is
also NA.
See also
Other winding:
ga_is_ccw(),
ga_orient()
Examples
ring <- matrix(c(0, 0, 0, 1, 1, 1, 1, 0, 0, 0), ncol = 2, byrow = TRUE)
g <- geoarrow::as_geoarrow_array(sf::st_sfc(sf::st_polygon(list(ring))))
as.vector(ga_winding_order(g))
#> [1] "clockwise"