Wednesday, September 17, 2008

Getting free Velib' w/o getting tired

A cool thing about Paris is its public bicycle system, called Velib'. The concept is fairly simple: for 30 euro a year, you can take and use any bicycle available around the ~1000 stations spread across the city.

The rules: You may take your Velib' at point A and give it back at point B. You may use it up to 30 minutes for free; if you use it more than that, you will pay (1 euro for the next half-hour slice, and so on).

The downside of the system is that a few stations, mainly these located at higher altitudes, were usually empty, whereas stations close to them, but at lower altitudes, were packed very quickly (for obvious reasons).

This problem was solved a few months back, when about 10% of the stations (*mainly*, the highest-located ones) were converted to V+ stations. The concept is simple: When you borrow a bicycle in a regular station and bring it back to a V+ one, you get extra credit. This virtual money can then be used to pay your extra time when you borrow a Velib' for more than 30 minutes.

Now, you see where I'm going! Some V+ stations are really close to regular stations, as you can see on this page. But how close exactly? And which ones are the best spots, ie, V+ super close to a V stations? Filling up an account with extra credit might not be that exhausting after all...

The GMap map used on the above page is fed with Velib' stations data from the following XML feed. It contains the station names, addresses, geo-coordinates, as well as flags (is the station in operation? is it a bonus station?).

If we calculate primitive euclidean distances between 2 stations using their (longitude; lattitude) coordinates, omitting the altitude, we could easily figure out, for each of the 90 operating V+ stations, which regular station is the closest...

Now, I'll spare you the code (very easy to write, check it out here), and will go straight to the best results. The format is (V+, V, distance):

09018 - PLACE PIGALLE > 09019 - VICTOR MASSE (0.000919)
18043 - BLANCHE > 09027 - FONTAINE DOUAI (0.001091)
18041 - MARTYRS 2 > 09017 - TRUDAINE MARTYRS (0.001140)

Let's visually check our best couple on the map, which are stations 09018 and 09019:

Yep, seems OK to me. One might go to Pigalle for *different* reasons after all...


Anonymous said...

Nice idea ! BTW, the Velib' concept was invented in Rennes long before Paris

Nico said...

Thanks! And you're right, as Paris kinda stole Rennes' thunder on this one...
Anyways, checked this morning at Pigalle, worked like a charm, both stations are like 50 meters appart.

JoE said...

Very funny work !
Keep going dude ;-D