Skip to content

TimeTraveler is a route traffic analysis system designed to study and compare traffic patterns on specific routes over time across different modes. It captures and analyzes route data at 15-minute intervals, to deliver insight on traffic patterns across days, weeks, months and years.

Notifications You must be signed in to change notification settings

thushana/timetraveler

Repository files navigation

TimeTraveler → ⏱️ 🚗 🚶‍♂️ 🚲 🚌

(In progress - Basic direction timing captured, now working on saving it into a database)

TimeTraveler is a route traffic analysis system designed to study and compare traffic patterns on specific routes over time across different modes. It captures and analyzes route data at 15-minute intervals, to deliver insight on traffic patterns across days, weeks, months and years.

Prerequisites

  • Python 3.11 or higher
  • PostgreSQL 15 or higher
  • Virtual environment tool (venv recommended)

Installation

  1. Clone the repository:
git clone https://github.com/thushana/timetraveler
cd timetraveler
  1. Create and activate a virtual environment:
python -m venv timetraveler_venv
source timetraveler_venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Set up environment variables:
cp .env.example .env # Edit .env with your configuration settings
  1. Initialize the database:
python scripts/setup_db.py

Usage

Common project tasks can be simplified using the provided Makefile commands:

  1. Set up the environment and initialize the database:

    make setup
  2. Run the journey cron script in debug mode:

    make run
  3. Apply Alembic migrations manually:

    make migrate
  4. Reset the database (drop and recreate):

    make reset-db
  5. Clean the virtual environment:

    make clean

How We Chose 15-Minute Time Slices

We carefully considered how to divide and track time in our system. After exploring various options, including looking into Department of Transportation standards, we settled on a structure that combines precise measurement intervals with natural time periods:

  • We use 15-minute measurement intervals, based on reading the FHWA Traffic Monitoring Guide and Travel Time Data Collection Handbook (Source)
  • We divided the 24-hour day into six equal 4-hour periods:
    • Overnight (00:00-03:59)
    • Dawn (04:00-07:59)
    • Morning (08:00-11:59)
    • Afternoon (12:00-15:59)
    • Evening (16:00-19:59)
    • Night (20:00-23:59)
  • Each poll of the travel time is slotted into one of these intervals to speed analysis.

References:

About

TimeTraveler is a route traffic analysis system designed to study and compare traffic patterns on specific routes over time across different modes. It captures and analyzes route data at 15-minute intervals, to deliver insight on traffic patterns across days, weeks, months and years.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published