Skip to contents

Queries ONS' Geoportal endpoints and retrieves the requested geographical boundaries in the form of a sf object.

Usage

boundaries_get(boundary, year = NULL, detail_level = "BUC")

Arguments

boundary

a string containing the acronym of name of the boundary to be downloaded. Accepted values are: CAUTH, CED, CTRY, CTY, CTYUA, LAD, LPA, LSOA, MCTY, MSOA, OA, PAR, PARNCP, RGN, UTLA, WD

year

a number containing the year when the boundary was created.

detail_level

a string defining the level of detail in the geometry. (this affects the download size). Accepted values are: BFC, BFE, BGC, BUC. Each value corresponds to:

  • Full Extent (BFE) – Full resolution boundaries go to the Extent of the Realm (Low Water Mark) and are the most detailed of the boundaries.

  • Full Clipped (BFC) – Full resolution boundaries that are clipped to the coastline (Mean High Water mark).

  • Generalised Clipped (BGC) - Generalised to 20m and clipped to the coastline (Mean High Water mark) and more generalised than the BFE boundaries.

  • Super Generalised Clipped (BSC) (200m) – Generalised to 200m and clipped to the coastline (Mean High Water mark).

  • Ultra Generalised Clipped (BUC) (500m) – Generalised to 500m and clipped to the coastline (Mean High Water mark).

  • Grid, Extent (BGE) - Grid formed of equally sized cells which extend beyond the coastline.

  • Generalised, Grid (BGG) - Generalised 50m grid squares.

For a detailed description of how these boundaries were created refer to Digital boundaries

Value

a sf object with the selected boundaries.

Examples

CA_2023_BGC <- boundaries_get("CAUTH", 2023, "BGC")
#>  Querying ONS API
#>  Querying ONS API [8ms]
#> 
#> ⠙ Downloading the selected dataset from ONS services
#> Error in if (nchar(dsn) < 1) stop("`dsn` must point to a source, not an empty string.",     call. = FALSE): the condition has length > 1
#>  Downloading the selected dataset from ONS services [618ms]
#> 

class(CA_2023_BGC)
#> Error: object 'CA_2023_BGC' not found