Returns 0 for points, 1 for lines and curves, and 2 for surfaces.
Details
ga_dimension() returns NA for an empty geometry, which has no dimension,
rather than a point's 0. ga_boundary_dimension() gives the dimension of
the geometry's boundary instead, so it returns 1 for a polygon and NA for
a point.
Examples
g <- geoarrow::as_geoarrow_array(sf::st_sfc(
sf::st_point(c(0, 0)),
sf::st_linestring(cbind(c(0, 1), c(0, 1)))
))
as.vector(ga_dimension(g))
#> [1] 0 1