Reverse a cycle's winding direction
Details
Flips the traversal direction of a cycle without changing coordinates. Useful for converting between winding conventions.
Examples
x <- wk::as_wkb("POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0))")
pool <- establish_topology(x)
merged <- merge_coincident(pool)
cycles <- find_cycles(merged)
reverse_cycle(cycles[[1]])
#> [1] 4 3 2 1