What is the class or spatial attributes of this feature?
Usage
is_sf(x, ext = FALSE, allow_null = FALSE, allow_list = FALSE)
is_sfg(x, allow_null = FALSE)
is_sfc(x, allow_null = FALSE)
is_bbox(x, allow_null = FALSE, allow_na = FALSE)
is_raster(x, allow_null = FALSE)
is_sp(x, allow_null = FALSE)
is_geo_coords(x, allow_null = FALSE)Arguments
- x
An
sf,sfc, orbboxobject.- ext
If
TRUE, check if x is asf,sfc, orbboxclass object or not; defaults toFALSE. (used by is_sf)- allow_null
If
TRUEand x isNULL, returnTRUE; defaults toFALSE.- allow_list
If
TRUE, is_sf will return TRUE if x is a list of sf objects.- allow_na
If
TRUE,is_bbox()ignores anyNAvalues. Defaults toFALSE.
Details
is_sf: is x a
sfclass object?is_sfc: is x is a
sfcclass object?is_bbox: is x is a
bboxclass object?is_sf_list: is x is a list of
sfclass objects (with or without names)?is_raster: is x a
Rasterclass object?is_sp: is x a
Spatialclass object of any type?is_geo_coords: is x likely a geodetic coordinate pair (a length 2 numeric vector, with a max absolute value less than or equal to 180)?
Examples
nc <- sf::read_sf(system.file("shape/nc.shp", package = "sf"))
is_sf(nc)
#> [1] TRUE
is_sfc(nc$geometry)
#> [1] TRUE
is_sf_list(list(nc[1, ], nc[2, ]))
#> [1] TRUE
is_bbox(sf::st_bbox(nc))
#> [1] TRUE
is_wgs84(sf::st_transform(nc, 4326))
#> [1] TRUE
is_same_crs(nc, 4267)
#> [1] TRUE
