Compare commits
No commits in common. "338e608d926eef669b21811801b752c803aa642e" and "d559b8605eb5bb9f593294fd415b61bb1f270be0" have entirely different histories.
338e608d92
...
d559b8605e
2
.gitignore
vendored
@ -22,4 +22,4 @@ api_key
|
||||
R/route_analysis.html
|
||||
log/
|
||||
# Exclude html files generated in the top directory (from RStudio runs)
|
||||
*.html
|
||||
./*.html
|
||||
|
@ -18,12 +18,9 @@ This script will generate a few figures:
|
||||
### A map of all the walking routes within the walk boundary:
|
||||

|
||||
|
||||
### A map of those walking routes colored by the level of traffic stress to bike
|
||||
### A map of those routes colored by the level of traffic stress to bike
|
||||

|
||||
|
||||
### A map of cycling routes colored by the level of traffic stress to bike (with a 3 mile radius)
|
||||

|
||||
|
||||
## Using make
|
||||
- `make osrm-data`: downloads the OpenStreetMap data for Wisconsin, and preproccesses it for use with OSRM.
|
||||
- `make osrm-container`: starts the OSRM containers (backends and frontends) for walking and biking.
|
||||
|
@ -140,7 +140,7 @@ Notes:
|
||||
|
||||
|
||||
## Combine routes with Bike LTS
|
||||
```{r ltscount, eval = TRUE, echo = TRUE, results = "show", warning = FALSE, error = TRUE, message = FALSE}
|
||||
```{r routeslts, eval = TRUE, echo = TRUE, results = "show", warning = FALSE, error = TRUE, message = FALSE}
|
||||
|
||||
# Count the routes that intersect or overlap with each segment of the bike_tls network.
|
||||
# The intersections have a buffer of 20m
|
||||
@ -148,9 +148,11 @@ bike_lts_buffer <- st_buffer(st_intersection(bike_lts, cycle_boundary_poly), 20)
|
||||
|
||||
bike_lts_buffer["student_use"] <- unlist(lapply(st_intersects(bike_lts_buffer, routes), length))
|
||||
|
||||
bike_lts <- left_join(bike_lts, as.data.frame(bike_lts_buffer %>% select(OBJECTID, student_use)), by = "OBJECTID")
|
||||
bike_lts <- st_join(bike_lts, bike_lts_buffer %>% select(OBJECTID, student_use))
|
||||
```
|
||||
Notes: for each segment in bike_lts, this counts how many student's calculated routes intersect with it (within a 20 m buffer)
|
||||
|
||||
Notes:
|
||||
|
||||
|
||||
# Make Maps
|
||||
|
||||
|
@ -162,7 +162,7 @@ Notes:
|
||||
|
||||
|
||||
## Combine routes with Bike LTS
|
||||
```{r ltscount, eval = TRUE, echo = TRUE, results = "show", warning = FALSE, error = TRUE, message = FALSE}
|
||||
```{r routeslts, eval = TRUE, echo = TRUE, results = "show", warning = FALSE, error = TRUE, message = FALSE}
|
||||
|
||||
# Count the routes that intersect or overlap with each segment of the bike_tls network.
|
||||
# The intersections have a buffer of 20m
|
||||
@ -170,23 +170,11 @@ bike_lts_buffer <- st_buffer(st_intersection(bike_lts, cycle_boundary_poly), 20)
|
||||
|
||||
bike_lts_buffer["student_use"] <- unlist(lapply(st_intersects(bike_lts_buffer, routes), length))
|
||||
|
||||
bike_lts <- left_join(bike_lts, as.data.frame(bike_lts_buffer %>% select(OBJECTID, student_use)), by = "OBJECTID")
|
||||
bike_lts <- st_join(bike_lts, bike_lts_buffer %>% select(OBJECTID, student_use))
|
||||
```
|
||||
|
||||
Notes: for each segment in bike_lts, this counts how many student's calculated routes intersect with it (within a 20 m buffer)
|
||||
Notes:
|
||||
|
||||
```{r routeslts, eval = FALSE, echo = TRUE, results = "show", warning = FALSE, error = TRUE, message = FALSE}
|
||||
routes_lts <-list(NULL)
|
||||
for(i in addresses_near %>% arrange(number) %>% pull(number)) {
|
||||
lts_segments <- st_intersects(routes %>% filter(student_number == i), bike_lts_buffer)
|
||||
lts_max <- max(bike_lts_buffer %>% filter(OBJECTID.x ))
|
||||
routes_lts[[i]] <- routes_lts_run
|
||||
message(paste0("done - ", i, " of ", max(addresses_near$number)))
|
||||
}
|
||||
routes_lts <- bind_rows(routes_lts)
|
||||
```
|
||||
|
||||
Notes: for each student's route, this finds which bike_lts segment it intersects with and calculates a max and an average
|
||||
|
||||
# Make Maps
|
||||
|
||||
|
Before Width: | Height: | Size: 3.1 MiB After Width: | Height: | Size: 3.1 MiB |
Before Width: | Height: | Size: 3.6 MiB After Width: | Height: | Size: 3.6 MiB |
Before Width: | Height: | Size: 3.9 MiB |
Before Width: | Height: | Size: 3.5 MiB After Width: | Height: | Size: 3.5 MiB |
@ -114,7 +114,7 @@ routes <- bind_rows(routes)
|
||||
|
||||
|
||||
## Combine routes with Bike LTS
|
||||
```{r ltscount, eval = TRUE, echo = TRUE, results = "show", warning = FALSE, error = TRUE, message = FALSE}
|
||||
```{r routeslts, eval = TRUE, echo = TRUE, results = "show", warning = FALSE, error = TRUE, message = FALSE}
|
||||
|
||||
# Count the routes that intersect or overlap with each segment of the bike_tls network.
|
||||
# The intersections have a buffer of 20m
|
||||
@ -122,9 +122,8 @@ bike_lts_buffer <- st_buffer(st_intersection(bike_lts, walk_boundary_poly), 20)
|
||||
|
||||
bike_lts_buffer["student_use"] <- unlist(lapply(st_intersects(bike_lts_buffer, routes), length))
|
||||
|
||||
bike_lts <- left_join(bike_lts, as.data.frame(bike_lts_buffer %>% select(OBJECTID, student_use)), by = "OBJECTID")
|
||||
bike_lts <- st_join(bike_lts, bike_lts_buffer %>% select(OBJECTID, student_use))
|
||||
```
|
||||
Notes: for each segment in bike_lts, this counts how many student's calculated routes intersect with it (within a 20 m buffer)
|
||||
|
||||
# Make Maps
|
||||
|
||||
|