get_level_layer {geodimension} | R Documentation |
Get level layer
Description
Get a geographic layer associated with a level. We can select the geometry and, using boolean parameters, which attributes are included in the layer's table: only the attributes that make up the key and, if applied to a geodimension, inherited attributes to which the prefix of the level where they are defined can be added.
Usage
get_level_layer(gd, level_name, geometry, only_key, inherited, add_prefix)
## S3 method for class 'geodimension'
get_level_layer(
gd,
level_name = NULL,
geometry = NULL,
only_key = FALSE,
inherited = FALSE,
add_prefix = TRUE
)
## S3 method for class 'geolevel'
get_level_layer(
gd,
level_name = NULL,
geometry = NULL,
only_key = FALSE,
inherited = FALSE,
add_prefix = TRUE
)
Arguments
gd |
A |
level_name |
A string. |
geometry |
A string. |
only_key |
A boolean. |
inherited |
A boolean. |
add_prefix |
A boolean. |
Value
A sf
object.
See Also
Other information gathering functions:
get_higher_level_names()
,
get_level_data_geo()
,
get_level_data()
,
get_level_geometries()
,
get_level_names()
Examples
layer_us_state <- get_level_layer(gd_us, "state")
state <-
geolevel(name = "state",
layer = layer_us_state,
key = "statefp")
state_ll <- state |>
get_level_layer("polygon")
county_ll <- gd_us |>
get_level_layer(level_name = "county",
geometry = "polygon",
inherited = TRUE)
[Package geodimension version 2.0.0 Index]