Compare commits

..

2 Commits

Author SHA1 Message Date
47a4e865d6
attempt at generating Brouter segment files 2025-01-31 12:05:33 -06:00
d852d5814e
adjusted directories, edited README 2025-01-31 11:49:45 -06:00
8 changed files with 88 additions and 7 deletions

View File

@ -49,10 +49,12 @@ osm_edit_import_pbf:
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" 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_refresh_base: osm_edit_refresh_base:
cd ./data/osm; wget https://download.geofabrik.de/north-america/us/wisconsin-latest.osm.pbf -O ./wisconsin-latest.osm.pbf cd ./docker/brouter/osm_edit; wget https://download.geofabrik.de/north-america/us/wisconsin-latest.osm.pbf -O ./pbf_files/wisconsin-latest.osm.pbf
cd ./data/osm/osm_edit/srtm/; wget -i srtm_tiles.csv -P ./ cd ./docker/brouter/osm_edit/srtm/; wget -i srtm_tiles.csv -P ./
osm_edit_generate_pbf: osm_edit_generate_pbf:
docker run -v ./data/osm:/osm ghcr.io/bvarick/osmium-tool:2.21.0 osmium apply-changes /osm/wisconsin-latest.osm.pbf /osm/osm_edit/map_edited.osm -o /osm/osm_edit/wisconsin-latest_edited.osm.pbf --overwrite cd ./docker/brouter/; docker run -v ./osm_edit:/osm_edit ghcr.io/bvarick/osmium-tool:2.21.0 osmium apply-changes /osm_edit/pbf_files/wisconsin-latest.osm.pbf /osm_edit/map_edited.osm -o /osm_edit/pbf_files/wisconsin-latest_edited.osm.pbf --overwrite
osm_edit_generate_brouter: osm_edit_generate_brouter:
docker run --rm -v ./docker/brouter/osm_edit:/osm_edit brouter /osm_edit/process_pbf.sh

View File

@ -38,8 +38,10 @@ calculates the walking routes using OSRM.
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 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: This is a multi-step process:
1. Make edits to OpenStreetMap in [JOSM](https://josm.openstreetmap.de/) 1. Make edits to OpenStreetMap in [JOSM](https://josm.openstreetmap.de/)
2. Save the edited map as `map_edited.osm` in `data/osm/osm_edit/` (File -> Save As) 2. Save the edited map as `map_edited.osm` in `docker/brouter/osm_edit/` (File -> Save As)
3. `make osm_edit_generate_pbf` will take those edits and apply them to the `wisconsin-latest.osm.pbf` and generate `wisconsin-latest_edited.osm.pbf` 3. `make osm_edit_refresh_base` will download a fresh copy of `wisconsin-latest.osm.pbf` and the elevation tiles for Wisconsin. You don't need to run this frequently.
4. `make osm_edit_generate_pbf` will take those edits and apply them to the `wisconsin-latest.osm.pbf` and generate `wisconsin-latest_edited.osm.pbf`
5. `make osm_edit_generate_brouter` will generate new brouter segment files from the edited pbf file.
## 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/)

View File

@ -9,5 +9,5 @@
# Except docker-compose.yml # Except docker-compose.yml
!docker-compose.yml !docker-compose.yml
# Except safety profiles # Except osm_edit
!safety.brf !osm_edit/

13
docker/brouter/osm_edit/.gitignore vendored Normal file
View File

@ -0,0 +1,13 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
# Except osm_edit configuration files
!process_pbf.sh
!srtm/srtm_tiles.csv
# Except osm_edit directories
!brouter_segments/
!pbf_files/
!srtm/

View File

@ -0,0 +1,5 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

View File

@ -0,0 +1,47 @@
#!/bin/bash
set -e
cd /osm_edit
touch lastmaprun.date
JAVA='java -Xmx2600m -Xms2600m -Xmn32m'
BROUTER_PROFILES="/profiles2"
BROUTER_JAR="/brouter.jar"
PLANET_FILE="/osm_edit/pbf_files/wisconsin-latest_edited.osm.pbf"
SRTM_PATH="/osm_edit/srtm"
rm -rf tmp
mkdir tmp
cd tmp
mkdir nodetiles
${JAVA} -cp ${BROUTER_JAR} -DavoidMapPolling=true btools.mapcreator.OsmCutter ${BROUTER_PROFILES}/lookups.dat nodetiles ways.dat relations.dat restrictions.dat ${BROUTER_PROFILES}/all.brf ${PLANET_FILE}
mkdir ftiles
${JAVA} -cp ${BROUTER_JAR} -Ddeletetmpfiles=true -DuseDenseMaps=true btools.mapcreator.NodeFilter nodetiles ways.dat ftiles
${JAVA} -cp ${BROUTER_JAR} -Ddeletetmpfiles=true -DuseDenseMaps=true btools.mapcreator.RelationMerger ways.dat ways2.dat relations.dat ${BROUTER_PROFILES}/lookups.dat ${BROUTER_PROFILES}/trekking.brf ${BROUTER_PROFILES}/softaccess.brf
mkdir waytiles
${JAVA} -cp ${BROUTER_JAR} -Ddeletetmpfiles=true -DuseDenseMaps=true btools.mapcreator.WayCutter ftiles ways2.dat waytiles
mkdir waytiles55
${JAVA} -cp ${BROUTER_JAR} -Ddeletetmpfiles=true -DuseDenseMaps=true btools.mapcreator.WayCutter5 ftiles waytiles waytiles55 bordernids.dat
mkdir nodes55
${JAVA} -cp ${BROUTER_JAR} -Ddeletetmpfiles=true -DuseDenseMaps=true btools.mapcreator.NodeCutter ftiles nodes55
mkdir unodes55
${JAVA} -cp ${BROUTER_JAR} -Ddeletetmpfiles=true -DuseDenseMaps=true btools.mapcreator.PosUnifier nodes55 unodes55 bordernids.dat bordernodes.dat ${SRTM_PATH}
mkdir segments
${JAVA} -cp ${BROUTER_JAR} -DuseDenseMaps=true btools.mapcreator.WayLinker unodes55 waytiles55 bordernodes.dat restrictions.dat ${BROUTER_PROFILES}/lookups.dat ${BROUTER_PROFILES}/all.brf segments rd5
rm -rf /osm_edit/segments4_lastrun
cp -R /osm_edit/segments4 /osm_edit/segments4_lastrun
mv /osm_edit/tmp/segments/ /osm_edit/segments4/
rm -rf /osm_edit/tmp

View File

@ -0,0 +1,8 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
# Except srtm_tiles.csv
!srtm_tiles.csv

View File

@ -0,0 +1,4 @@
https://srtm.csi.cgiar.org/wp-content/uploads/files/srtm_5x5/ASCII/srtm_18_03.zip
https://srtm.csi.cgiar.org/wp-content/uploads/files/srtm_5x5/ASCII/srtm_18_04.zip
https://srtm.csi.cgiar.org/wp-content/uploads/files/srtm_5x5/ASCII/srtm_19_03.zip
https://srtm.csi.cgiar.org/wp-content/uploads/files/srtm_5x5/ASCII/srtm_19_04.zip
1 https://srtm.csi.cgiar.org/wp-content/uploads/files/srtm_5x5/ASCII/srtm_18_03.zip
2 https://srtm.csi.cgiar.org/wp-content/uploads/files/srtm_5x5/ASCII/srtm_18_04.zip
3 https://srtm.csi.cgiar.org/wp-content/uploads/files/srtm_5x5/ASCII/srtm_19_03.zip
4 https://srtm.csi.cgiar.org/wp-content/uploads/files/srtm_5x5/ASCII/srtm_19_04.zip