Data drop – Cycling in the City

We recently made available the route data for all our current Cycle Superhighways and the new Quietway 1 so developers can accurately map the existing cycle network in their apps, making it easier for cyclists to find and use these routes. The data will be regularly updated as more Cycle Superhighways and Quietways are completed in the coming years.

The promotion of these cycling routes is part of the delivery of the Mayor’s new blueprint for a healthy London, which will see increasing physical activity put at the centre of a wide range of GLA and TfL policy, setting out how it could transform the lives of millions of Londoners.  The new route data complements the extensive data we already provide on cycling in our API and as downloadable files. Here’s an overview of what’s available.

A Santander Cycles docking station: The promotion of cycling routes is part of the delivery of the Mayor’s new blueprint for a healthy London.

A Hire Power

Let’s start with our iconic Santander cycle hire service.

First we’ll have a look at the information we have on our website to help you find a cycle hire bike. Want to find your nearest cycle hire docking stations?

Here’s the closest cycle hire docking stations or bikepoints for the area surrounding St. James’s Park.
pic2

Click on a bike point to see how many bikes and spaces are available:

pic3

So what’s going on behind the scenes to get this data? Clicking on the bike point itself triggers this API call:

https://api.tfl.gov.uk/BikePoint?swLat=51.4953&swLon=-0.1369&neLat=51.5011&neLon=-0.1274

This does a lat/long lookup of stations within a surrounding area.

To visualize these boundaries, I’ve created a fiddle to show the area the data points are restricted to. See for yourself and perhaps modify the boundaries to provide bike points in an area you’re familiar with. http://jsfiddle.net/b03k8ewa/

The JSON returned looks like this with the other nearby points collapsed and only showing the one we’re interested in:

pic4

This is BikePoint_108. Let’s explore the additionalProperties array for more details.

pic5

Here is a table containing all the properties available:

Key Value
TerminalName 003429
Installed true
Locked false
InstallDate 1279107720000
RemovalDate
Temporary False
NbBikes 21
NbEmptyDocks 8
NbDocks 29

InstallDate is stored in Epoch format, so JavaScripts’ new Date(<number>) will resolve the correct date.

I’ve created another JSFiddle demonstrating how this data can be used, utilising the /bikepoint/search endpoint, and processing the search results to discover the additionalProperties from the resultant url attribute. Have a look here: http://jsfiddle.net/7e1hxbqg/

Pull Up The Routes

We also make our cycle route data from Journey Planner available as open data. This allows you to generate cycle routes that are easy, moderate or fast and allows users to choose between cycling the whole route, leaving their bike at a station, taking their bike on public transport or using the Santander cycle hire service. This data is available in the /Journey endpoint.

Try this URL:

https://api.tfl.gov.uk/Journey/JourneyResults/51.503117,-0.15352/to/1000050?AccessibilityPreference=norequirements&CyclePreference=CycleHire&Date=20170330&JourneyPreference=leasttime&MaxWalkingMinutes=40&numberOfTrips=3&Mode=cycle&NationalSearch=False&Time=1245&TimeIs=Departing&WalkingOnly=False&IsExternalWidget=False&WalkingSpeed=average&bikeProficiency=easy,moderate,fast&alternativewalking=true&WalkingOptimization=False&app_id=8268063a&app_key=14f7f5ff5d64df2e88701cef2049c804

This is the route data used to generate this page:

pic6

Supersonic

As we’ve already mentioned, route data for all our current Cycle Superhighways (CS) and the first Quietway route (Quietway 1) is now available in KMZ and shapefile.

The data contains Ordnance Survey TOID references, route names and labels to make it easier for you to use this data to display Cycle Superhighway and Quietway routes in your apps.

Some of the routes contain hand-drawn links therefore TOID = NULL. The geometry is copied from OSITN and OS Urban Paths datasets which both provide a TOID reference. Routes have been smoothed to remove traffic islands where these were identified in the OSITN nature attribute.

Here’s what the KMZ looks like once it’s imported into Google Maps.

pic7

Parking Lot

 Some of our tube stations have secure cycle parking. The stations with cycle parking can be found in the /Place endpoint using the PlaceType “CyclePark”.

You can search by geographical area or search for nearest within a given distance of a point.

Let’s Go Trippin’

Data for all Santander Cycle Hire trips by week since September 2015 can be found at cycling.data.tfl.gov.uk.

The journey information includes:

  • Journey ID
  • Bike ID
  • Start date
  • Start time
  • End date
  • End time
  • Start docking station
  • Start docking station ID
  • End docking station
  • End docking station ID

 This data has been used extensively to create some very cool visualisations of cycle hire journeys like this one by Sociable Physics and Oliver O’Brien.

pic8

Tell us what you think

We encourage the community to provide feedback on our new data sets to help us continue to enhance and improve our open data products. Please let us know your thoughts in the comments section below.