@@ -32,9 +32,9 @@ z_shape_private <- z_shape
3232
3333if (purpose == " commute" ) {
3434 c_shape <- spTransform(c_shape , proj_4326 )
35- l_shape <- readRDS(file.path(path_inputs , " 02_intermediate/02_travel_data" , purpose , geography , " lines_cs.Rds" ))
36- rf_shape <- readRDS(file.path(path_inputs , " 02_intermediate/02_travel_data" , purpose , geography , " rf_shape.Rds" ))
37- rq_shape <- readRDS(file.path(path_inputs , " 02_intermediate/02_travel_data" , purpose , geography , " rq_shape.Rds" ))
35+ l_shape <- readRDS(file.path(path_inputs , " 02_intermediate/02_travel_data" , purpose , geography , " lines_cs.Rds" ) , version = 2 )
36+ rf_shape <- readRDS(file.path(path_inputs , " 02_intermediate/02_travel_data" , purpose , geography , " rf_shape.Rds" ) , version = 2 )
37+ rq_shape <- readRDS(file.path(path_inputs , " 02_intermediate/02_travel_data" , purpose , geography , " rq_shape.Rds" ) , version = 2 )
3838}
3939if (purpose == " school" ) {
4040 d_shape <- readOGR(file.path(path_inputs ," 02_intermediate/01_geographies/urn_cents.geojson" ))
@@ -78,7 +78,7 @@ print(summary({sel_zone <- z_shape$geo_code %in% z_all_attributes$geo_code})) #
7878z_shape <- z_shape [sel_zone ,]
7979z_shape @ data <- data.frame (geo_code = z_shape $ geo_code )
8080z_shape @ data <- left_join(z_shape @ data , z_all_attributes , by = " geo_code" )
81- saveRDS(z_shape , file.path(path_outputs_national , purpose , geography , " z_all.Rds" ))
81+ saveRDS(z_shape , file.path(path_outputs_national , purpose , geography , " z_all.Rds" ) , version = 2 )
8282geojson_write(z_shape , file = file.path(path_outputs_national , purpose , geography , " z_all.geojson" ))
8383
8484if (purpose == " commute" ) {
@@ -96,7 +96,7 @@ if(purpose == "commute") {
9696 c_shape @ data <- data.frame (geo_code = c_shape $ geo_code )
9797 c_shape @ data <- left_join(c_shape @ data , c_all_attributes , by = " geo_code" )
9898 c_shape @ data <- c_shape @ data [c_codebook $ `Variable name` ]
99- saveRDS(c_shape , file.path(path_outputs_national , purpose , geography , " c_all.Rds" ))
99+ saveRDS(c_shape , file.path(path_outputs_national , purpose , geography , " c_all.Rds" ) , version = 2 )
100100 geojson_write(c_shape , file = (file.path(path_outputs_national , purpose , geography , " c_all.geojson" )))
101101
102102# MERGE LINE SCENARIO DATA TO BETWEEN-ZONE LINES FILE
@@ -108,15 +108,15 @@ if(purpose == "commute") {
108108 l_shape <- l_shape [sel_line2 ,]
109109 l_shape @ data <- data.frame (id = l_shape $ id )
110110 l_shape @ data <- left_join(l_shape @ data , od_all_attributes , by = " id" )
111- saveRDS(l_shape , (file.path(path_outputs_national , purpose , geography , " l_all.Rds" )))
111+ saveRDS(l_shape , (file.path(path_outputs_national , purpose , geography , " l_all.Rds" )) , version = 2 )
112112
113113# MERGE LINE SCENARIO DATA TO FAST ROUTES FILE
114114 print(" rf" )
115115 print(summary(({sel_rf <- (rf_shape $ id %in% od_all_attributes $ id )}))) # Limit to those with od_attributes (minflow_visualise)
116116 rf_shape <- rf_shape [sel_rf ,]
117117 rf_shape @ data <- data.frame (id = rf_shape $ id )
118118 rf_shape @ data <- left_join(rf_shape @ data , od_all_attributes , by = " id" )
119- saveRDS(rf_shape , (file.path(path_outputs_national , purpose , geography , " rf_all.Rds" )))
119+ saveRDS(rf_shape , (file.path(path_outputs_national , purpose , geography , " rf_all.Rds" )) , version = 2 )
120120
121121# MERGE LINE SCENARIO DATA TO QUIET ROUTES FILE
122122 print(" rq" )
@@ -125,7 +125,7 @@ if(purpose == "commute") {
125125 rq_shape @ data <- data.frame (id = rq_shape $ id )
126126 rq_shape @ data <- left_join(rq_shape @ data , od_all_attributes , by = " id" )
127127 rq_shape @ data <- rq_shape @ data [rq_codebook $ `Variable name` ]
128- saveRDS(rq_shape , (file.path(path_outputs_national , purpose , geography , " rq_all.Rds" )))
128+ saveRDS(rq_shape , (file.path(path_outputs_national , purpose , geography , " rq_all.Rds" )) , version = 2 )
129129}
130130
131131# MERGE DESTINATION DATA TO DESTINATIONS FILE
@@ -135,7 +135,7 @@ if(purpose == "school") {
135135 d_shape <- d_shape [sel_zone ,]
136136 d_shape @ data <- data.frame (urn = d_shape $ urn )
137137 d_shape @ data <- left_join(d_shape @ data , d_all_attributes , by = " urn" )
138- saveRDS(d_shape , file.path(path_outputs_national , purpose , geography , " d_all.Rds" ))
138+ saveRDS(d_shape , file.path(path_outputs_national , purpose , geography , " d_all.Rds" ) , version = 2 )
139139 geojson_write(d_shape , file = file.path(path_outputs_national , purpose , geography , " d_all.geojson" ))
140140}
141141
@@ -146,21 +146,21 @@ if(purpose == "school") {
146146 z_shape_private <- z_shape_private [sel_zone ,]
147147 z_shape_private @ data <- data.frame (geo_code = z_shape_private $ geo_code )
148148 z_shape_private @ data <- left_join(z_shape_private @ data , z_all_attributes_private , by = " geo_code" )
149- saveRDS(z_shape_private , file.path(path_outputs_national , purpose_private , geography , " z_all.Rds" ))
149+ saveRDS(z_shape_private , file.path(path_outputs_national , purpose_private , geography , " z_all.Rds" ) , version = 2 )
150150
151151 print(" private_d" )
152152 print(summary({sel_zone <- d_shape_private $ urn %in% d_all_attributes_private $ urn })) # 206 false = schools excluded from study pop.
153153 d_shape_private <- d_shape_private [sel_zone ,]
154154 d_shape_private @ data <- data.frame (urn = d_shape_private $ urn )
155155 d_shape_private @ data <- left_join(d_shape_private @ data , d_all_attributes_private , by = " urn" )
156- saveRDS(d_shape_private , file.path(path_outputs_national , purpose_private , geography , " d_all.Rds" ))
156+ saveRDS(d_shape_private , file.path(path_outputs_national , purpose_private , geography , " d_all.Rds" ) , version = 2 )
157157}
158158
159159# MERGE LA DATA TO LA GEO FILE [SAME REGARDLESS OF MSOA/LSOA]
160160summary({sel_lad <- (lad $ lad11cd %in% lad_attributes $ lad11cd )}) # 22 false schools = Wales
161161lad <- lad [sel_lad ,]
162162lad @ data <- left_join(lad @ data , lad_attributes , by = " lad11cd" )
163- saveRDS(lad , (file.path(path_outputs_national , purpose , " lad.Rds" )))
163+ saveRDS(lad , (file.path(path_outputs_national , purpose , " lad.Rds" )) , version = 2 )
164164geojson_write(lad , file = file.path(path_outputs_national , purpose , " lad.geojson" ))
165165
166166# MERGE REGION DATA TO REGION GEO FILE [SAME REGARDLESS OF MSOA/LSOA]
0 commit comments