ga_is_ccw() is TRUE for counter-clockwise geometries and ga_is_cw() is
TRUE for clockwise ones. A polygon is tested on its exterior ring.
Details
Any geometry with no winding order, such as a point or a null geometry,
becomes NA rather than FALSE, so the two functions are not simply
negations of one another.
See also
Other winding:
ga_orient(),
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