SlideShare a Scribd company logo
Center for Urban Transportation Research | University of South Florida
Open Transit Data –
A Developer’s Perspective
Sean J. Barbeau, Ph.D.
2
Overview
• Why Open Data?
• Anatomy of Transit Data Sharing
• Being Developer-Friendly
3
WHY OPEN DATA?
4
What is open data?
• Transit data that is shared
with the public
– Typically shared via
website/FTP site/web
services
• No login should be required
(may use API key)
– Should be updated
regularly, with any changes
in schedule/routes/stops
5
Open [Data Architecture Source]
• Open architectures mostly focus on:
– Standards within an agency’s software/hardware systems
– Interconnectivity with other government systems
• Open source means software source code is available
• Open data is the sharing of data with external public
parties
3rd party
developers
OPEN DATA
Transit Agency
Transit Vehicle AVL Server
Schedule System
6
Why is open data important?
• Allows public to contribute
services that are cost/time-
prohibitive for the public sector
– e.g., many mobile platforms
• Vendors are unpredictable
– Some agencies have shared data
only with Google
– When Apple dropped Google
Maps, iPhone users lost transit
directions
– Apple relied on 3rd party apps to
fill the gap – only possible if open
data was available
7
Why is open data important
(to developers)?
• Developers want to create
innovative apps that meet a
need!
– Some are monetized, some are
not
• If you don’t provide open
data, developers will often
improvise
– …via website scraping, etc.
– Prone to breaking
– Not beneficial to agency or
rider
8
THE ANATOMY OF
TRANSIT DATA SHARING
© 1998 Nick Veasey
9
Two Types of Open Data
1. Static
– e.g., Transit schedules / routes /
stops
– Change only a few times a year
2. Real-time
– e.g., Estimated arrival times
/vehicle positions/service
alerts
– Can change every few seconds
10
Two Magnitudes of Open Data
A. “Fire hose”
– A dump of the complete state of the
transit system
– Not directly suitable for mobile devices
• Static -> All transit schedules/routes/stops
• Real-time -> All estimated arrivals/vehicle
positions/service alerts
B. “Faucet”
– Precise subset of transit data
– Suitable for mobile devices
• Static -> “Stop ID 10 is served by Route 5”
• Real-time -> “It is 2 minutes until Route 5
bus arrives at Stop ID 10”
11
Transit Data Flow Architecture
Producer
Aggregator/
Filter
Consumer
Open Data
(“Faucet”)
Open Data
(“Fire hose”)
12
Producer
Aggregator/
Filter
Commonly-used “fire hose” formats
Open Data
(“Firehose”)
General Transit
Feed Spec. (GTFS)
GTFS-realtime
- static - realtime
Service Interface for Real
time Information (SIRI)Transit Communications
Interface Profiles (TCIP)
Produce
r
Aggreg
ator/
Filter
Consume
r
GTFS/GTFS-realtime format - http://goo.gl/tmwv8
SIRI format – http://goo.gl/Vnpyv
TCIP format - http://goo.gl/vd6kY
13
Transit Data Flow Architecture
Producer
Aggregator/
Filter
Consumer
Open Data
(“Fire hose”)
Open Data
(“Faucet”)
14
Aggregator/
Filter
Consumer
Common “faucet” formats still emerging
Open Data
(“faucet”)
Vendor/Agency-
specific formats
Vendor/Agency-
specific formats
- static - realtime
SIRI
(REST/JSON format)
OneBusAway API
OneBusAway API
Produce
r
Aggreg
ator/
Filter
Consume
r
Vendor/Agency formats - http://goo.gl/NtNJ0
OneBusAway format - http://goo.gl/XXJyN
SIRI REST format - http://goo.gl/0PctT
15
Example – Google Transit
BART
Vehicles/Servers
Google
Servers
Google Transit
Mobile App
Static - GTFS
Realtime - GTFS-realtime Open to Public
16
Example – HART in Tampa, FL
HART
Vehicles/Servers
USF Server
USF
OneBusAway
Server
OneBusAway
3rd Party
mobile apps
Static & Real-time - OneBusAway APIStatic – GTFS (HART)
Realtime - GTFS-realtime (USF) More at http://goo.gl/iqHD2
17
Example – MTA BusTime in NY
MTA
Vehicles
MTA
BusTime
Servers
3rd Party
Mobile
Apps
Static - OneBusAway API
Real-time - SIRI REST API for mobile
Static - GTFS
18
Successful Open Data Formats Are…
• Organic
– Created and improved by the people actually
producing and consuming the data
• Open
– Open process for evolution
– Data/documentation not hidden behind log-ins
• Easy-to-use for app developers
– Is documentation simple to understand?
– Are there existing open-source software tools?
19
General Transit Feed Specification
(GTFS)
• Created by TriMet and Google in 2005
• Has become a de facto standard world-wide for
static transit schedule/route/stop data
GTFS data consists of multiple text files GTFS data powers Google Transit
and other apps
20
General Transit Feed Specification
(GTFS)
• Over 500 agencies worldwide have transit data in GTFS
format[1]
– 49 of top 50 largest U.S. transit agencies share GTFS data,
over 227 worldwide
– At least 20 Canadian agencies share open data
• Most agencies created GTFS data for Google Transit
– But, GTFS is open-data format used by web/mobile apps,
OpenTripPlanner, OneBusAway, etc.[2]
• See “GTFS Data Exchange” for list of agencies with GTFS
data
– http://www.gtfs-data-exchange.com/
– Or, ask your local agency
[1] City-Go-Round, http://www.citygoround.org/, Dec. 4, 2012
[2] For more GTFS info and references, see paper co-authored by Sean Barbeau and Aaron Antrim – “The Many Uses of GTFS Data” - http://goo.gl/asR96
21
BEING DEVELOPER-
FRIENDLY
Promoting app development with open data
22
Create a relationship with developers
• Open your GTFS data, and share
on GTFS-Data-Exchange!
– GTFS data should not be
password or login protected
• Share real-time data too
(national list pending)
• Create a “Developer page” with
access to resources (e.g., GTFS
license, data)
• Create developer email
list/group for
announcements/Q&A/collabora
tion
• Announce resources on “Transit
Developers” group[1]
HART Developer page -
http://www.gohart.org/developers/
[1] Transit Developers group, https://groups.google.com/forum/?fromgroups#!forum/transit-developers, Dec. 4th, 2012
23
Be Developer-Friendly!
• Use a simple “Terms of Service” based on
existing industry examples[1][2][3][4][5]
• Use GTFS naming conventions throughout
• “Direction_ID” is 0/1 (not N/S/E/W) in real-time data too!
• Make sure IDs match among datasets
– E.g., tripID in real-time data matches GTFS tripID
[1] TriMet “Terms of Use." http://developer.trimet.org/terms_of_use.shtml
[2] BART "Terms of Use." http://www.bart.gov/dev/schedules/license.htm
[3] Corona, CA "Terms of Use.” http://www.discovercorona.com/City-Departments/Public-
Works/Transportation/GTFS.aspx
[4] PSTA "Terms of Use.” http://www.psta.net/developers/License%20Agreement%20for%20App%20Devs.pdf
[5] HART "Terms of Use.” http://www.gohart.org/developers/terms_of_use.html
24
Be Developer-Friendly!
• Use developer/mobile-friendly formats
1. For data – GTFS, GTFS-realtime, SIRI REST API (see
MTA NY BusTime API[1])
2. For mobile APIs – RESTful web services design and
JSON encoding preferred (not SOAP and XML)
[1] MTA BusTime API, http://bustime.mta.info/wiki/Developers/SIRIIntro, Dec. 4th, 2012
POST /busstoparrival/busstopws.asmx HTTP/1.1
Host: 73.205.128.123
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/GetNextNVehicleArrivals"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetNextNVehicleArrivals xmlns="http://tempuri.org/">
<n>int</n>
<RouteID>int</RouteID>
<DirectionCodeID>int</DirectionCodeID>
<BusStopID>int</BusStopID>
<TripID_External>string</TripID_External>
</GetNextNVehicleArrivals>
</soap:Body>
</soap:Envelope>
SOAP Request
GET /busstoparrival/busstopws.asmx/ GetNextNVehicleArrivals?
n=string&RouteID=string&DirectionCodeID=string
&BusStopID=string&
TripID_External=string HTTP/1.1 Host: 73.205.128.123
HTTP-Post Request
<Siri xmlns:ns2="http://www.ifopt.org.uk/acsb"
xmlns:ns4="http://datex2.eu/schema/1_0/1_0"
xmlns:ns3="http://www.ifopt.org.uk/ifopt"
xmlns="http://www.siri.org.uk/siri"> <ServiceDelivery>
<ResponseTimestamp>2012-09-12T09:28:17.213-
04:00</ResponseTimestamp> <VehicleMonitoringDelivery>
<VehicleActivity> <MonitoredVehicleJourney> <LineRef>MTA
NYCT_S40</LineRef> <DirectionRef>0</DirectionRef>
<FramedVehicleJourneyRef> <DataFrameRef>2012-09-
12</DataFrameRef> <DatedVehicleJourneyRef>MTA
NYCT_20120902EE_054000_S40_0031_MISC_437</DatedVehicleJou
rneyRef> </FramedVehicleJourneyRef> <JourneyPatternRef>MTA
NYCT_S400031</JourneyPatternRef>
<PublishedLineName>S40</PublishedLineName>
<OperatorRef>MTA NYCT</OperatorRef> <OriginRef>MTA
NYCT_200001</OriginRef> </MonitoredVehicleJourney>
</VehicleActivity> </VehicleMonitoringDelivery> <ServiceDelivery>
</Siri>
XML Response
{ Siri: { ServiceDelivery: { ResponseTimestamp: "2012-08-
21T12:06:21.485-04:00", VehicleMonitoringDelivery: [ {
VehicleActivity: [ { MonitoredVehicleJourney: { LineRef: "MTA
NYCT_S40", DirectionRef: "0", FramedVehicleJourneyRef: {
DataFrameRef: "2012-08-21", DatedVehicleJourneyRef: "MTA
NYCT_20120701CC_072000_S40_0031_S4090_302" },
JourneyPatternRef: "MTA NYCT_S400031", PublishedLineName:
"S40", OperatorRef: "MTA NYCT", OriginRef: "MTA
NYCT_200001" } } ] } ] } }
JSON Response
• 1.8 times more
characters using XML!
• 3.7 times more
characters using SOAP!
25
25
7.02
12.68
16.76
19.37
9.44
17.77
18.62
24.01
0
5
10
15
20
25
30
4 15 30 60
BatteryLife(hours)
Interval Between Wireless Transmissions (s)
Using HTTP Increases Battery Life by 28% on Avg.
JAX-RPC HTTP-POSTSOAP
SOAP vs. HTTP
Motorola i580 phone -See http://goo.gl/hq6nE for details
26
0
2000
4000
6000
8000
10000
12000
14000
16000
18000
20000
Min. Max. Avg. 50th percentile68th percentile95th percentileStd dev.
ElapsedTime(ms)
JSON
XML
XML vs. JSON Parsing Time –
Samsung Galaxy S3
• ~4.3 times longer to
parse the first
response using XML
• First response time is
critical for mobile
apps, since
application state is
often destroyed when
user multitasks
(checks email, etc.) on
their phone
-Using Jackson 2.1.2
-Using MTA SIRI REST API StopMonitoring
-See http://goo.gl/EhYSl for details
27
Get the word out!
• After developers
have created
mobile
apps, share them
with riders
• Consider an “App
Center”[1-9] to
showcase apps [1] TriMet "TriMet App Center." http://trimet.org/apps/
[2] BART "Third Party Apps." http://www.bart.gov/schedules/appcenter/
[3] MTA "App Center." http://www.mta.info/apps/
[4] CTA "App Center." http://www.transitchicago.com/apps/
[5] GoTriangle. "App Center." http://www.gotriangle.org/developers/transit_apps
[6] HART "App Center." http://www.gohart.org/developers/appcenter.html
[7] MBTA "App Center." http://www.mbta.com/rider_tools/apps/
[8] KCATA "App Center." http://www.kcata.org/maps_schedules/app_center/
[9] UTA"App Center." http://developer.rideuta.com/DeveloperApps.aspx
28
Conclusions
• Open data (e.g., GTFS) makes transit apps possible
• Understand open [data vs. architecture vs. source]
• Understand the differences in data:
– Static vs. real-time
– “Fire hose” vs. “Faucet”
• Understand that certain formats are more appropriate
than others for certain situations (e.g., mobile)
• Being developer-friendly encourages mobile app
development!
29
Thanks!
Sean J. Barbeau, Ph.D.
barbeau@cutr.usf.edu
813.974.7208
Principal Mobile Software Architect for R&D
Center for Urban Transportation Research
University of South Florida
For more GTFS info and references, see paper co-authored by Sean Barbeau and Aaron Antrim – “The Many
Uses of GTFS Data” - http://goo.gl/asR96
30
Glossary
• API – Application Programming Interface
• AVL – Automatic Vehicle Location
• FTP – File Transfer Protocol
• GTFS – General Transit Feed Specification
• HTTP – HyperText Transfer Protocol
• IT – Information Technology
• JSON – Javascript Object Notation
• REST – Representational State Transfer
• SIRI -Service Interface for Real time Information
• TCIP - Transit Communications Interface Profiles
• XML – Extensible Markup Language

More Related Content

PDF
Best Practices in Qt Quick/QML - Part 1 of 4
 
PDF
[DSC DACH 23] The Modern Data Stack - Bogdan Pirvu
PDF
Funnel Analysis with Apache Spark and Druid
PPTX
C# Applications | C# Applications For Beginners | Building C# Applications | ...
PDF
Network visibility and control using industry standard sFlow telemetry
PPTX
ITS World Congress 2014 - Open Data in Public Transport: Challenges and Oppor...
PPTX
USF Travel Options App
PPTX
2015 Transportation Research Forum Webinar - Enabling Better Mobility Through...
Best Practices in Qt Quick/QML - Part 1 of 4
 
[DSC DACH 23] The Modern Data Stack - Bogdan Pirvu
Funnel Analysis with Apache Spark and Druid
C# Applications | C# Applications For Beginners | Building C# Applications | ...
Network visibility and control using industry standard sFlow telemetry
ITS World Congress 2014 - Open Data in Public Transport: Challenges and Oppor...
USF Travel Options App
2015 Transportation Research Forum Webinar - Enabling Better Mobility Through...

Viewers also liked (20)

PPTX
Adding New Agencies to OneBusAway Tampa
PPTX
GTFS Maintenance & More
PPTX
USF Maps App
PPTX
ITS World Congress 2014 - Performance Evaluation of Transit Data Formats on a...
PPTX
Barbeau enabling better mobility through innovations for mobile devices - o...
PPTX
Cell phones and GPS
PPTX
Energy Smart Apps - Location-aware algorithms to save energy on mobile devices
PPTX
2016 Commuter Choice Summit - TDM Technology Session
PPTX
Closing the Loop - Improving Transit through Crowd-sourced Information
PPTX
OneBusAway - New issue reporting flow in OneBusAway Android
PDF
Creating a GTFS and GTFS-RT with NMBS Data - #oSoc15
PPTX
Matching GTFS Transit Route Data to a Roadway Network for Travel Modeling
PPTX
CTAA 2016 Portland - Aaron Antrim - GTFS - What is it? Why does it matter?
PPTX
2014 FPTA-FDOT-CUTR Workshop - OneBusAway - Enhancing Customer Service via Mo...
PPTX
Using FME and GTFS datasets to run TransitDatabase.com
PPTX
OneBusAway - Issue reporting - Challenges and Improvements
PPTX
Opening the Door to Multimodal Applications - Creation, Maintenance, and Appl...
PDF
オープンデータが変える公共交通 〜新しいサービス・新しい利用促進〜 (IODD2015掛川会場 基調講演)
PPTX
A Location-Aware Architecture Supporting Intelligent Real-time Mobile Applica...
PPTX
2013 UTC Southeast - OneBusAway – Sharing real time transit information via o...
Adding New Agencies to OneBusAway Tampa
GTFS Maintenance & More
USF Maps App
ITS World Congress 2014 - Performance Evaluation of Transit Data Formats on a...
Barbeau enabling better mobility through innovations for mobile devices - o...
Cell phones and GPS
Energy Smart Apps - Location-aware algorithms to save energy on mobile devices
2016 Commuter Choice Summit - TDM Technology Session
Closing the Loop - Improving Transit through Crowd-sourced Information
OneBusAway - New issue reporting flow in OneBusAway Android
Creating a GTFS and GTFS-RT with NMBS Data - #oSoc15
Matching GTFS Transit Route Data to a Roadway Network for Travel Modeling
CTAA 2016 Portland - Aaron Antrim - GTFS - What is it? Why does it matter?
2014 FPTA-FDOT-CUTR Workshop - OneBusAway - Enhancing Customer Service via Mo...
Using FME and GTFS datasets to run TransitDatabase.com
OneBusAway - Issue reporting - Challenges and Improvements
Opening the Door to Multimodal Applications - Creation, Maintenance, and Appl...
オープンデータが変える公共交通 〜新しいサービス・新しい利用促進〜 (IODD2015掛川会場 基調講演)
A Location-Aware Architecture Supporting Intelligent Real-time Mobile Applica...
2013 UTC Southeast - OneBusAway – Sharing real time transit information via o...
Ad

Similar to APTA TransITech 2013 - "Open Transit Data - A Developers Perspective" (20)

PPTX
Open Transit Data - A Developer's Perspective
PPTX
NTI 2017 Workshop - Many Uses of GTFS Data
PPT
TriMet GTFS and WebServices 8-23-2008
PDF
The many-uses-of-gtfs-data-–-its-america-submission-abbreviated
PPTX
CUTR Webinar - Web-based Trip Planner Options for Transit Agencies
PDF
The Value of Open Data in Transport
PDF
Transit 2.0 - World Intelligent Transportation Systems Congress
PDF
OpenDataWeek Marseille 2013 : Andrew Byrd -- The General Transit Feed Specifi...
PDF
Portland TriMet Presentation On Data Sharing (Updated Version)
PPTX
GTFS Data Made Simple: A Practical Guide to Transit Feed Specification and Pe...
PPTX
Open Source Software in Public Transportation: A Case Study
PPSX
Cost Cutting through Information Systems: Using Google Transit as a Model
PDF
MassDOT Developers - Hackathon Presentation
PDF
MassDOT Developers - O'Reilly Media Webcast Presentation
PPTX
Why Open-source Software?
PDF
Better Faster Cheaper - How Outside Developers Can Help Transit Agencies Info...
PDF
ACT 2011 - Emerging Worksite Trip-Reduction Information Tools
PPTX
transitFinal
KEY
What Open Source and Open Data Mean for Tomorrow's Transportation Agencies
PPTX
TfGM Open data update - Transport
Open Transit Data - A Developer's Perspective
NTI 2017 Workshop - Many Uses of GTFS Data
TriMet GTFS and WebServices 8-23-2008
The many-uses-of-gtfs-data-–-its-america-submission-abbreviated
CUTR Webinar - Web-based Trip Planner Options for Transit Agencies
The Value of Open Data in Transport
Transit 2.0 - World Intelligent Transportation Systems Congress
OpenDataWeek Marseille 2013 : Andrew Byrd -- The General Transit Feed Specifi...
Portland TriMet Presentation On Data Sharing (Updated Version)
GTFS Data Made Simple: A Practical Guide to Transit Feed Specification and Pe...
Open Source Software in Public Transportation: A Case Study
Cost Cutting through Information Systems: Using Google Transit as a Model
MassDOT Developers - Hackathon Presentation
MassDOT Developers - O'Reilly Media Webcast Presentation
Why Open-source Software?
Better Faster Cheaper - How Outside Developers Can Help Transit Agencies Info...
ACT 2011 - Emerging Worksite Trip-Reduction Information Tools
transitFinal
What Open Source and Open Data Mean for Tomorrow's Transportation Agencies
TfGM Open data update - Transport
Ad

More from Sean Barbeau (13)

PPTX
Smart Columbus Executive Summary Overview
PDF
Open Source Software in Public Transportation: A Case Study - TRB poster
PPTX
OneBusAway Android - 2020 Update
PPTX
Improving the quality and cost effectiveness of multimodal travel behavior da...
PPTX
TRB 2020 - Cybersecurity Vulnerabilities in Mobile Fare Payment Applications:...
PPTX
2019 FPTA - Enhancing Cybersecurity in Public Transportation
PPTX
Work Zone Data Exchange (WZDx) format
PPTX
Enhancing Cybersecurity in Public Transportation
PPTX
OneBusAway - An open-source platform for Mobility as a Service
PPTX
Fare payment in OneBusAway
PPTX
Open-source Transit Software
PPTX
GTFS-realtime v2.0
PPTX
2017 SeeClickFix Workshop - Closing the Loop - Improving Transit through Crow...
Smart Columbus Executive Summary Overview
Open Source Software in Public Transportation: A Case Study - TRB poster
OneBusAway Android - 2020 Update
Improving the quality and cost effectiveness of multimodal travel behavior da...
TRB 2020 - Cybersecurity Vulnerabilities in Mobile Fare Payment Applications:...
2019 FPTA - Enhancing Cybersecurity in Public Transportation
Work Zone Data Exchange (WZDx) format
Enhancing Cybersecurity in Public Transportation
OneBusAway - An open-source platform for Mobility as a Service
Fare payment in OneBusAway
Open-source Transit Software
GTFS-realtime v2.0
2017 SeeClickFix Workshop - Closing the Loop - Improving Transit through Crow...

Recently uploaded (20)

PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Cloud computing and distributed systems.
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Empathic Computing: Creating Shared Understanding
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
Network Security Unit 5.pdf for BCA BBA.
Cloud computing and distributed systems.
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Programs and apps: productivity, graphics, security and other tools
NewMind AI Weekly Chronicles - August'25 Week I
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Per capita expenditure prediction using model stacking based on satellite ima...
Empathic Computing: Creating Shared Understanding
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
20250228 LYD VKU AI Blended-Learning.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Spectral efficient network and resource selection model in 5G networks
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Unlocking AI with Model Context Protocol (MCP)

APTA TransITech 2013 - "Open Transit Data - A Developers Perspective"

  • 1. Center for Urban Transportation Research | University of South Florida Open Transit Data – A Developer’s Perspective Sean J. Barbeau, Ph.D.
  • 2. 2 Overview • Why Open Data? • Anatomy of Transit Data Sharing • Being Developer-Friendly
  • 4. 4 What is open data? • Transit data that is shared with the public – Typically shared via website/FTP site/web services • No login should be required (may use API key) – Should be updated regularly, with any changes in schedule/routes/stops
  • 5. 5 Open [Data Architecture Source] • Open architectures mostly focus on: – Standards within an agency’s software/hardware systems – Interconnectivity with other government systems • Open source means software source code is available • Open data is the sharing of data with external public parties 3rd party developers OPEN DATA Transit Agency Transit Vehicle AVL Server Schedule System
  • 6. 6 Why is open data important? • Allows public to contribute services that are cost/time- prohibitive for the public sector – e.g., many mobile platforms • Vendors are unpredictable – Some agencies have shared data only with Google – When Apple dropped Google Maps, iPhone users lost transit directions – Apple relied on 3rd party apps to fill the gap – only possible if open data was available
  • 7. 7 Why is open data important (to developers)? • Developers want to create innovative apps that meet a need! – Some are monetized, some are not • If you don’t provide open data, developers will often improvise – …via website scraping, etc. – Prone to breaking – Not beneficial to agency or rider
  • 8. 8 THE ANATOMY OF TRANSIT DATA SHARING © 1998 Nick Veasey
  • 9. 9 Two Types of Open Data 1. Static – e.g., Transit schedules / routes / stops – Change only a few times a year 2. Real-time – e.g., Estimated arrival times /vehicle positions/service alerts – Can change every few seconds
  • 10. 10 Two Magnitudes of Open Data A. “Fire hose” – A dump of the complete state of the transit system – Not directly suitable for mobile devices • Static -> All transit schedules/routes/stops • Real-time -> All estimated arrivals/vehicle positions/service alerts B. “Faucet” – Precise subset of transit data – Suitable for mobile devices • Static -> “Stop ID 10 is served by Route 5” • Real-time -> “It is 2 minutes until Route 5 bus arrives at Stop ID 10”
  • 11. 11 Transit Data Flow Architecture Producer Aggregator/ Filter Consumer Open Data (“Faucet”) Open Data (“Fire hose”)
  • 12. 12 Producer Aggregator/ Filter Commonly-used “fire hose” formats Open Data (“Firehose”) General Transit Feed Spec. (GTFS) GTFS-realtime - static - realtime Service Interface for Real time Information (SIRI)Transit Communications Interface Profiles (TCIP) Produce r Aggreg ator/ Filter Consume r GTFS/GTFS-realtime format - http://goo.gl/tmwv8 SIRI format – http://goo.gl/Vnpyv TCIP format - http://goo.gl/vd6kY
  • 13. 13 Transit Data Flow Architecture Producer Aggregator/ Filter Consumer Open Data (“Fire hose”) Open Data (“Faucet”)
  • 14. 14 Aggregator/ Filter Consumer Common “faucet” formats still emerging Open Data (“faucet”) Vendor/Agency- specific formats Vendor/Agency- specific formats - static - realtime SIRI (REST/JSON format) OneBusAway API OneBusAway API Produce r Aggreg ator/ Filter Consume r Vendor/Agency formats - http://goo.gl/NtNJ0 OneBusAway format - http://goo.gl/XXJyN SIRI REST format - http://goo.gl/0PctT
  • 15. 15 Example – Google Transit BART Vehicles/Servers Google Servers Google Transit Mobile App Static - GTFS Realtime - GTFS-realtime Open to Public
  • 16. 16 Example – HART in Tampa, FL HART Vehicles/Servers USF Server USF OneBusAway Server OneBusAway 3rd Party mobile apps Static & Real-time - OneBusAway APIStatic – GTFS (HART) Realtime - GTFS-realtime (USF) More at http://goo.gl/iqHD2
  • 17. 17 Example – MTA BusTime in NY MTA Vehicles MTA BusTime Servers 3rd Party Mobile Apps Static - OneBusAway API Real-time - SIRI REST API for mobile Static - GTFS
  • 18. 18 Successful Open Data Formats Are… • Organic – Created and improved by the people actually producing and consuming the data • Open – Open process for evolution – Data/documentation not hidden behind log-ins • Easy-to-use for app developers – Is documentation simple to understand? – Are there existing open-source software tools?
  • 19. 19 General Transit Feed Specification (GTFS) • Created by TriMet and Google in 2005 • Has become a de facto standard world-wide for static transit schedule/route/stop data GTFS data consists of multiple text files GTFS data powers Google Transit and other apps
  • 20. 20 General Transit Feed Specification (GTFS) • Over 500 agencies worldwide have transit data in GTFS format[1] – 49 of top 50 largest U.S. transit agencies share GTFS data, over 227 worldwide – At least 20 Canadian agencies share open data • Most agencies created GTFS data for Google Transit – But, GTFS is open-data format used by web/mobile apps, OpenTripPlanner, OneBusAway, etc.[2] • See “GTFS Data Exchange” for list of agencies with GTFS data – http://www.gtfs-data-exchange.com/ – Or, ask your local agency [1] City-Go-Round, http://www.citygoround.org/, Dec. 4, 2012 [2] For more GTFS info and references, see paper co-authored by Sean Barbeau and Aaron Antrim – “The Many Uses of GTFS Data” - http://goo.gl/asR96
  • 21. 21 BEING DEVELOPER- FRIENDLY Promoting app development with open data
  • 22. 22 Create a relationship with developers • Open your GTFS data, and share on GTFS-Data-Exchange! – GTFS data should not be password or login protected • Share real-time data too (national list pending) • Create a “Developer page” with access to resources (e.g., GTFS license, data) • Create developer email list/group for announcements/Q&A/collabora tion • Announce resources on “Transit Developers” group[1] HART Developer page - http://www.gohart.org/developers/ [1] Transit Developers group, https://groups.google.com/forum/?fromgroups#!forum/transit-developers, Dec. 4th, 2012
  • 23. 23 Be Developer-Friendly! • Use a simple “Terms of Service” based on existing industry examples[1][2][3][4][5] • Use GTFS naming conventions throughout • “Direction_ID” is 0/1 (not N/S/E/W) in real-time data too! • Make sure IDs match among datasets – E.g., tripID in real-time data matches GTFS tripID [1] TriMet “Terms of Use." http://developer.trimet.org/terms_of_use.shtml [2] BART "Terms of Use." http://www.bart.gov/dev/schedules/license.htm [3] Corona, CA "Terms of Use.” http://www.discovercorona.com/City-Departments/Public- Works/Transportation/GTFS.aspx [4] PSTA "Terms of Use.” http://www.psta.net/developers/License%20Agreement%20for%20App%20Devs.pdf [5] HART "Terms of Use.” http://www.gohart.org/developers/terms_of_use.html
  • 24. 24 Be Developer-Friendly! • Use developer/mobile-friendly formats 1. For data – GTFS, GTFS-realtime, SIRI REST API (see MTA NY BusTime API[1]) 2. For mobile APIs – RESTful web services design and JSON encoding preferred (not SOAP and XML) [1] MTA BusTime API, http://bustime.mta.info/wiki/Developers/SIRIIntro, Dec. 4th, 2012 POST /busstoparrival/busstopws.asmx HTTP/1.1 Host: 73.205.128.123 Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://tempuri.org/GetNextNVehicleArrivals" <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <GetNextNVehicleArrivals xmlns="http://tempuri.org/"> <n>int</n> <RouteID>int</RouteID> <DirectionCodeID>int</DirectionCodeID> <BusStopID>int</BusStopID> <TripID_External>string</TripID_External> </GetNextNVehicleArrivals> </soap:Body> </soap:Envelope> SOAP Request GET /busstoparrival/busstopws.asmx/ GetNextNVehicleArrivals? n=string&RouteID=string&DirectionCodeID=string &BusStopID=string& TripID_External=string HTTP/1.1 Host: 73.205.128.123 HTTP-Post Request <Siri xmlns:ns2="http://www.ifopt.org.uk/acsb" xmlns:ns4="http://datex2.eu/schema/1_0/1_0" xmlns:ns3="http://www.ifopt.org.uk/ifopt" xmlns="http://www.siri.org.uk/siri"> <ServiceDelivery> <ResponseTimestamp>2012-09-12T09:28:17.213- 04:00</ResponseTimestamp> <VehicleMonitoringDelivery> <VehicleActivity> <MonitoredVehicleJourney> <LineRef>MTA NYCT_S40</LineRef> <DirectionRef>0</DirectionRef> <FramedVehicleJourneyRef> <DataFrameRef>2012-09- 12</DataFrameRef> <DatedVehicleJourneyRef>MTA NYCT_20120902EE_054000_S40_0031_MISC_437</DatedVehicleJou rneyRef> </FramedVehicleJourneyRef> <JourneyPatternRef>MTA NYCT_S400031</JourneyPatternRef> <PublishedLineName>S40</PublishedLineName> <OperatorRef>MTA NYCT</OperatorRef> <OriginRef>MTA NYCT_200001</OriginRef> </MonitoredVehicleJourney> </VehicleActivity> </VehicleMonitoringDelivery> <ServiceDelivery> </Siri> XML Response { Siri: { ServiceDelivery: { ResponseTimestamp: "2012-08- 21T12:06:21.485-04:00", VehicleMonitoringDelivery: [ { VehicleActivity: [ { MonitoredVehicleJourney: { LineRef: "MTA NYCT_S40", DirectionRef: "0", FramedVehicleJourneyRef: { DataFrameRef: "2012-08-21", DatedVehicleJourneyRef: "MTA NYCT_20120701CC_072000_S40_0031_S4090_302" }, JourneyPatternRef: "MTA NYCT_S400031", PublishedLineName: "S40", OperatorRef: "MTA NYCT", OriginRef: "MTA NYCT_200001" } } ] } ] } } JSON Response • 1.8 times more characters using XML! • 3.7 times more characters using SOAP!
  • 25. 25 25 7.02 12.68 16.76 19.37 9.44 17.77 18.62 24.01 0 5 10 15 20 25 30 4 15 30 60 BatteryLife(hours) Interval Between Wireless Transmissions (s) Using HTTP Increases Battery Life by 28% on Avg. JAX-RPC HTTP-POSTSOAP SOAP vs. HTTP Motorola i580 phone -See http://goo.gl/hq6nE for details
  • 26. 26 0 2000 4000 6000 8000 10000 12000 14000 16000 18000 20000 Min. Max. Avg. 50th percentile68th percentile95th percentileStd dev. ElapsedTime(ms) JSON XML XML vs. JSON Parsing Time – Samsung Galaxy S3 • ~4.3 times longer to parse the first response using XML • First response time is critical for mobile apps, since application state is often destroyed when user multitasks (checks email, etc.) on their phone -Using Jackson 2.1.2 -Using MTA SIRI REST API StopMonitoring -See http://goo.gl/EhYSl for details
  • 27. 27 Get the word out! • After developers have created mobile apps, share them with riders • Consider an “App Center”[1-9] to showcase apps [1] TriMet "TriMet App Center." http://trimet.org/apps/ [2] BART "Third Party Apps." http://www.bart.gov/schedules/appcenter/ [3] MTA "App Center." http://www.mta.info/apps/ [4] CTA "App Center." http://www.transitchicago.com/apps/ [5] GoTriangle. "App Center." http://www.gotriangle.org/developers/transit_apps [6] HART "App Center." http://www.gohart.org/developers/appcenter.html [7] MBTA "App Center." http://www.mbta.com/rider_tools/apps/ [8] KCATA "App Center." http://www.kcata.org/maps_schedules/app_center/ [9] UTA"App Center." http://developer.rideuta.com/DeveloperApps.aspx
  • 28. 28 Conclusions • Open data (e.g., GTFS) makes transit apps possible • Understand open [data vs. architecture vs. source] • Understand the differences in data: – Static vs. real-time – “Fire hose” vs. “Faucet” • Understand that certain formats are more appropriate than others for certain situations (e.g., mobile) • Being developer-friendly encourages mobile app development!
  • 29. 29 Thanks! Sean J. Barbeau, Ph.D. barbeau@cutr.usf.edu 813.974.7208 Principal Mobile Software Architect for R&D Center for Urban Transportation Research University of South Florida For more GTFS info and references, see paper co-authored by Sean Barbeau and Aaron Antrim – “The Many Uses of GTFS Data” - http://goo.gl/asR96
  • 30. 30 Glossary • API – Application Programming Interface • AVL – Automatic Vehicle Location • FTP – File Transfer Protocol • GTFS – General Transit Feed Specification • HTTP – HyperText Transfer Protocol • IT – Information Technology • JSON – Javascript Object Notation • REST – Representational State Transfer • SIRI -Service Interface for Real time Information • TCIP - Transit Communications Interface Profiles • XML – Extensible Markup Language