https://github.com/robinlovelace/cyclemon
Analyse cycling potential in Monmouthshire
https://github.com/robinlovelace/cyclemon
Last synced: 2 months ago
JSON representation
Analyse cycling potential in Monmouthshire
- Host: GitHub
- URL: https://github.com/robinlovelace/cyclemon
- Owner: Robinlovelace
- Created: 2020-09-12T15:46:37.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-05-19T06:10:48.000Z (about 1 year ago)
- Last Synced: 2024-06-11T16:09:41.431Z (12 months ago)
- Language: Python
- Size: 13.4 MB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CycleMon: automated generation of basic walking and cycling analysis from open data
[](https://zenodo.org/doi/10.5281/zenodo.11214956)
Academic paper: see the paper/ subdirectory [here](https://github.com/Robinlovelace/cyclemon/tree/master/paper).
# Usage
## Prerequisites
* Currently, Windows (7 or higher). This is due to the requirements of sDNA, though we hope to change that soon.
* QGIS+GRASS. We used QGIS version 3.14 with GRASS 7.8.3.
* To fix a bug in scripting QGIS, we needed to add the following line to `OSGeo4W.bat` in the QGIS install directory: `call "C:\Program Files\QGIS 3.14\apps\grass\grass78\etc\env.bat" `
* sDNA Open, version 4.2 or later https://github.com/fiftysevendegreesofrad/sdna_open/releases/tag/v4.2.0
* R
* Python 3, including pyrosm. https://pypi.org/project/pyrosm/
* We managed dependencies with Anaconda, as such you could install our python environment with `conda env create -f code/conda_env.yml` then activate with `conda activate cyclemon`
* GNU Make or (for better debugging) remake http://bashdb.sourceforge.net/remake/; which therefore (in Windows) require MSYS
## Input dataThe directory input-data/ should contain the following
* `input-data`
* `towns`
* (directory for each town, with name chosen by you e.g. `monmouth`)
* `cycle-buffer.shp` containing a single polygon with the area of interest
* `destinations.shp` containing a single point with destination of interest
* `destination-zones.csv` containing trip counts from each origin zone to the destination of interest
* `zone-polygons.shp` containing named polygons for all the origin zones
* `terrain.tif` containing height data## Configuring the model
* Open `code/Makefile` and check the paths at the top match your install locations of QGIS and sDNA_Open.
* Open `code/osm_download.py` and edit the following line, changing `wales` to the appropriate region supported by pyrosm (see https://pyrosm.readthedocs.io/en/latest/basics.html#available-datasets), such as `great_britain` ... unless of course, your model falls entirely in Wales):data = pyrosm.get_data("wales",directory="../intermediate-data-scratch")
* Open QGIS, navigate to `Settings -> Options -> Processing -> Scripts -> Scripts folder(s)`: add the full path to `cyclemon\code\qgis_scripts` to the list of folders. Close and re-open QGIS to make sure your change persisted.## Running the model
e.g. To generate all models from `input-data/towns/monmouth`:
`cd code`
`make monmouth-town-all`
Check intermediate-data-scratch/towns/(your town)/tag-decode-errors.gpkg (if it exists) to check for any OSM tags we thought might need manual interpretation.
Check `output-data/towns/(your town)` for the results. As a starting point have a look at
* `summary_walk_qgis.qgs`
* `summary_cycle_qgis.qgs`
* `all_outputs_qgis.qgs`and see `metadata.html` for a description of each layer within these.
For more detail on how each output was computed, check the academic paper and/or comments in `Makefile`.