Get the name(s) of a spatial object.

getNames(x, ...)

# S4 method for ANY
getNames(x)

# S4 method for geom
getNames(x)

# S4 method for sf
getNames(x)

# S4 method for Spatial
getNames(x)

# S4 method for Raster
getNames(x)

# S4 method for SpatRaster
getNames(x)

Arguments

x

the object from which to get the name.

...

other arguments.

Value

A vector of the names of x.

See also

Examples


getNames(gtGeoms$line)
#> [1] "line_geom"
getNames(gtGeoms$grid$categorical)
#> [1] "categorical_grid_geom"

gc_sf(gtGeoms$line) %>%
  getNames()
#> [1] "geom"

gc_raster(gtGeoms$grid$categorical) %>%
  getNames()
#> [1] "layer"

gc_terra(gtGeoms$grid$categorical) %>%
  getNames()
#> [1] "cover"