Returns how many vertices each geometry holds.
Details
Counts every coordinate that ga_coords() would return, so it counts the
repeated final vertex of a closed ring. ga_n_coords() returns NA for a
null geometry.
See also
Other iteration:
ga_coords(),
ga_lines(),
ga_x()
Examples
ring <- matrix(c(0, 0, 2, 0, 2, 2, 0, 2, 0, 0), ncol = 2, byrow = TRUE)
g <- geoarrow::as_geoarrow_array(sf::st_sfc(sf::st_polygon(list(ring))))
as.vector(ga_n_coords(g))
#> [1] 5