From 7ff54d52eac4da936fc44e657bd16944ab066cb4 Mon Sep 17 00:00:00 2001 From: Ben Varick Date: Wed, 29 Jan 2025 15:11:30 -0600 Subject: [PATCH] changed to osmium-tool --- Makefile | 8 +++++--- README.md | 9 +++++++++ docker/osm_edit/.gitignore | 9 --------- docker/osm_edit/osm-data/.gitignore | 4 ---- 4 files changed, 14 insertions(+), 16 deletions(-) delete mode 100644 docker/osm_edit/.gitignore delete mode 100644 docker/osm_edit/osm-data/.gitignore diff --git a/Makefile b/Makefile index 7c3e269..cc821ab 100644 --- a/Makefile +++ b/Makefile @@ -46,6 +46,8 @@ brouter-data: osm_edit_import_pbf: cd ./docker/osm_edit/; wget https://download.geofabrik.de/north-america/us/wisconsin-latest.osm.pbf -O ./osm-data/wisconsin-latest.osm.pbf - cd ./docker/osm_edit/; rm -rf ./docker-osmosis; git clone https://github.com/bvarick/docker-osmosis.git - cd ./docker/osm_edit/; docker build -t osmosis ./docker-osmosis - cd ./docker/osm_edit/; docker run -v ./osm-data:/osm-data osmosis osmosis --read-pbf "/osm-data/wisconsin-latest.osm.pbf" --write-xml file="/osm-data/wisconsin-latest.osm" + cd ./docker/osm_edit/; rm ./osm-data/wisconsin-latest.osm; docker run -v ./osm-data:/osm-data ghcr.io/bvarick/osmosis:0.49.2 osmosis --read-pbf "/osm-data/wisconsin-latest.osm.pbf" --write-xml file="/osm-data/wisconsin-latest.osm" + +osm_edit_create_pbfs: + docker run -v ./data/osm/osm_edit:/osm_edit ghcr.io/bvarick/osmium-tool:2.21.0 osmium cat /osm_edit/map.osm -o /osm_edit/map.osm.pbf + docker run -v ./data/osm/osm_edit:/osm_edit ghcr.io/bvarick/osmium-tool:2.21.0 osmium cat /osm_edit/map_edited.osm -o /osm_edit/map_edited.osm.pbf \ No newline at end of file diff --git a/README.md b/README.md index ae43ea3..dd7e7bc 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,15 @@ 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. +## What-if analysis +This allows you to make changes to the street network (add a bike path, reduce a lane on an arterial st) and see how it affects the routes that brouter chooses. +This is a multi-step process: +1. Download a chunk of OpenStreetMap data: https://www.openstreetmap.org/export +2. Make edits to that file in [JOSM](https://josm.openstreetmap.de/) +3. Save the edited file as `map_edited.osm`, save both `map.osm` and `map_edited.osm` in `data/osm/osm_edit/` +4. `make osm_edit_create_pbfs` will generate two files `map.osm.pbf` and `map_edited.osm.pbf` in `docker/osm_edit/osm-data` +5. + ## Misc. - [Bike Level of Traffic Stress (LTS)](https://www.dvrpc.org/webmaps/bike-lts/analysis/) diff --git a/docker/osm_edit/.gitignore b/docker/osm_edit/.gitignore deleted file mode 100644 index e95cb01..0000000 --- a/docker/osm_edit/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore - -# Except Dockerfile -!Dockerfile - -!osm-data/ diff --git a/docker/osm_edit/osm-data/.gitignore b/docker/osm_edit/osm-data/.gitignore deleted file mode 100644 index 5e7d273..0000000 --- a/docker/osm_edit/osm-data/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore