Compare commits
No commits in common. "ef51272a69c549e99fda8f6cd404ff4afa753f9d" and "8348f5606c29f57df02cb3eea928719be1c95e15" have entirely different histories.
ef51272a69
...
8348f5606c
2
.gitignore
vendored
2
.gitignore
vendored
@ -21,5 +21,3 @@ trash/
|
|||||||
api_key
|
api_key
|
||||||
R/route_analysis.html
|
R/route_analysis.html
|
||||||
log/
|
log/
|
||||||
# Exclude html files generated in the top directory (from RStudio runs)
|
|
||||||
./*.html
|
|
||||||
|
29
Makefile
29
Makefile
@ -1,35 +1,9 @@
|
|||||||
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")'
|
||||||
|
|
||||||
cycle_osrm: cycling_route_analysis.Rmd
|
cycle: cycling_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 = "./cycling_route_analysis.Rmd", output_file = "./html/cycling_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 = "./cycling_route_analysis.Rmd", output_file = "./html/cycling_route_analysis.html")'
|
||||||
|
|
||||||
cycle_brouter: cycling_route_analysis_brouter.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 = "./cycling_route_analysis_brouter.Rmd", output_file = "./html/cycling_route_analysis.html")'
|
|
||||||
|
|
||||||
osrm-container: ./docker/osrm/docker-compose.yml
|
|
||||||
cd ./docker/osrm/; docker compose up -d
|
|
||||||
|
|
||||||
osrm-data:
|
|
||||||
cd ./docker/osrm/; wget https://download.geofabrik.de/north-america/us/wisconsin-latest.osm.pbf -O ./data-raw/wisconsin-latest.osm.pbf
|
|
||||||
cd ./docker/osrm/; docker run -t -v "./data-foot:/data" -v "./data-raw/wisconsin-latest.osm.pbf:/data/wisconsin-latest.osm.pbf" osrm/osrm-backend osrm-extract -p /opt/foot.lua /data/wisconsin-latest.osm.pbf
|
|
||||||
cd ./docker/osrm/; docker run -t -v "./data-foot:/data" -v "./data-raw/wisconsin-latest.osm.pbf:/data/wisconsin-latest.osm.pbf" osrm/osrm-backend osrm-partition /data/wisconsin-latest.osrm
|
|
||||||
cd ./docker/osrm/; docker run -t -v "./data-foot:/data" -v "./data-raw/wisconsin-latest.osm.pbf:/data/wisconsin-latest.osm.pbf" osrm/osrm-backend osrm-customize /data/wisconsin-latest.osrm
|
|
||||||
cd ./docker/osrm/; docker run -t -v "./data-bicycle:/data" -v "./data-raw/wisconsin-latest.osm.pbf:/data/wisconsin-latest.osm.pbf" osrm/osrm-backend osrm-extract -p /opt/bicycle.lua /data/wisconsin-latest.osm.pbf
|
|
||||||
cd ./docker/osrm/; docker run -t -v "./data-bicycle:/data" -v "./data-raw/wisconsin-latest.osm.pbf:/data/wisconsin-latest.osm.pbf" osrm/osrm-backend osrm-partition /data/wisconsin-latest.osrm
|
|
||||||
cd ./docker/osrm/; docker run -t -v "./data-bicycle:/data" -v "./data-raw/wisconsin-latest.osm.pbf:/data/wisconsin-latest.osm.pbf" osrm/osrm-backend osrm-customize /data/wisconsin-latest.osrm
|
|
||||||
|
|
||||||
brouter-container: ./docker/brouter/docker-compose.yml
|
|
||||||
cd ./docker/brouter; docker compose up -d
|
|
||||||
|
|
||||||
brouter-data:
|
|
||||||
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/; 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 config.template.js config.js
|
|
||||||
cd ./docker/brouter; docker compose build
|
|
||||||
|
|
||||||
clean: clean-data clean-figure clean-script
|
clean: clean-data clean-figure clean-script
|
||||||
|
|
||||||
clean-data:
|
clean-data:
|
||||||
@ -42,4 +16,3 @@ clean-figure:
|
|||||||
rm -rvf ./figure/
|
rm -rvf ./figure/
|
||||||
|
|
||||||
.PHONY: data
|
.PHONY: data
|
||||||
|
|
||||||
|
15
README.md
15
README.md
@ -2,7 +2,7 @@
|
|||||||
This script generates maps to analyze the potential walking routes for students to their school.
|
This script generates maps to analyze the potential walking routes for students to their school.
|
||||||
|
|
||||||
- I excluded the addresses of the students from the repository.
|
- I excluded the addresses of the students from the repository.
|
||||||
- The actual route generation is done with OSRM and brouter, those are run locally in docker containers.
|
- The actual route generation is done with OSRM, I run it locally in a docker container.
|
||||||
- The basemap is pulled from Stadia Maps. The usage of the script is well within the free tier, you'll need an API key from them.
|
- The basemap is pulled from Stadia Maps. The usage of the script is well within the free tier, you'll need an API key from them.
|
||||||
|
|
||||||
## Data sources
|
## Data sources
|
||||||
@ -22,17 +22,8 @@ This script will generate a few figures:
|
|||||||

|

|
||||||
|
|
||||||
## Using make
|
## Using make
|
||||||
- `make osrm-data`: downloads the OpenStreetMap data for Wisconsin, and preproccesses it for use with OSRM.
|
The command `make route_analysis` will run *route_analysis.Rmd* which
|
||||||
- `make osrm-container`: starts the OSRM containers (backends and frontends) for walking and biking.
|
is an R markdown file containing the original R script *route_analysis.R*
|
||||||
- `make brouter-data`: clones the repositories for brouter and brouter-web and downloads the segment data. It also builds the docker images for brouter and brouter-web.
|
|
||||||
- `make brouter-container`: starts the brouter containers (backend and frontend).
|
|
||||||
- `make walk` will run *route_analysis.Rmd* which
|
|
||||||
calculates the walking routes using OSRM.
|
|
||||||
- `make cycle-osrm` will run *cycling_route_analysis.Rmd* which calculates the biking routes using OSRM.
|
|
||||||
- `make cycle-brouter` will run *cycling_route_analysis_brouter.Rmd* which calculates the biking routes using brouter.
|
|
||||||
|
|
||||||
## Misc.
|
## Misc.
|
||||||
- [Bike Level of Traffic Stress (LTS)](https://www.dvrpc.org/webmaps/bike-lts/analysis/)
|
- [Bike Level of Traffic Stress (LTS)](https://www.dvrpc.org/webmaps/bike-lts/analysis/)
|
||||||
|
|
||||||
## OpenStreetMap Data
|
|
||||||
- [wisconsin-latest.osm.pbf](https://download.geofabrik.de/north-america/us/wisconsin-latest.osm.pbf)
|
|
||||||
|
@ -155,7 +155,7 @@ routes <- bind_rows(routes)
|
|||||||
```
|
```
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
- this queries the brouter server to get routes
|
- _osrmRoute_ is the primary function used above.
|
||||||
|
|
||||||
|
|
||||||
## Combine routes with Bike LTS
|
## Combine routes with Bike LTS
|
||||||
|
10
docker/brouter/.gitignore
vendored
10
docker/brouter/.gitignore
vendored
@ -1,10 +0,0 @@
|
|||||||
# Ignore everything in this directory
|
|
||||||
*
|
|
||||||
# Except this file
|
|
||||||
!.gitignore
|
|
||||||
|
|
||||||
# Except the list of relevant segments
|
|
||||||
!segments.csv
|
|
||||||
|
|
||||||
# Except docker-compose.yml
|
|
||||||
!docker-compose.yml
|
|
@ -1,26 +0,0 @@
|
|||||||
---
|
|
||||||
services:
|
|
||||||
brouter:
|
|
||||||
container_name: brouter
|
|
||||||
ports:
|
|
||||||
- 17777:17777
|
|
||||||
volumes:
|
|
||||||
- ./brouter/misc/segments4:/segments4
|
|
||||||
image: brouter
|
|
||||||
build:
|
|
||||||
context: ./brouter
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
---
|
|
||||||
services:
|
|
||||||
brouter-web:
|
|
||||||
container_name: brouter-web
|
|
||||||
ports:
|
|
||||||
- 127.0.0.1:8080:80
|
|
||||||
volumes:
|
|
||||||
- ./brouter-web/config.js:/usr/share/nginx/html/config.js
|
|
||||||
- ./brouter-web/keys.js:/usr/share/nginx/html/keys.js
|
|
||||||
- ./brouter-web/profiles:/usr/share/nginx/html/profiles
|
|
||||||
image: brouter-web
|
|
||||||
build:
|
|
||||||
context: ./brouter-web
|
|
||||||
dockerfile: Dockerfile
|
|
@ -1,4 +0,0 @@
|
|||||||
https://brouter.de/brouter/segments4/W90_N40.rd5
|
|
||||||
https://brouter.de/brouter/segments4/W90_N45.rd5
|
|
||||||
https://brouter.de/brouter/segments4/W95_N40.rd5
|
|
||||||
https://brouter.de/brouter/segments4/W95_N45.rd5
|
|
|
10
docker/osrm/.gitignore
vendored
10
docker/osrm/.gitignore
vendored
@ -1,10 +0,0 @@
|
|||||||
# Ignore everything in this directory
|
|
||||||
*
|
|
||||||
# Except this file
|
|
||||||
!.gitignore
|
|
||||||
!docker-compose.yml
|
|
||||||
!docker-compose-2.yml
|
|
||||||
!preprocess.sh
|
|
||||||
!data-raw/
|
|
||||||
!data-foot/
|
|
||||||
!data-bicycle/
|
|
4
docker/osrm/data-bicycle/.gitignore
vendored
4
docker/osrm/data-bicycle/.gitignore
vendored
@ -1,4 +0,0 @@
|
|||||||
# Ignore everything in this directory
|
|
||||||
*
|
|
||||||
# Except this file
|
|
||||||
!.gitignore
|
|
4
docker/osrm/data-foot/.gitignore
vendored
4
docker/osrm/data-foot/.gitignore
vendored
@ -1,4 +0,0 @@
|
|||||||
# Ignore everything in this directory
|
|
||||||
*
|
|
||||||
# Except this file
|
|
||||||
!.gitignore
|
|
4
docker/osrm/data-raw/.gitignore
vendored
4
docker/osrm/data-raw/.gitignore
vendored
@ -1,4 +0,0 @@
|
|||||||
# Ignore everything in this directory
|
|
||||||
*
|
|
||||||
# Except this file
|
|
||||||
!.gitignore
|
|
@ -1,32 +0,0 @@
|
|||||||
---
|
|
||||||
services:
|
|
||||||
osrm-backend-foot:
|
|
||||||
container_name: osrm-backend-foot
|
|
||||||
ports:
|
|
||||||
- 5000:5000
|
|
||||||
volumes:
|
|
||||||
- ./data-foot:/data
|
|
||||||
- ./data-raw/wisconsin-latest.osm.pbf:/data/wisconsin-latest.osm.pbf
|
|
||||||
image: osrm/osrm-backend
|
|
||||||
command: osrm-routed --algorithm mld /data/wisconsin-latest.osrm
|
|
||||||
osrm-backend-bicycle:
|
|
||||||
container_name: osrm-backend-bicycle
|
|
||||||
ports:
|
|
||||||
- 5001:5000
|
|
||||||
volumes:
|
|
||||||
- ./data-bicycle:/data
|
|
||||||
- ./data-raw/wisconsin-latest.osm.pbf:/data/wisconsin-latest.osm.pbf
|
|
||||||
image: osrm/osrm-backend
|
|
||||||
command: osrm-routed --algorithm mld /data/wisconsin-latest.osrm
|
|
||||||
osrm-frontend-foot:
|
|
||||||
ports:
|
|
||||||
- 9966:9966
|
|
||||||
environment:
|
|
||||||
OSRM_BACKEND: 'http://localhost:5000'
|
|
||||||
image: osrm/osrm-frontend
|
|
||||||
osrm-frontend-bicycle:
|
|
||||||
ports:
|
|
||||||
- 9967:9966
|
|
||||||
environment:
|
|
||||||
OSRM_BACKEND: 'http://localhost:5001'
|
|
||||||
image: osrm/osrm-frontend
|
|
Loading…
x
Reference in New Issue
Block a user