Returns how many vertices each geometry holds.
Details
Counts every coordinate that ga_coords() would return, so a closed ring
counts its repeated final vertex. A null geometry gives NA.
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