Skip to contents

If you have a tibble such as those produced by create_lookup_table() - that is, there is a column of geographical ONS codes ending in 'cd' - simply use this table as the basis for retrieving the relevant boundaries.

Usage

add_bounds_to_table(
  tbl,
  resolution = c("BGC", "BSC", "BUC", "BFC", "BFE"),
  centroids = FALSE,
  crs = NULL
)

Arguments

tbl

A tibble with a column for geographical codes. This function will use the lefthand-most column ending in 'cd' as the basis for retrieving boundary or point data

resolution

character. See argument options for available options. How generalised should the boundary be, and whether coastal boundaries should adhere to the coastline or to the full territorial extent. BGC by default (G = Generalised (20m), C = limited to the coastline.) F indicates Full resolution; S indicates Super-generalised (200m); U indicates Ultra- generalised (500m) boundary resolution. Use E instead of C for full extent boundaries (e.g. BFE). Not all combinations are available.

centroids

Whether to retrieve centroids or boundaries (the default)

crs

the Coordinate Reference System (CRS) code to use. 4326 by default.

Value

If successful, will return the initial table with an additional geometry column added. Duplicate rows will be removed.