SIG-Bus
QGIS plugin for GTFS reading, passenger demand integration, and per-line report generation.
The Problem
QGIS has no native GTFS support beyond basic geometry loading. For a transport engineer analyzing Belo Horizonte's bus network β combining route geometry, schedules, and passenger demand β the workflow was entirely manual: importing separate files, building joins, and reconciling inconsistencies between line identifiers in the fare system and those in the GTFS feed.
Demand data, published by the City of BH on the open data portal, arrives as CSV files with their own coordinate system and line codes. Without a dedicated tool, combining this data with GTFS required advanced GIS and programming skills β a high barrier for anyone who simply needed operational line analyses.
The Solution β Project Evolution
Research began as an undergraduate research initiative (PIBIC) at CEFET-MG (application filed in 2019), focused on building public transport analysis tools from open data.
Codebase structured as a PyQGIS plugin with a Qt Designer interface. Implemented a native GTFS reader (adapted from CTU GeoForAll Lab under GPL v2+), requiring no external dependencies beyond QGIS itself.
Project presented at CEFET-MG's Science and Technology Week, demonstrating the GTFS + demand integration and per-line load map generation.
Added automatic cluster-based categorization of demand segments with graduated styling, and PDF report generation with two maps β accumulated load and cluster grouping β overlaid on route geometry.
Key Features
GTFS import and validation: The plugin reads GTFS feeds directly from ZIP files, validates data integrity, and generates synthetic calendars when the feed lacks a `calendar.txt` file. Data is converted to GeoPackage with indexed spatial layers for efficient querying.
Per-stop demand integration: Loads the BHTrans boarding CSV and spatially links demand points to GTFS stops, restricted to each line's dominant service pattern to prevent false matches with nearby parallel routes.
Departure schedule by stop (horarios_paradas): When filtering a line, the plugin automatically generates a point layer with scheduled times for all trips on the selected route β `arrival_time`, `departure_time`, `stop_sequence`, `trip_id`, `shape_id`, and `direction_id` per stop. Built from a direct join in the GeoPackage database, this layer enables visualization of service distribution throughout the day.
Segment demand allocation (tramos_demanda): Generates a line layer with accumulated passenger load and trip count per segment for the selected time period. Load is calculated using flow conservation, producing an upper bound on actual occupancy β suitable for relative comparison across segments and time periods.
Hourly analysis: Analysis can be restricted to a specific hour (0h to 23h) or run for the full day, with automatic selection of the dominant route shape when a line operates multiple geometric variants.
PDF report with clustering: The current version generates a report with two maps β accumulated load and cluster-based segment grouping β with graduated styles applied automatically at the end of processing.
Technology Stack
Python PyQGIS GDAL GeoPackage / SQLite Qt Designer
Impact
The plugin eliminates the manual integration step between network data (GTFS) and demand data (fare system), letting transport engineers and researchers move directly to operational analysis. Applied to Belo Horizonte's bus network, SIG-Bus enables per-line load studies, identification of critical segments, and hourly passenger distribution analysis β all within QGIS, with no external dependencies.