Giter Club home page Giter Club logo

Matching timetabled bus journeys to archived real-time bus trips

The scripts in this repository attempt to match real-time bus position information against timetabled journeys and to present the results as a table from which trips and journeys can be viewed on a map.

This document provides instructions for installing them on the TFC platform. See DESCRIPTION.md for a more general description and instructions for a stand-alone installation.

Installation

  1. Clone this repository in the home directory of the tfc_prod user

  2. cd timetable_matching

  3. mkdir -p /mnt/sdb1/tfc/cam_tt_matching/json

  4. mkdir -p /mnt/sdb1/tfc/tnds/sections

  5. ln -s /mnt/sdb1/tfc/cam_tt_matching/ /media/tfc/cam_tt_matching

  6. ln -s /mnt/sdb1/tfc/tnds/ /media/tfc/tnds

  7. (as root) cp nginx/tt_matching.conf /etc/nginx/includes2/

  8. (as root) service nginx restart

  9. python3 -m venv venv

  10. pip install -r requirements.txt

  11. cp setup_environment.skel setup_environment. Edit setup_environment to set at least API_TOKEN, TNDS_USERNAME and TNDS_PASSWORD (or copy from one of the other servers). The default values of the other variables should be fine.

The script refresh_timetable.sh will fetch a copy of the requred timetable files into /media/tfc/tnds. It runs no more than once every 2 hours and only fetched timetable data when it changes.

The script process_day.sh (which itself runs refresh_timetable.sh) takes zero or more 'YYYY-MM-DD' command-line parameters and generates merged data files for the corresponding days. If run with no command-line parameters it generates merged data files for "yesterday". It shouldn't be run for a day that doesn't have complete trip data (like 'today').

On tfc-app4, tfc_prod's crontab file has run process_day.sh daily at 02:45 since late September 2018:

# Extract yesterday's timetable and journeys
45 2 * * * cd /home/tfc_prod/timetable_matching/ && ./process_day.sh >/var/log/tfc_prod/process_day.err 2>&1 && echo $(date --iso-8601=seconds) > /var/log/tfc_prod/process_day.timestamp

The web interface for interrogating the analysed data is at http://<hostname>/backdoor/tt_matching/index.html. It needs to be run with a query parameter identifying the day to analyse, e.g.

http://<hostname>/backdoor/tt_matching/index.html?2018-10-01

Jon Warbrick's Projects

analog_datetime_parser icon analog_datetime_parser

A Python module handling parsing of date/time specifications as used by late-lamented Analog web log analyser

busstop_viewer icon busstop_viewer

A tool to help reconcile bus stopn in OSM with NaPTAN. Not working ATM.

datetime-format-analog icon datetime-format-analog

A Perl module handling parsing of date/time specifications as used by late-lamented Analog web log analyser

drum-music icon drum-music

Some experiments typesetting drum kit music with Lillypond

easyabc icon easyabc

An attempt at building EasyABC for 64-bit Macos and Macos 10.15 Catelina. The work was never completed, and has been superseded by the work of Frédéric Aupepin which can be found at https://github.com/aupfred/EasyABC/tree/playback-mac-mplay

term-dates icon term-dates

Perl module providing dates relating to University of Cambridge terms

tunebook-abc icon tunebook-abc

The Tuneworks Tunebook of common folk tunes transcribed into ABC notation

x509-utils icon x509-utils

A collection of scripts for working with x509 certificate and certificate requests

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.