Skip to contents

Generates a hierarchical categorisation of OSM keys, based on the type of information they convey. For a given dataframe, this function generates two extra columns called top_key and parent_key whose values will depend on the values from the this function.

Usage

categorise_keys(df)

Arguments

df

a dataframe with keys and values generated by extract_and_combine_tags()

Value

a new dataframe with the same columns and two extra ones called top_key and parent_key with values defined by this function.

Examples

df <- data.frame(
 key = c("wheelchair", "building:levels", "highway")
)
categorise_keys(df)
#>               key    parent_key   top_key
#> 1      wheelchair Accessibility       EDI
#> 2 building:levels          <NA> Buildings
#> 3         highway          <NA>   Streets