A geolevel
object is created from a given geographic layer. The attributes
of the layer to be included in the level can be indicated; if no attribute is
indicated, all are considered. The attributes that make up the key must be
indicated.
Arguments
- name
A string, level name.
- layer
A
tibble
orsf
object.- attributes
A string vector, selected attributes.
- key
A string vector, attributes that compose the key.
- snake_case
A boolean, transform all names to snake_case.
Details
A level can have two associated geometries (point or polygon). The geometry is obtained from the layer data.
We can also define a level from a tibble
, which does not have any associated
geometry. The geometry will be obtained from the relationships between levels
that we define or from layers related to this data.
The name of the level is used later to reference it and relate it to other levels.
See also
Other geolevel definition functions:
add_geometry()
,
check_key()
,
complete_point_geometry()
,
coordinates_to_geometry()
,
get_empty_geometry_instances()
,
get_geometry()
Examples
layer_us_state <- get_level_layer(gd_us, "state")
state <-
geolevel(name = "state",
layer = layer_us_state,
key = "statefp",
snake_case = TRUE)