This function returns one of 'vector' or 'raster' depending on the input class.
Note
Although stars
object is a little ambiguous
whether to classify vector or raster,
it will be considered raster in this package.
See also
Other Helper functions:
any_class_args()
,
clip_ras_ext()
,
clip_vec_ext()
,
crs_check()
,
dep_check()
,
dep_switch()
,
ext2poly()
,
get_clip_ext()
,
is_bbox_within_reference()
,
is_within_ref()
,
par_def_q()
,
reproject_b2r()
,
reproject_std()
,
vect_valid_repair()
Examples
library(sf)
library(terra)
options(sf_use_s2 = FALSE)
nc_path <- system.file("gpkg/nc.gpkg", package = "sf")
nc_sf <- sf::st_read(nc_path)
#> Reading layer `nc.gpkg' from data source
#> `/home/runner/work/_temp/Library/sf/gpkg/nc.gpkg' using driver `GPKG'
#> Simple feature collection with 100 features and 14 fields
#> Geometry type: MULTIPOLYGON
#> Dimension: XY
#> Bounding box: xmin: -84.32385 ymin: 33.88199 xmax: -75.45698 ymax: 36.58965
#> Geodetic CRS: NAD27
datamod(nc_sf)
#> [1] "vector"
ra_path <- system.file("ex/elev.tif", package = "terra")
ra <- terra::rast(ra_path)
datamod(ra)
#> [1] "raster"