exploring uk bus and train data with transportapi
DESCRIPTION
Harry Wood, Software Engineer, TransportAPI.com TransportAPI provides UK public transport data with live and timetable information for bus, train, and tube, available to developers through an easy to use API. UK transport data is a complex and shifting landscape. In this workshop we'll talk through some of the challenges we're facing, and how we're working to solve them to take the pain away for developers (inviting more feedback and suggestions from the API community!). We'll look at the resulting API and a tour of the different data offered, some examples of how it might be used, and some bespoke work we're doing for clients. - See more at: http://www.apiconuk.com/apiconukschedule#sthash.gdIvEBWy.dpufTRANSCRIPT
Exploring UK bus and train data with...
transportapi.com
developer.transportapi.com
Origins
● Maps and geodata● OpenStreetMap● Geo-academics● Open Data
Open Data Mapping Experiments
Transport!
Info screensWeb appsMobile apps Demand for data
● Bite-sized chunks● Nicely formatted● Taming complexity
Ruby on Rails
● RESTful URLs● Model/View/Controller● ActiveRecord
...an API for transport?
From
To
Go!
A
B
“journey planning”
Buses, Trains, Tube
Timetable and Live
Matrix
Bus
Train
Tube
Timetable Live
Reference data
● Stops● Routes● Latitude, Longitude● Codes / IDs● Names (human)
Matrix
Bus
Train
Tube
Timetable Live
Another column
Reference Data
History
● Live data changes recorded over time● Another column?
Matrix
Bus
Train
Tube
Timetable LiveReference
Data
But not just history of live...
History
Matrix
Bus
Train
Tube
Timetable LiveReference
Data
Journey Planning?
● Another column? Not really● Drawing together data from different modes
Matrix
Bus
Train
Tube
Timetable LiveReference
Data
Journey Planning
Matrix
Bus
Train
Tube
Timetable LiveReference
Data
Journey Planning
✓Train
✓ ✓✓ ✓ ✓
✓ ✓ ✓✓
✓
✓✓
Open Data Availability?
Bus
Train
Tube
Timetable LiveReference
Data
Journey Planning
Tube
Tube lines
transportapi.com/v3/uk/tube/lines.json
Stations on the Circle line
transportapi.com/v3/uk/tube/circle.json
.html
transportapi.com/v3/uk/tube/lines.html
Tube live departures
“HTML API”
● Ruby on rails encourages● Stripped down HTML● “HTML API”
HTML navigation
● <a href='xxx'> links● Navigation menus
● Fixed website structure● Not flexible building blocks
Tube performanceplatform indicators
Tube performance24 hour clock diagrams
API key & App ID
developer.transportapi.com sign up
3scale hit tracking
tube-radar.com
Bus
near.json & bbox
transportapi.com/v3/uk/bus/stops/near
live bus at a stop
transportapi.com/v3/uk/bus/stop/490005646E/live
timetables● timetabled departures● matching the format of live
route line display
Grid Timetables
operators
Many operators
Operator codes inconsistent
1500 different bus operators
Bus data behind the scenes
Operators → Councils → Traveline regions → TNDS
TransXchange
TransXchange
TransXchange
Live bus feeds
● TfL for London● Patchy elsewhere from Traveline● Mismatched operators● Fallback to timetable
tapi.mobi
Trains
ATOC
National RailNetwork Rail
Department For Transport
TOCs
ORR
Passenger Focus
£5bn tax / year
Train Organisations (and politics)
Layers of train data● Schedules
● VSTP
● Train movements feed
● Activation messages
Live train departurestransportapi.com/v3/uk/train/station/CLJ/live
train-radar.com
Journey planning
Traveline / TfL “MDV”● XML → Restful JSON● Geocoding – alternative
matches. StopIDs
TfL and Traveline "MDV"
● XML → Restful JSON● Geocoding – alternative matches. StopIDs
transportapi.com/v3/uk/public/journey/from/postcode:EC2A+4JE/to/lonlat:-0.13155,51.52798.json
journeymapper.org
car and cycle routing
cyclestreets.net
OSRM car routes
roadworks.orgtdf.roadworks.org
widgets
'UK TravelOptions' iOS app
'Tree Routes' iOS app
Taxi Booking iOS app
transportbuzz.com
Heathrow Airport info screens
IKEA info screens
TransportAPI “instance”
● Branding “white labeling” of TransportAPI● Cloud Servers – Chef deployed● Flexible traffic handling/restrictions
new unified web interfacehandlebars, grunt, and bower
transportapi.js
Thank you
harry.wood transportapi.com
API
OpenStreetMap
Planet downloads
NominatimXAPI
Editors
Contributors
Extracts & conversions
Tile servers
API