Velo-City Preview

[Updated] I’ll be presenting at Velo-City in Vancouver later this week. Velo-City is the “world’s premier cycling planning conference”. It is likely to have a significant bike-sharing flavour – the lead sponsor being PBSC which designed the 6000-odd “Boris Bikes” (aka Barclays Cycle Hire bikes) that are a distinctive sight in central London, as well as equivalent systems in Montreal, Washington DC, Minneapolis, Boston and (shortly) New York City – known generically as Bixi bikes. Vancouver does not have a bike-sharing system of its own, but PBSC have imported a whole load of their Montreal bikes for delegates to borrow for the week, although a recent collar-bone break means I unfortunately won’t be taking up the offer. I did however spot a PBSC/Bixi bike “in the wild” in Vancouver’s beautiful Stanley Park – see above.

I’ll be talking about some new insights into bike-sharing cities worldwide that have been revealed by my Bike Share Map, as part of a three-part presentation on looking at bike-sharing cities at different scales – my co-presenters being the author of the Bike Sharing World Map, and the software developer behind the B-Cycle bike sharing systems.

My presentation is on Wednesday morning (Pacific time) and I’ll write/tweet about it on the day, wifi-access permitting.

To prepare for the presentation, I’ve added a few new cities to the Bike Share Map: Suzhou, Zhongshan, Wujiang, Shaoxing and Heihe in China; and Kanazawa in Japan. One early insight coming from these new maps could be that the Chinese really do work hard (if you excuse the gross overgeneralisation) – typically 11 hours between morning and evening commuter peaks, and seven days a week!

Hehei is shown below – it’s right on the Russian border, opposite a much larger Russian city – hence the Cyrillic (although no bridges across the river near there!)

Note that, in the maps of the Chinese systems, the docking station locations are slightly misaligned with the background maps because of location obfuscation carried out by that country – I’m using OpenLayers rather than the Chinese-based map service that corrects for the errors. The resulting offset is typically only 1-400m though so you can still get a good idea of the shape and size of each system.

CityDashboard – the API

Here is the API documentation for CityDashboard. It’s really not a very advanced API, and it’s not delivered in a “proper” format (e.g. XML or JSON), instead it’s available as a number of CSV/TXT-formatted files. It ain’t pretty but it works!

I’ve put together this documentation as a number of people have asked. However, it should still be considered to be a “private” API, so could change or break at any time, for one of three likely reasons:

  • I make a change to the API structure. If it’s a big change, I will attempt to preserve the old structure, possibly by using an extra parameter (e.g. &v=2) to indicate the new one.
  • Our server goes down. Certainly not inconceivable!
  • One of the upstream data providers changes their feed format in such a way that it causes the CityDashboard data to freeze up. Again, quite likely, particularly as generally I don’t have a formal agreement with the upstream organisations.

1. Finding the cities available

The list of cities available can be found at:
http://citydashboard.org/cities.txt

Notes:

  • Comma-separated.
  • The city_id is the first field of each line.
  • Ignore lines starting with #.

2. Finding the modules available for a city

The list of modules available for london can be found at:
http://citydashboard.org/cities/[city_id].txt

Notes:

  • Comma-separated.
  • The module_id is the first field of each line.
  • Ignore lines starting with #.

3. Getting the data for each module

The data for each module can be found at:
http://citydashboard.org/modules/[module_id].php?city=[city_id]&format=[csv|html|blob]

Example:
http://citydashboard.org/modules/weather_cr.php?city=london&format=csv

Notes:

  • Comma-separated or HTML, depending on the format parameter you use.
  • Ignore lines starting with #.
  • The CSV format will be most useful, as the HTML and “blob” formats are specifically designed for the CityDashboard website. However, many of the modules don’t (yet) have a CSV format feed available – a blank page will instead be returned.
  • The first line in each CSV file contains a number in the second field. This is the number of seconds between each update. i.e if this is 5, then the file won’t update more than once every 5 seconds.
  • Modules which have a CSV feed for them, have an “m” included in the sixth field in the appropriate row in the london.txt file (typical values, d, db, dbm etc)

By the way, the module list will most likely be changing very soon to add a couple of important fields that I overlooked – first of all, the source URL will be in a field of its own, and secondly I will add in a proper attribution statement for each source.