Skip to content

Commit

Permalink
update: add demo OSM network download wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalmhjn committed Sep 23, 2024
1 parent 53a08cb commit 7ab9f1e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,13 @@ The framework has been tested on **SUMO 1.13.0** and **Python 3.8** on both Ubun
python runSim.py munich
```

## Other SUMO-related tasks (optional):
### Network download:
```sh
cd src/helpers
sh run_download.sh
```

## Citation

If you use these codes in your work, kindly cite the following preprint:
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/downloadNetwork.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def download_raw_network_data(RAW_NETWORK, bbox):
response = requests.post(
"https://overpass-api.de/api/interpreter", headers=headers, data=data
)
with open("../data/" + RAW_NETWORK, "w") as f:
with open(RAW_NETWORK, "w") as f:
f.write(response.text)


Expand Down
9 changes: 9 additions & 0 deletions src/helpers/run_download.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export RAW_NETWORK=demo_raw_network.osm
export CLEAN_NETWORK=demo_clean_network.osm
export FINAL_NETWORK=demo_network.net.xml

export BBOX=47.6985415483953190,11.8014099151749789,47.9689446658581744,12.2510342616238823

python3 downloadNetwork.py
osmfilter $RAW_NETWORK --keep="highway" --drop="highway=footway =service =steps =bridleway =construction =path =proposed =raceway =track =barrier =living_street =raceway =corridor" > $CLEAN_NETWORK # =unclassified =residential =cycleway =pedestrian
netconvert --osm-files $CLEAN_NETWORK --remove-edges.isolated --ramps.guess --roundabouts.guess --edges.join --join-lanes --tls.guess.joining --junctions.join --junctions.join-dist 50 --no-turnarounds.except-turnlane --geometry.avoid-overlap --ramps.no-split --geometry.remove --tls.discard-simple --tls.guess-signals --tls.join --no-internal-links -o $FINAL_NETWORK

0 comments on commit 7ab9f1e

Please sign in to comment.