Finding the nearest stop was one of those things I just couldn’t pass up when I was designing SeattleBus. The iPhone includes some really nice geolocation API’s (meaning any iPhone application can potentially look up where you are). Apple’s set it up so you have to approve the application getting that information first though – sometimes that’s handy, but other times I think it’s darned annoying. Hey – it’s what Apple’s given us to work with here. On the whole, I’d rather someone be bothered a few times and know the application was using their location than not.
The goal of SeattleBus is first and foremost to provide real-time arrival information for stops. Finding the stops is, to some extent, secondary – but also the critical “first step” to being able to look up that realtime arrival information. Getting the geolocation for the stops was quick a challenge. I started reverse engineering the stops myself using Google’s geolocator API – it was clear enough I was going to have a long ways to go with that to make it really smooth. Metro Transit wasn’t providing the information (I’ve since started talking with them – maybe we’ll get some better data soon) – but in the mean time Adam Parast was great enough to share the same data he used to make a Google Map’s layout of all the bus stops – a mashup of Maps and MyBus.org.
So choosing the nearest stop turns out to be an interesting challenge. The geolocation API isn’t 100% accurate, so choosing a stop is really determining a list of tracked locations that are close. I thought about making a preference that someone could set, but one of the feedback components I received early on was to find and set a good default right off the bat.
I set a good default for the downtown locations, but with the release of 1.0 I’m afraid that it’s just too tight a lookup area for some of the outlying areas of those stops. If you check out Adam’s mashup, you’ll see there’s a huge density downtown and then it gets a LOT more spread out from there. So for version 1.1, I’m changing that lookup sequence a bit. When you’re in the downtown corridor (dense with tracked stops), the range for looking up stops will be pretty tight – maybe a couple of blocks. And when you’re outside of that area, I’ll loosen it up quite a bit.
Part of making this process better is getting better geolocation data for those stops too – I’m working on that now… The release of SeattleBus managed to get Metro’s attention, so we’ve got a conversation started there where I wasn’t able to get anyone’s attention earlier. Here’s to some more and interesting collaborations! (we’ll see what comes of it)