STREAMING DATA FEED SHOWS RIDERS WHERE THEIR BUS IS IN REAL-TIME

The Central Ohio Transit Authority is the region's public transportation leader, with nearly 19 million passenger trips in 2017. For many residents, the COTA bus is their ride to work, to school, to the doctor or to the grocery store. COTA was named Outstanding Public Transportation System among midsize agencies in 2018 by the American Public Transportation Association. Innovation was one of the qualities that earned it this distinction, and technology played no small role. One of COTA's recent advancements was the introduction of real-time bus GPS data, which debuted in the Transit App in 2016. COTA shares this data with the Smart Columbus Operating System, and for the first time riders can now see all buses in the vicinity on a map visualization.

beep beep

The new bus visualization takes COTA's current streaming data and uses it in new ways that create value for riders. A streaming map feed displays every bus's current location and the direction it is moving. While individual bus location information is available on Transit App and in Google and Apple maps, with this tool, riders can see all buses in a given geographic area. Spending less time waiting at the bus stop improves rider experience and increases the likelihood they will choose the bus, decreasing congestion on the roadways and reducing carbon emissions.

View the Map

cota_map.png
cota_map_mobile.png

How Real Time Bus Information Helps Sarah Get Around Columbus

Sarah Abernathy*

persona.png
Neighborhood

Clintonville

Profession

Finance Manager at Chase

Age
32
*fictionalization

Sarah is in downtown Columbus leaving a doctor’s appointment. She used a ride-sharing service to get to the appointment but is wondering if it might be easier and less expensive to jump on a COTA bus to get back to Clintonville. She looks up the Smart Columbus Operating System live data stream of COTA bus locations on her phone and sees there is a Line 2 bus heading north on High Street nearby. With the knowledge that the bus is right there, Sarah is more likely to ride the bus home. The real-time feature creates a more connected environment, encouraging transit use, which improves Central Ohio’s air quality and reduces congestion.

About The Data

This data uses a modified GTFS standard to provide near real time locations for COTA buses. A link to the standard can be found here: https://developers.google.com/transit/gtfs/reference/

Websocket

URL: wss://streaming.smartcolumbusos.com/socket/websocket

Sample Code

Node JS Example using ws library
const WebSocket = require('ws');
const ws = new WebSocket('wss://streaming.smartcolumbusos.com/socket/websocket');
ws.on('open', function open() {
  let joinMesage = {
    "topic": "vehicle_position",
    "event": "phx_join",
    "payload": {},
    "ref": 1
  }
  console.log('starting listener');
  ws.send(JSON.stringify(joinMesage));
});
ws.on('message', function incoming(data) { console.log(data); }); // ping the server every 30 seconds to let it know we're still here
setInterval(function ping() {
  let heartbeat = {
    "topic": "phoenix",
    "event": "heartbeat",
    "payload": {},
    "ref": 1
  };
  ws.send(JSON.stringify(heartbeat))
}, 30000)
Example using WSTA on a terminal

wsta -I --ping 50 --ping-msg '{"topic":"phoenix","event":"heartbeat","payload":{},"ref":"1"}' 'wss://streaming.smartcolumbusos.com/socket/websocket' '{"topic":"vehicle_position","event":"phx_join","payload":{},"ref":"1"}'

Image