Analytics of Open Public Transport data
tbd
- tbd
Initialize the submodules of this repository by running the following commands.
git submodule init
git submodule updateInstall Anaconda
brew install --cask anaconda
export PATH="/usr/local/anaconda3/bin:$PATH"Install osmnx.
conda config --prepend channels conda-forge
conda create -n ox --strict-channel-priority osmnxBEWARE: Make sure that any venv is deactivated which can be done by deactivate.
BEWARE: Make sure that you only activate the ox environment using conda activate ox.
Install GDAL bindings.
brew install gdal
pip download GDAL
tar -xpzf GDAL-*.tar.gz
cd GDAL-*
python setup.py build_ext --gdal-config /usr/local/Cellar/gdal/*/bin/gdal-config
python setup.py build
python setup.py installInstall the following dependencies to fulfill the requirements for this project to run.
python -m pip install --upgrade pip
pip install flake8 pytest
pip install geojson
pip install tdqm
pip install GDAL
pip install networkx
pip install shapely
pip install geopy
pip install peartree
pip install fastapi
pip install osm2geojson
pip install google-cloud-storageRun this command to download data.
cd data
python main.pyRun this command to start the main script.
python main.py [OPTION]...
-h, --help show this help
-c, --clean clean intermediate results before start
-q, --quiet do not log outputs
-p, --points number of sample points to use
Examples:
python main.py -c -p 10000Run this command to run the web server locally.
cd ./app
python app.py --reloadOpen http://localhost:8000/docs#/ to see the OpenAPI specification.
Run this command to run the docker container locally.
docker build -t open-public-transport .
docker run -p 8080:8000 open-public-transportRun this command to deploy the Docker image to Google Cloud.
gcloud auth login
gcloud config set project open-public-transport
gcloud builds submit --tag gcr.io/open-public-transport/open-public-transport-backendIn some occasions graphml files created by peartree cannot be loaded since their IDs have a weird format, such as _
cd results/results/<CITY>/graphs/peartree
sed -E -i '.bak' 's/\"[A-z0-9 ]+[_de]+([0-9]*):*([0-9]*):*([0-9]*):*([0-9]*):*([0-9]*)[_G]*\"/\1\2\3\4\5\"/g' <GRAPH_FILE>See the open issues for a list of proposed features (and known issues).
Follow our contribution guidelines.
Between September 2021 through February 2022 this project is founded by German Federal Ministry of Education and Research and supported by Prototype Fund.
Distributed under the GPLv3 License. See LICENSE.md for more information.