ga_is_ccw() is TRUE for counter-clockwise geometries and ga_is_cw() is
TRUE for clockwise ones. Each function tests a polygon on its exterior
ring.
Details
Each function returns NA rather than FALSE for any geometry with no
winding order, such as a point or a null geometry, so the two functions are
not simply negations of one another.
See also
Other winding:
ga_orient(),
ga_reverse(),
ga_winding_order()
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_is_ccw(g))
#> [1] FALSE
as.vector(ga_is_cw(ga_orient(g, "reversed")))
#> [1] TRUE