Google Transit and Montreal's STM

By Jay at March 15, 2009 21:53 Tags: , ,

A while ago, the Montréal's STM transit system announced that they were now supported by Google Transit.

While it is possible to trace proper routes, Google's having the same problem as I do, which is that the STM is updating schedules per trimester. And since it's the STM that is providing the data and that it's not been updated since the 1st of January 2009, schedules have been incorrect ever since.

To be perfectly fair, I did not update the schedules in my application since that time too by lack of time to create a proper update procedure, but I'm not paid for that either...

Now that I've given it some thoughts, I'm now streamlining the schedule updates stops after stops as long as they are out of date. Previously, I updated the database all at once, but this does not scale... Now the updates are progressive, which is far more manageable for me.

Anyway, now there may be a simple message saying that the displayed schedule is outdated, which is better than trusting the time and blaming the STM for no reason :)

Pocket IE and Setting IMG Src via JavaScript

By Jay at September 07, 2008 09:28 Tags:

Cet article est disponible en francais ici.

With the Montreal's Bus Stop Locator web site, to be able to use Google Maps effectively, it's imperative to let the client's browser fetch the image by itself. The Google API does not allow a single key to grab a lot of maps from a single host, so redirecting the image is not an option.

I wanted to have the image Url generated so I could use the Width of an HTML body to be embedded in the Map query, so I created a small script that builds the URL and sets as the SRC of the IMG element that will contain the Map.

Well, that seems easy, but it's not... The IMG does fetch the image, but the element's size is not updated with the size of the new image.

In my case, I'm placing the image in a TABLE element, so I'm getting the default cell size for my image. To fix that I also had to set the width and height of the IMG element, to get it to have a proper size.

PocketIE has little support for scripting, but it's somehow clear that it has been a hard to fit addition to the engine... Come on microsoft ! You can do better than that ! Have a look at what Opera's been doing...

Montreal Bus Stop Locator Site Updates

By Jay at September 07, 2008 09:06 Tags: ,

Cet article est disponible en français ici.

So far, the response has been great for my little utility, even though I'm not making an active advertising.

Using some Microsoft terminology, I'm dogfooding my own application and I found a few points that could be enhanced a bit :

  • Now, if using Google Gears, you are not automatically redirected to the stop list for your location. You simply see a small map of where you're supposed to be, and you're offered a other button to choose to use that location.
  • Some error messages are displayed when typing incorrect or missing data. That could be confusing...
  • All maps are now using all the available width of the screen. That means that the image is not resized poorly on a mobile device. Still, I wonder how the iPhone wil behave with this...
  • I fixed a bit the distance display to display Km instead of meters if appropriate, even though if you are in an other city, you'll still be offered some reaaaally long distance.
    I'm still wondering if I need to filter out people that are outside Montreal. The point of this site is also to be a technological proof-of-concept for GeoLocation, so even if the distance is not usable, it's still a valuable information.
  • I've also added some street name samples to help people that are not from Montreal to see what the site can do. I've taken a random intersection and bus stop code that can be typed in directly.
  • I also made some XHTML compliance, for what it's worth :)

Now, I think I'll try to make sure that Google search will find the site in both French and English languages because right now, I'm having the same problems I did have with my Remote Control software pages. Google's crawling without specifying a language, so for this site, English is going to come out, since it is the default language. Maybe I'll add a "/fr" and "/en" virtual base for each of them.

I'm always interested in any suggestions or bug reports !

Using Google Gears to find Montreal's Bus Stops

By Jay at August 31, 2008 20:08 Tags: , ,

Cet article est également disponible en francais ici.

It's been a while since I've posted on this blog. This time, I will not be talking about bluetooth, but still about some .NET powered code :)

I've been busy lately, but I've found some time to work on something that will help me a lot, and I think a lot of Windows Mobile users and mobile users in general.

Montreal's Bus network is somehow large, but its representation in the digital world is quite poor, and inexistent when talking about mobile internet. The web site in question is generating some quite large pages and is not suited for mobile web browsing.

Most of the time, you may want to know the schedule of the next bus, and this is quite hard to get this way.

There's been some effort lately to offer this kind of service on the iPhone, but I wanted to give the opportonity to other users to have the same information, with some Geo Localization features.

This is where google gears comes into action, where their latest release offers a Geo-Location API, which approximates a position using the nearest GSM cells location. Unfortunately, it only works on Windows Mobile devices. But don't worry, if you don't have a Gears enable device, it will still work ! You'll only have to type a bit, by entering your streets intersection.

After getting that location, I'm querying a database (using Linq to SQL) to get the nearest Bus Stops and their next schedule. I'm also querying Google Maps to get some markers pointing at the bus stops. That can be helpful since the Geo-Location is only an approximation by nature, because of the GSM 'triangulation'. It can also be used to query the schedule of a specific bus stop, using the number placed at the bottom of the bus stop signs. A small plus here, compared to the original site, is that schedules from the past half hour are still visible, making possible to have determine if a bus has missed its schedule using a great long street.

Anyway, if you're in Montreal and have an internet connected device (or a normal PC), give it a try by connecting to this adress :

Any comments or suggestions are welcome !

About me

My name is Jerome Laban, I am a Software Architect, C# MVP and .NET enthustiast from Montréal, QC. You will find my blog on this site, where I'm adding my thoughts on current events, or the things I'm working on, such as the Remote Control for Windows Phone.