pages.knowledge_base.page_title

pages.knowledge_base.page_subtitle

pages.knowledge_base.quick_navigation

pages.knowledge_base.understanding_gtfs

pages.knowledge_base.what_is_gtfs

pages.knowledge_base.what_is_gtfs_desc

pages.knowledge_base.gtfs_consists_of

  • pages.knowledge_base.static_data pages.knowledge_base.static_data_desc
  • pages.knowledge_base.realtime_data pages.knowledge_base.realtime_data_desc

pages.knowledge_base.gtfs_file_structure

pages.knowledge_base.gtfs_file_structure_desc

gtfs.zip β”œβ”€β”€ agency.txt # Transit agencies β”œβ”€β”€ routes.txt # Transit routes β”œβ”€β”€ trips.txt # Individual trips β”œβ”€β”€ stops.txt # Transit stops β”œβ”€β”€ stop_times.txt # Stop times for trips β”œβ”€β”€ calendar.txt # Service patterns β”œβ”€β”€ calendar_dates.txt # Service exceptions └── shapes.txt # Route geometry

pages.knowledge_base.working_with_gtfs

pages.knowledge_base.essential_files

  • agency.txt: Information about transit agencies
  • stops.txt: Individual stops/stations with coordinates
  • routes.txt: Transit routes (bus lines, train routes)
  • trips.txt: Individual journeys along routes
  • stop_times.txt: Times when vehicles arrive/depart stops

pages.knowledge_base.optional_files

  • calendar.txt: Service days for routes
  • shapes.txt: Route paths for mapping
  • fare_attributes.txt: Fare information
  • transfers.txt: Transfer rules between routes

pages.knowledge_base.api_docs_title

pages.knowledge_base.gtfs_static_api

pages.knowledge_base.gtfs_static_api_desc

GET https://opendata-discovery-gtfs-static.api.production.belgianmobility.io/api/gtfs/feed/delijn/static GET https://datasets.api.production.belgianmobility.io/api/datasets-static/gtfs GET https://opendata-discovery-gtfs-static.api.production.belgianmobility.io/api/gtfs/feed/tec/static GET https://opendata-discovery-gtfs-static.api.production.belgianmobility.io/api/gtfs/feed/nmbssncb/static

pages.knowledge_base.returns_zip

pages.knowledge_base.gtfs_realtime_api

pages.knowledge_base.gtfs_realtime_api_desc

GET https://opendata-discovery-gtfs-realtime.api.production.belgianmobility.io/api/gtfs-rt/{agencyId}/TripUpdates.pbf GET https://opendata-discovery-gtfs-realtime.api.production.belgianmobility.io/api/gtfs-rt/{agencyId}/ServiceAlerts.pbf # Agency IDs: nmbssncb, tec, delijn # Note: STIB-MIVB does not produce GTFS-RT feeds

pages.knowledge_base.returns_protobuf

pages.knowledge_base.stib_specific_apis

pages.knowledge_base.stib_specific_desc

GET /api/stib/waiting-times GET /api/stib/vehicle-positions GET /api/stib/messages

pages.knowledge_base.returns_json

pages.knowledge_base.data_quality_title

pages.knowledge_base.our_pipeline

pages.knowledge_base.our_pipeline_desc

pages.knowledge_base.validation_steps

  • GTFS format compliance checking
  • Geographic coordinate validation
  • Schedule consistency verification
  • Stop name and ID standardization

pages.knowledge_base.data_enhancements

  • Route shape optimization
  • Multi-language support
  • Accessibility information
  • Cross-operator transfer rules

pages.knowledge_base.best_practices_title

  • β€’ pages.knowledge_base.best_practices.0
  • β€’ pages.knowledge_base.best_practices.1
  • β€’ pages.knowledge_base.best_practices.2
  • β€’ pages.knowledge_base.best_practices.3

pages.knowledge_base.code_samples_title

pages.knowledge_base.python_example

pages.knowledge_base.python_desc

import requests import zipfile import pandas as pd from io import BytesIO # Download GTFS data def download_gtfs(operator='tec'): url = f"https://opendata-discovery-gtfs-static.api.production.belgianmobility.io/api/gtfs/feed/{operator}/static" response = requests.get(url) if response.status_code == 200: return zipfile.ZipFile(BytesIO(response.content)) else: raise Exception(f"Failed to download: {response.status_code}") # Extract and read stops gtfs_zip = download_gtfs('tec') stops_df = pd.read_csv(gtfs_zip.open('stops.txt')) print(f"Found {len(stops_df)} stops") print(stops_df.head())

pages.knowledge_base.js_example

pages.knowledge_base.js_desc

// Fetch real-time vehicle positions async function getVehiclePositions() { try { const response = await fetch('/api/gtfs-rt/vehicle-positions'); const data = await response.arrayBuffer(); // Parse Protocol Buffer data (requires protobuf.js) const feed = gtfs.transit_realtime.FeedMessage.decode( new Uint8Array(data) ); return feed.entity.map(entity => ({ vehicleId: entity.vehicle.vehicle.id, routeId: entity.vehicle.trip.routeId, latitude: entity.vehicle.position.latitude, longitude: entity.vehicle.position.longitude, timestamp: entity.vehicle.timestamp })); } catch (error) { console.error('Error fetching vehicle positions:', error); return []; } } // Update map markers getVehiclePositions().then(vehicles => { vehicles.forEach(vehicle => { updateMapMarker(vehicle); }); });

pages.knowledge_base.curl_example

pages.knowledge_base.curl_desc

# Download GTFS static data curl -O "https://datasets.api.production.belgianmobility.io/api/datasets-static/gtfs" # Get real-time trip updates curl "https://opendata-discovery-gtfs-rt.api.production.belgianmobility.io/api/gtfs/feed/tec/rt/trip-updates.pbf" \ -H "Accept: application/x-protobuf" # Get STIB waiting times (JSON) curl "https://datasets.api.production.belgianmobility.io/api/datasets/WaitingTimes.json" \ -H "Accept: application/json"

pages.knowledge_base.need_more_help

pages.knowledge_base.need_more_help_desc