Returns 0 for points, 1 for lines and curves, and 2 for surfaces.
Details
An empty geometry has no dimension and gives NA, which is distinct from a
point's 0. ga_boundary_dimension() gives the dimension of the geometry's
boundary instead, so a polygon is 1 and a point is NA.
See also
Other topology:
ga_contains(),
ga_coordinate_position(),
ga_filter(),
ga_is_empty(),
ga_join(),
ga_relate(),
ga_sparse_intersects(),
ga_sparse_pairs()
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