Compare commits
6 Commits
d559b8605e
...
338e608d92
Author | SHA1 | Date | |
---|---|---|---|
|
338e608d92 | ||
|
4330687ed2 | ||
|
9959536378 | ||
|
b19add99ac | ||
|
1f27a017af | ||
|
6600f0cd74 |
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,9 +18,12 @@ This script will generate a few figures:
|
||||
### A map of all the walking routes within the walk boundary:
|
||||

|
||||
|
||||
### A map of those routes colored by the level of traffic stress to bike
|
||||
### A map of those walking 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 routeslts, eval = TRUE, echo = TRUE, results = "show", warning = FALSE, error = TRUE, message = FALSE}
|
||||
```{r ltscount, 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,11 +148,9 @@ 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 <- st_join(bike_lts, bike_lts_buffer %>% select(OBJECTID, student_use))
|
||||
bike_lts <- left_join(bike_lts, as.data.frame(bike_lts_buffer %>% select(OBJECTID, student_use)), by = "OBJECTID")
|
||||
```
|
||||
|
||||
Notes:
|
||||
|
||||
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
|
||||
|
||||
|
@ -162,7 +162,7 @@ Notes:
|
||||
|
||||
|
||||
## Combine routes with Bike LTS
|
||||
```{r routeslts, eval = TRUE, echo = TRUE, results = "show", warning = FALSE, error = TRUE, message = FALSE}
|
||||
```{r ltscount, 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,11 +170,23 @@ 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 <- st_join(bike_lts, bike_lts_buffer %>% select(OBJECTID, student_use))
|
||||
bike_lts <- left_join(bike_lts, as.data.frame(bike_lts_buffer %>% select(OBJECTID, student_use)), by = "OBJECTID")
|
||||
```
|
||||
|
||||
Notes:
|
||||
Notes: for each segment in bike_lts, this counts how many student's calculated routes intersect with it (within a 20 m buffer)
|
||||
|
||||
```{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 |
BIN
examples/example-routes-lts_cycling.png
Normal file
After 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 routeslts, eval = TRUE, echo = TRUE, results = "show", warning = FALSE, error = TRUE, message = FALSE}
|
||||
```{r ltscount, 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,8 +122,9 @@ 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 <- st_join(bike_lts, bike_lts_buffer %>% select(OBJECTID, student_use))
|
||||
bike_lts <- left_join(bike_lts, as.data.frame(bike_lts_buffer %>% select(OBJECTID, student_use)), by = "OBJECTID")
|
||||
```
|
||||
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
|
||||
|
||||
|