2 Neurones & 1 Camera

Olivier Thereaux

Bixi on the iPhone

(… and ipod touch, and blackberry…)


Update July 2011: The code is open on github.
Update September 2011: The map should now work not only for Montreal, but Toronto too.
Update 28 October 2011: Access to the toronto map is broken. Looks like Bixi Toronto is blocking access to their station data from my server. Sorry, Toronto! :(
Update December 2011: That's it, I give up. The Montreal bixi site has changed the location of their map files, again. Probably following a shiny "redesign" where they also broke access to map.bixi.com. And in the new location, they are blocking access from my server, just as they do for Toronto. By now, I hope this hack has served its purpose, anyway: show that using data to build useful mobile access wasn't so hard, and show the importance of a commitment to open, documented data access. I will be decomissioning my script from today on - if you want it back, feel free to nag bixi until they understand why it would make sense for them to provide an open data feed or an API.


Bixi is the new community bike service here in Montreal. Lots of brewhaha around launchtime, but to me, the really annoying shortcoming of the system so far was not being able to check the status of stations on the go.

According to a message I read on the facebook group for bixi a few weeks ago, there is “no plan to provide an API, iphone app or mobile access to the map of bixi stations”. That’s rather silly, knowing that the users will want to know, in real time and on the go, whether they can get or return a bike nearby.

I’m too lazy to build a real iphone app over the week-end, but I wanted to prove that it doesn’t cost tens of thousands of dollars to provide bixi users mobile access to the status of the stations.

30 minutes and about as many lines of python later, I had a working hack to include a map of all stations in google earth, google maps or the map application on my iphone.

iPhone Instructions

Here’s how to use it on the iphone (or networked iPod Touch):

Disclaimer: I built this using only publicly available data – not a public, official API, though. If the powers-that-be at bixi decide they don’t like it, or change the way they organise their data, or any other silly move, I’ll have to pull the plug on this little hack. In the meantime, I intend to use it and provide it for free. Enjoy.

Update Dec 2nd, 2010: I originally used the bit.ly service to have users of this little hack have as few characters to type as possible. A year and a half later, I notice that the map wasn’t loading any more… because bit.ly no longer redirected to the kml file on my server, but to a news item that has nothing in common with the bixi map. Two hours later, it was back.

Glitch? No glitch? I don’t know, but I have learned my lesson learned: URL shorteners don’t guarantee that their service will be stable and that they won’t recycle their preciously short identifiers: links going through them may well lead to uncomfortable surprises. Meanwhile, I have made the kml available through http://ot.zoy.org/bixi, which arguably is 5 characters longer than http://bit.ly/bixi – the price of stability.

54 Responses to “Bixi on the iPhone”

  1. Boris Anthony says:

    Excellent! Merci!
    Can I suggest putting a heading of “Instructions” over the screenshots? I thought they were just screenshots and totally missed that the texts underneath were the instructions. Karl had to point it out. :)

  2. Hi, I translated your text in french and published it on blogger. I didn’t link back the bigger image content hosted on your site. I can remove links to the small version if you want. I cited your name a put a link back here right at the beginning. Don’t hesitate to contact me if you have anything against those conditions ^^

    Many thanks to you, if it could make Bixi move faster.
    On a side note, I’m toying with the idea of logging my personal data I’m generating by using the system by saving the transcripts they put in my Bixi webspace. I’d love to have a way to extract it and save it automaticaly. !D And it would provide wonderful raw data for a visualisation application, why not on android phones… ? ;)

    • olivier says:

      Hello,

      No problem with the translation – I guess I could have done it myself, but am happy someone beat me to it.

      It would indeed be awesome if bixi allowed us to export our usage data for visualization/massaging purpose :).

  3. Beeg says:

    Excellent! Great app – one question: I was trying to save the URL as a location, but it just doesn’t work. I tried launching it from Safari (maps://maps.google.com/?q=http://bit.ly/bixi) but that doesn’t work – it just loads Google Maps. I tried saving the URL as the address for my Bixi contact, but it automatically appends CANADA to the end of the URL, since you all iPhone contacts are automatically assigned the default country.

    For the time being, the URL is stored in the “recent” bookmarks in the Google Maps app, but that will only work as long as it’s a recent search. Any tips?

    Thanks again for your great work!

    • olivier says:

      Hi Beeg,

      I tried similar things, and came to the same conclusion.

      The maps app remembers the past search strings, so when I type “http” it shows me the http://bit.ly/bixi choice. Imperfect, but it seems to be the only functional solution… If you find a better way, let us know!

    • Beeg says:

      You’re right – tapping “h” usually does it. How quickly does your map update? I gather it doesn’t refresh automatically, but I think I noticed some discrepancies. It’s hard to tell because the Bixi map seems a little wonky. If anything, your app at least allows you to quickly consult the list of stations, and with the GPS button, you can easily see what’s around you.

  4. olivier says:

    Hi Beeg,

    The map is updated every few minutes. Unfortunately once loaded in the app it does not refresh automatically, one has to re-load the map. That’s somewhat annoying. I should look into this:
    http://code.google.com/apis/kml/documentation/kml_21tutorial.html#expiration

    • Beeg says:

      Thanks. This is really great – it’s been extremely useful the past few days. The map integration makes it easy to find nearby Bixis (to pick one up or drop one off). Ideally it would be matched with a list feature that would allow you to store favourite stations, see the nearest ones, etc. Thanks again.

  5. Mathieu says:

    Great find!!

    It really helps for iPhone users and I find it useful even from a computer, since google maps seems faster than the google map application of Bixi’ website.

    One question, I still cannot figure out exacty how this really works, but would it be possible (and easy!) to show the name of the station together with the numbers of available bikes/slots?

    Thanks again for your work!

  6. michael says:

    that’s perfect!
    Thank you!

  7. david gregoire says:

    There is already one webApp for iPhone and Bixi, try http://bixiMobile.com !

    • Fabrice says:

      Gregoire, don’t say already when you’ve been beaten to market, this hack is available since the 16th of May ! And this is so much nicer, usefull and good hearted than your ugly illegal “application” (I should say webpage)

    • Sylvain says:

      Indeed Fabrice, biximobile.com has got to be one of the ugliest webapp I’ve seen. The solution proposed on this webpage is much more elegant and much faster to load.

  8. mare says:

    Am I the only one that gets: Safari can’t open theis file. Apparently Google maps is not registered as a viewer for KML files.

    I’m on a jailbroken iPhone; need it for development.

    • olivier says:

      Mare, yes, opening the kml URL directly from safari does not seem to always work. From the maps application, it works nicely AFAICT.

  9. Arjun says:

    And if one doesn’t have an iPhone? I know the iPhone is the sexy phone but most people don’t have one. Believe it or not. I can’t believe the Bixi people did not think to create a mobile version of their website. They did so much right but not having a mobile map ready to go is the dumbest thing ever.

    • gotta agree with Arjun, regardless of what platform (iPhone, BlackBerry, Palm) the simple fact that a) no public API b) no mobile website c) no mobile APP for a project that highly revolves around wifi is kinda unprepared.

      everything else seems thought out…

    • olivier says:

      If I remember correctly marketing studies seem to show that only a very small percentage of population in Montreal own a web-friendly phone.

      Companies (e.g. Stationnement Montreal) thus seem to consider mobile apps as a waste of time, or a “nice to have” for later.

  10. Jacques says:

    Merci… c’est très utile. Mais je ne vois pas les stations au sud de la route 720 (Vieux Montréal)…
    Merci encore…

  11. kyle says:

    Some things:

    1. Does anyone know how to pull up a larger version of the google map on the bixi website, or to get the stations to overlay on the regular maps.google.com page?

    2. It’d be really neat to see graphical data of our user bike usage.

    3. How about a google map interface that shows each Bixi station as a number, instead of having to click on each station to find out how many bikes/spots are there. It could be done with just simple numbers, using a different color for bikes/spaces, or a visible fraction. ie 2/10 for 2 bikes and 8 available spots.

    4. Anyone know how, or want to start a freelance Bixi user forum/wiki to be the ‘go to’ place for all this type of stuff?

  12. denki says:

    @arjun If your phone can display enough of google maps to enable you to search, this little hack will work.

    To know if your phone supports google maps try visiting m.google.com/maps

    Just put bit.ly/bixi in the search and google maps should show you the latest status for all stations.

  13. Jacques says:

    Why there is no information for ‘Vieux-Montreal’ sector ?

    • olivier says:

      Hi Jacques,

      The info on old montreal is there, as far as I can tell. Are you using the iphone Maps app?

    • Mathieu says:

      I also had this problem yesterday while trying to load the station on my iPhone… I noted that if the visible area on my iPhone screen is near the old port, than the stations near Jean-Talon will not show. Also, if the visible area on my iPhone screen is more up north, than the stations south of 720 highway won’t show! This may have something to do with the fact that there is a lot more stations now than a few days ago…

      However, this problem seems to be intermittent since the map did load entirely the fourth time I tried!

      One more thing, would it be possible (and easy!) to show the name of the station together with the numbers of available bikes/slots?

    • Alex says:

      I think there is a limit to the number of spots pulled up by the Google Maps app – so if you are zoomed out it will not show every bixi station. You need to zoom into the area where you are looking and then search for the URL there – it will regenerate the station markers in that zone.

  14. Bravo!
    Belle trouvaille. Je vous cite dans mon blogue!

  15. kyle says:

    I got all excited and started a Bixi Fan page thing:

    http://bixifan.wetpaint.com

    It’s quite hack right now, but I’ve been pretty obsessed with Bixi ever since it started and hope this wet paint page will become a forum of sorts where people can find all things Bixi. I’ve already uncovered some cool Bixi mapping apps people have made, etc. Anyone can join and add to it. It’s really just a Bixi Wiki. Hope you enjoy it.

  16. Steve says:

    Vraiment cool. I tried it in GoogleMaps for BlackBerry and it works perfectly as well.

    (It would have been so helpful last Friday when I spent 30 minutes trying to find a slot in Quartier Latin where each one of them in every stations in the area was taken!)

    Merci!

  17. GM says:

    this is tasty!

    that biximobile webapp is so ghetto, and just as slow as the map on bixi’s site on iPhone OS.

    bixi informed me by email they are working on their own iPhone app that will be released later this summer. i just hope the official bixi iphone app isn’t as ugly as the bixi website.

  18. mare says:

    I’m a n00b. I opened the link in Safari instead of Google maps.

    From Google maps it works perfectly. Now I only have to find out how to make a bookmark in Google Maps for the iPhone…

  19. Bixi says:

    [...] you have an iPhone or iPod you might want to check this site to get an interactive map that you can load in Google Maps which shows the location of all 300 stations and how many bikes (or free spots) are available at [...]

  20. mare says:

    So I tried Bixi and this Google maps thing out today. I went to Jean Talon. According to the map, there should have been 7 free spots at the Henri-Julien/Jean Talon stand. None. Next stand, 300 metres further away on Chateaubriand/Belanger. According to map, 5 free spots. In reality, none. Finally we found one free spot on the Breboeuf/Jean-Talon stand, about a kilometre from our destination. We changed bikes (our time was up) and went back home.

    If the information on the Bixi website is not correct and up-to-date, you can’t plan a trip. Without my iPhone, I wouldn’t even have known the locations of the “nearby” stations. Bixi is nice, but you shoukldn’t want to use it to desinations, like the Jean Talon market, or a cinema downtown or things like that. The bike/stand ratio is just not good, there should be three times more parking spaces than bikes.

    • The system is currently in it’s initial deployment phase until the end of June, all stations are not complete. They are gathering data over this period to adjust the system.

  21. Swann says:

    That’s EXCELLENT!

    Thank you!!

  22. Billy says:

    Got it to work for Google Maps on my Blackberry 8830 World Edition. Now I just have to wait for my data bill, because only I only get 4MB a month. Do you have any idea how much Google maps eats up?

    Thanks for putting this together!

  23. Here is a video I just made that I think will interest some people ;-)

    I’m working on a BIXI iPhone application

    I’m not planning on doing the same thing as Spark and publish anything without the conscent of BIXI.. I’m working on that for my personnal usage.
    But in the eventuality that BIXI are interested on the app. I will not mind selling it to them or putting it on the App Store.

    Here is the video of the development status on 2009-06-06: http://www.youtube.com/watch?v=8Lu_wDvsK5I

  24. Here is a more detailled overview of the app I am working on. (Sorry it’s all in french ;-))

    http://www.youtube.com/watch?v=LYWakaSE97E

  25. Beeg says:

    Benoit,

    Fantastic work. I hope you can sell it to StatdeM!

  26. Colin says:

    Looks like the Bixi people thought your idea was so great that they took it for themselves. Instead of your bit.ly link, now we can go directly to http://map.bixi.com and it will work the same way, although it seems to load faster… they probably have more money to throw at their server.

  27. Boblevert says:

    There’s also iBixi, available for iPhone.
    Been using it all week now and I prefer it to their slow-loading map.

  28. I'mSoBixcited says:

    I’m with Bob.
    If you have an iPhone, your best bet is iBixi.
    I can’t wait for the OS 3.0 version…

  29. [...] Si vous voulez voir les stations sur votre Iphone ou Ipod touch: http://artbeat.me/2009/05/16/bixi-on-the-iphone/ [...]

  30. michael says:

    Try out my app, BIke taXI as an alternative to iBixi and Bixou. Best of all, it’s free!

    http://bit.ly/1SO5q

  31. andrew says:

    BixIt is a brand new iPhone app for BIXI users – fast and simple, it shows you the number of bikes and docks directly on the map. No more need to click around on different stations to find a bike or a place to park!

  32. joshua says:

    thanks for the app

    Works great on the symbian app.

  33. Xiao Yu says:

    Solid job. Where did you derive the original data to feed you python script?

  34. Emilio says:

    Works on Android too :) thanks

Previous/Next

Being a Web Architect

2009-04-28

For the first decade I spent working in Technology and the Web, I never really had a Job title. My roles and responsibilities varied from project to project, and I never felt like a single title would do my work justice. So it is with a certain feeling of excitement that, in 2009, I signed for a job with a clear title: “Web Architect”.In hindsight and with a little honesty, I had very little idea what that meant.

Read more


Ruskin and Slow Travel

2009-05-20

No changing of place at a hundred miles an hour will make us one whit stronger, happier, or wiser. There was always more in the world than men could see, walked they ever so slowly; they will see it no better for going fast. The really precious things are thought and sight, not pace.

Read more