Description Usage Arguments Value Examples
Gets geoportal boundary data using either:
a bounding box of coordinates in the form c(xmin,ymin,xmax,ymax) within which to get shapes
using a point in the form x,y and a radius distance from that point in meters
using an sf polygon within which to get all intersecting boundaries
using the exact name of the boundary area
using a partial name of the bounding area
1 2 3 4 5 6 7 8 9 10 11 12 |
boundary_type |
category of boundary to fetch. Options are: "administrative", "census", "electoral", "eurostat", "health", "other", or "postcodes". |
boundary_name |
boundary name. If not specified, will return a list of available boundary names for the chosen boundary type. |
bbox |
if specified will only return results within the specified bounding box. Bounding box should either be in the format 'xmin,ymin,xmax,ymax', or be an object of class 'bbox' as generated by sf::st_bbox(). |
radius |
radius in meters. If specified, will only return results within a given radius of the point. Point must be specified for radius to take effect. |
point |
a longitude,latitude string in the form 'lng,lat'. Point and radius must be specified together to return boundaries within given radius to the point. |
names_like |
a vector of names that we want the name column to partially match. |
names_equal |
a vector of names that we want the name column to exactly match. |
custom_polygon |
a custom sf polygon. The function will return all boundaries that intersect the custom polygon. |
a data.frame of the full player data and history.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # get available boundary names for the type 'census'
census_options <- get_boundary('census')
# get all MSOA boundaries where the msoa name contains 'Dartford' or 'Gravesham':
msoa_boundaries_like <- get_boundary('census','Middle_Super_Output_Areas_December_2011_Boundaries',
names_like=c('Dartford','Gravesham'))
# get all local authority boundaries where the name is either 'Tower Hamlets' or 'Southwark'
la_boundaries_exact <- get_boundary('admin','Local_Authority_Districts_April_2019_Boundaries_UK_BGC',
names_equal=c('Tower Hamlets','Southwark'))
# get all wards within a specified bounding box
la_bbox <- sf::st_bbox(la_boundaries_exact)
ward_boundaries_bbox <- get_boundary('administrative','Wards_May_2019_Boundaries_UK_BGC', bbox=la_bbox)
# get all LSOA boundaries within a 1km radius of a given point
point <- '-0.1577,51.507'
lsoa_boundaries_radius <- get_boundary('census','Lower_Super_Output_Areas_December_2011_Boundaries',
point=point, radius=1000)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.