Compare commits
No commits in common. "23dea9b2dbdda1e90f1207ee85bfdb91627e37eb" and "21905af23aee631b1d56f542a65bd86cb5862c7c" have entirely different histories.
23dea9b2db
...
21905af23a
24
Makefile
24
Makefile
@ -1,9 +1,3 @@
|
|||||||
all: data containers cycle
|
|
||||||
|
|
||||||
data: osrm-data brouter-data
|
|
||||||
containers: osrm-container brouter-container
|
|
||||||
cycle: cycle_brouter
|
|
||||||
|
|
||||||
walk: route_analysis.Rmd
|
walk: route_analysis.Rmd
|
||||||
R -e 'library("rmarkdown"); old_path <- Sys.getenv("PATH"); Sys.setenv(PATH = paste(old_path, "/usr/local/bin", sep = ":")); rmarkdown::render(knit_root_dir = "./", output_dir = "./html", input = "./route_analysis.Rmd", output_file = "./html/route_analysis.html")'
|
R -e 'library("rmarkdown"); old_path <- Sys.getenv("PATH"); Sys.setenv(PATH = paste(old_path, "/usr/local/bin", sep = ":")); rmarkdown::render(knit_root_dir = "./", output_dir = "./html", input = "./route_analysis.Rmd", output_file = "./html/route_analysis.html")'
|
||||||
|
|
||||||
@ -29,10 +23,24 @@ brouter-container: ./docker/brouter/docker-compose.yml
|
|||||||
cd ./docker/brouter; docker compose up -d
|
cd ./docker/brouter; docker compose up -d
|
||||||
|
|
||||||
brouter-data:
|
brouter-data:
|
||||||
cd ./docker/brouter/; rm -rf ./brouter; git clone https://github.com/abrensch/brouter.git
|
cd ./docker/brouter/; git clone https://github.com/abrensch/brouter.git
|
||||||
cd ./docker/brouter/; wget -i segments.csv -P ./brouter/misc/segments4/
|
cd ./docker/brouter/; wget -i segments.csv -P ./brouter/misc/segments4/
|
||||||
cd ./docker/brouter/; cp safety.brf ./brouter/misc/profiles2/safety.brf
|
cd ./docker/brouter/; cp safety.brf ./brouter/misc/profiles2/safety.brf
|
||||||
cd ./docker/brouter/; rm -rf ./brouter-web; git clone https://github.com/nrenner/brouter-web.git
|
cd ./docker/brouter/; git clone https://github.com/nrenner/brouter-web.git
|
||||||
cd ./docker/brouter/brouter-web; cp keys.template.js keys.js;
|
cd ./docker/brouter/brouter-web; cp keys.template.js keys.js;
|
||||||
cd ./docker/brouter/brouter-web; cp config.template.js config.js
|
cd ./docker/brouter/brouter-web; cp config.template.js config.js
|
||||||
cd ./docker/brouter; docker compose build
|
cd ./docker/brouter; docker compose build
|
||||||
|
|
||||||
|
clean: clean-data clean-figure clean-script
|
||||||
|
|
||||||
|
clean-data:
|
||||||
|
rm -vf ./R/data/*.rds
|
||||||
|
|
||||||
|
clean-script:
|
||||||
|
rm -rvf ./*.md
|
||||||
|
|
||||||
|
clean-figure:
|
||||||
|
rm -rvf ./figure/
|
||||||
|
|
||||||
|
.PHONY: data
|
||||||
|
|
||||||
|
@ -161,18 +161,6 @@ routes <- st_transform(bind_rows(routes), crs = 4326)
|
|||||||
Notes:
|
Notes:
|
||||||
- this queries the brouter server to get routes
|
- this queries the brouter server to get routes
|
||||||
|
|
||||||
## Set boundaries and get basemap
|
|
||||||
```{r basemap, eval = TRUE, echo = TRUE, results = "show", warning = FALSE, error = TRUE, message = FALSE}
|
|
||||||
|
|
||||||
bbox <- st_bbox(st_buffer(cycle_boundary_poly, dist = 500))
|
|
||||||
bbox <- c(left = as.double(bbox[1]),
|
|
||||||
bottom = as.double(bbox[2]),
|
|
||||||
right = as.double(bbox[3]),
|
|
||||||
top = as.double(bbox[4]))
|
|
||||||
|
|
||||||
#get basemap
|
|
||||||
basemap <- get_stadiamap(bbox = bbox, zoom = 15, maptype = "stamen_toner_lite")
|
|
||||||
```
|
|
||||||
|
|
||||||
## Combine routes with Bike LTS
|
## Combine routes with Bike LTS
|
||||||
```{r ltscount, 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}
|
||||||
@ -255,8 +243,8 @@ routes_lts <- bind_rows(routes_lts)
|
|||||||
|
|
||||||
ggmap(basemap) +
|
ggmap(basemap) +
|
||||||
geom_sf(data = routes_lts %>% filter(student_number == 6), inherit.aes = FALSE,
|
geom_sf(data = routes_lts %>% filter(student_number == 6), inherit.aes = FALSE,
|
||||||
aes(color = route$lts,
|
aes(color = route.lts,
|
||||||
geometry = route$geometry),
|
geometry = route.geometry),
|
||||||
linewidth = 2) +
|
linewidth = 2) +
|
||||||
scale_color_manual(values = bike_lts_scale$color, name = "Bike Level of Traffic Stress")
|
scale_color_manual(values = bike_lts_scale$color, name = "Bike Level of Traffic Stress")
|
||||||
|
|
||||||
@ -283,6 +271,19 @@ logo <- image_read(path = "other/BFW_Logo_180_x_200_transparent_background.png")
|
|||||||
school_symbol <- image_read_svg(path = "other/school_FILL0_wght400_GRAD0_opsz24.svg")
|
school_symbol <- image_read_svg(path = "other/school_FILL0_wght400_GRAD0_opsz24.svg")
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Set boundaries and get basemap
|
||||||
|
```{r basemap, eval = TRUE, echo = TRUE, results = "show", warning = FALSE, error = TRUE, message = FALSE}
|
||||||
|
|
||||||
|
bbox <- st_bbox(st_buffer(cycle_boundary_poly, dist = 500))
|
||||||
|
bbox <- c(left = as.double(bbox[1]),
|
||||||
|
bottom = as.double(bbox[2]),
|
||||||
|
right = as.double(bbox[3]),
|
||||||
|
top = as.double(bbox[4]))
|
||||||
|
|
||||||
|
#get basemap
|
||||||
|
basemap <- get_stadiamap(bbox = bbox, zoom = 15, maptype = "stamen_toner_lite")
|
||||||
|
```
|
||||||
|
|
||||||
## Generate map of addresses
|
## Generate map of addresses
|
||||||
```{r mapaddresses, eval = TRUE, echo = FALSE, results = "show", warning = FALSE, error = TRUE, message = FALSE}
|
```{r mapaddresses, eval = TRUE, echo = FALSE, results = "show", warning = FALSE, error = TRUE, message = FALSE}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user