# transport-accessibility
### Tool for cities to easily publish their public transport in a standardized form
Public transport is often provided by many, smaller companies, operating mostly in their respective regions. A problem deriving from this is that, on a interregional, national and international, few machine-readable data is available. This impacts customers, as it makes it more difficult to find public transport routes, more so while travelling in regions they are less familiar with. 

We designed a tool to provide city officials or volunteers to map the public transport in their jurisdiction using an easy-to-use graphical utility. https://www.gnu.org/software/make/

## Installation instructions
### Dependencies
First, make sure to have all dependencies installed:

- An up-to-date version of [Python](https://www.python.org/) and pip.
- The project's Python dependencies. We strongly recommend using a virtual environment and install the dependencies using `pip install -r requirements.txt` in the project's root directory.
- An up-to-date version of [Mariadb](https://mariadb.com/downloads/)
- If you want to build the documentation, you will need [Sphinx](https://www.sphinx-doc.org/en/master/) and [Make](https://www.gnu.org/software/make/)

### Database
- The database can be installed using `sudo mariadb -u root < setup_db.sql`
- The migrations should be applied using `python transport_accessibility/manage.py migrate`
- If you are having database problems and where using an old version of the database before, try resetting the database by issuing `sudo mariadb -u root < delete_db.sql && sudo mariadb -u root < setup_db.sql`, as we changed the character encoding in one of the earlier commits.

### Load example data
- Download some real or sample GTFS data from the Internet.
- Open a django shell: `python transport_accessibility/manage.py shell`
- Import the database bridging functions: `import pt_map.gtfs, pt_map.bridge`
- Load sample data to db: `pt_map.bridge.gtfs_to_db(pt_map.gtfs.GTFS("/path/to/folder"))` (This might take some time)

