gc_geom: Transform a spatial object to class 'geom'

Description Usage Arguments Details Value See Also Examples

Description

Transform a spatial object to class geom

Usage

1
2
3
4
5
6
7
8
## S4 method for signature 'Spatial'
gc_geom(input = NULL, ...)

## S4 method for signature 'sf'
gc_geom(input = NULL, group = FALSE, ...)

## S4 method for signature 'Raster'
gc_geom(input = NULL, stack = FALSE, group = FALSE, as_hex = FALSE, ...)

Arguments

input

the object to transform to class geom.

...

additional arguments.

group

[logical(1)]
should the values of a Raster* or the attributes of MULTI* features be grouped, i.e., should the unique values be assigned into the groups table (TRUE)? The default behaviour for Raster* would be not to assign values into the group attribute table if no RAT is available and for MULTI* features it would be to keep the attributes as duplicated per-feature attributes (FALSE)?

stack

[logical(1)]
should the layers of gridded objects be stacked, i.e., should several layers be stored as columns in the attribute table of features of one geom (TRUE, default), or should they be stored in (a list of) several geoms separately (FALSE)?

as_hex

[logical(1)]
should the bands 'red', 'green' and 'blue' of a gridded object be transformed to hexadecimal values (TRUE), or should they be retained as columns in a stacked grid geom (FALSE, default)?.

Details

When transforming a simple feature to a geom, all MULTI* features are organised on a per feature basis, where the attribute table of features in the geom contains those variables that are valid for each feature, while the attribute table of groups contains those variables, that are unique only at the level of groups of features (i.e., at the level of MULTI* simple features). Those variables that are valid at the level of groups would be duplicated in the attribute table of features. When a MULTI* feature is transformed to a geom, the default behaviour is to copy the simple feature as closely as possible. However, to reduce the object size (and improve its' organisation), it is possible to assign the attributes of groups into the attribute table of groups of the geom by setting group = TRUE.

When transforming a Raster* (or possibly other gridded classes) with several layers to a geom, the layers are by default organised into a list with a layer per list item. However, when several layers contain fundamentally the same data (i.e., values that are associated to the same groups), layers could be stacked stack = TRUE, because they share the same group attribute table.

Value

an object of class geom

See Also

Other spatial classes: gc_raster(), gc_sf(), gc_sp()

Examples

1
2
3
gc_geom(input = gtSF$polygon)

gc_geom(input = gtRasters$categorical)

geometr documentation built on March 30, 2021, 5:13 p.m.