get_spatype: check the "spatial type" of an object or file

Description Usage Arguments Value Note Author(s)

Description

accessory function to check if an object passed to the function corresponds to a *Spatial Object, a sf object, a R raster object, a file corresponding to a vector, or a file corresponding to a raster. NOTE: to check only for vector or raster types, the associated functions get_vectype and get_rastype can be used, with the same syntax.

Usage

1
get_spatype(in_object, abort = TRUE)

Arguments

in_object

either a R object or a character string pointing to a vector or raster layer

abort

logical if TRUE the function aborts if object is not recognized as an R spatial file or valid vector or raster file; if FALSE, a warning is shown and NA is returned.

Value

character ("spobject" | "sfobject" | "rastobject | " vectfile" | rastfile), or NA if the input does not belong to any spatial category and abort == FALSE

Note

Functions get_spatype, get_rastype and get_vectype come from package sprawl.

Author(s)

Lorenzo Busetto, phD (2017) lbusett@gmail.com

Luigi Ranghetti, phD (2017) ranghetti.l@irea.cnr.it


pobsteta/theia2r documentation built on May 25, 2019, 2:21 p.m.