Commit 1ed4aab2 authored by Ben Anderson's avatar Ben Anderson
Browse files

added LSOA boundary file

parent d399ab36
PROJCS["British_National_Grid",GEOGCS["GCS_OSGB_1936",DATUM["D_OSGB_1936",SPHEROID["Airy_1830",6377563.396,299.3249646]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",400000.0],PARAMETER["False_Northing",-100000.0],PARAMETER["Central_Meridian",-2.0],PARAMETER["Scale_Factor",0.9996012717],PARAMETER["Latitude_Of_Origin",49.0],UNIT["Meter",1.0]]
\ No newline at end of file
......@@ -68,3 +68,53 @@ table(msoa_solent$LAD11NM)
# save it out for re-use
outf <- path.expand(paste0(here::here("data", "boundaries", "msoa_solent.shp")))
sf::write_sf(msoa_solent, outf)
# LSOA boundaries for the Solent region ----
# use the generalised boundaries (smaller file)
# manually downloaded for now
# load all LSOAs from file
inFile <- path.expand("~//Dropbox/data/UK_census2011/Lower_Layer_Super_Output_Areas_(December_2011)_Boundaries_Generalised_Clipped_(BGC)_EW_V3-shp/Lower_Layer_Super_Output_Areas_(December_2011)_Boundaries_Generalised_Clipped_(BGC)_EW_V3.shp") # local version
lsoa_all_sf <- sf::read_sf(inFile)
# load the look up table so we can filter
lutFile <- here::here("data", "Output_Area_to_Lower_Layer_Super_Output_Area_to_Middle_Layer_Super_Output_Area_to_Local_Authority_District_(December_2011)_Lookup_in_England_and_Wales.csv")
oa_lut <- data.table::fread(lutFile)
# las_to_load <- c("Southampton","Portsmouth","Winchester",
# "Eastleigh","Isle of Wight","Fareham",
# "Gosport","Test Valley","East Hampshire",
# "Havant","New Forest","Hart","Basingstoke and Deane")
# select the OAs we want via LAs
oa_solentLut <- oa_lut[LAD11NM == "Southampton" |
LAD11NM == "Portsmouth" |
LAD11NM == "Winchester" |
LAD11NM == "Eastleigh" |
LAD11NM == "Isle of Wight" |
LAD11NM == "Fareham" |
LAD11NM == "Gosport" |
LAD11NM == "Test Valley" |
LAD11NM == "East Hampshire" |
LAD11NM == "Havant" |
LAD11NM == "New Forest" |
LAD11NM == "Hart" |
LAD11NM == "Basingstoke and Deane"]
# collapse the OA level file to an LSOA level file
lsoa_solentLut <- oa_solentLut[, .(nLSOAs = .N),
keyby = .(LSOA11CD, MSOA11CD, MSOA11NM , LAD11CD, LAD11NM )]
lsoa_solentLut[, .(nOAs = .N), keyby = .(LAD11NM)]
# merge the MSOA level file with the MSOA level shape file
lsoa_solent <- merge(lsoa_all_sf, lsoa_solentLut)
# check
table(lsoa_solent$LAD11NM)
# save it out for re-use
outf <- paste0(here::here("data", "boundaries", "lsoa_solent.shp"))
sf::write_sf(lsoa_solent, outf)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment