Two years of Velib data

Posted on September 08, 2017 in OpenData • 2 min read

About two years ago, I decided to dump on a very regular basis all the available data from the Velib API. Velib is the bike sharing system in Paris, and the API exposes a list of stations as well as their respective occupancy (free stands, available bikes in near realtime). I dumped the data every few minutes, and served dumps.

When I started doing it, I did not have any particular project in mind with this data. I just figured out that historical data was not available through the API (only realtime data is available), and that it might be useful for users to make some statistical analysis on nearby stations, for instance.

I recently had the idea of visualizing Velib data superimposed on a map of Paris and coded a small script to render the images from my dataset.

The idea is to draw a Voronoi diagram based on the position of Velib stations and superimposed it on a map of Paris. This would provide a tiling on top of Paris, where each tile can be thought of as the area of influence of a given station. Then, I colored the tiles on a red to green scale, depending on the bike availability.

If you are curious about what it looks like, here is one year of Velib starting from 09/11/2015 and (nearly) one year of Velib starting from 10/11/2016. It is quite surprising that we can really see recurring patterns in the video, I was actually not hoping it would be so clear! :)

Many things could still be improved, such as the colorscale which would be better if I exchanged red and green, or the resolution of the generated images, but this is a quick and dirty proof of concept :) My code is far from being optimized and it took about 30 hours to output all the necessary images (one image per 5 minutes) from the dumped SQL database.

Note: If you build anything from the datasets or make a better render of my maps, feel free to shoot me an email about it, I would be really interested in what people are building with all this!