« What Is Best vs. What Is Best For Me | Main | Oh, the Irony! »

Geocoding Woes

One important part of Cyclopath is geocoding. If you have never heard of geocoding (I hadn't before this project), it means translating an address to latitude and longitude coordinates. Whenever someone uses the route finder, we have to translate those addresses into coordinates, find the nearest intersections, and then have our route finder look for the shortest path between those two points.

Well, as you can imagine, geocoding is not an easy task. That is why we don't implement this part ourselves. There are some great geocoders out there too. We had experimented with Yahoo's geocoder and then moved to Microsoft's MapPoint geocoder. Aside from a few sporadic issues, Microsoft's geocoder worked pretty well. That is, until a few weeks ago. For no obvious reason, addresses that used to work now completely failed. My own home address now dropped me at a location miles away from where I live. This was a problem. And users were starting to complain.

A few email exchanges with some people from Microsoft (which were very prompt by the way) didn't help in finding out what had changed with the geocoder. There was no way to get around it. So we started looking for other options. Google has an excellent geocoder which it uses for Google Maps. Unfortunately, its Terms of Service state that to use it your application must be using Google's maps. We create our own maps (needed to make it as editable and interactive as we need), so we had to scratch Google's geocoder off the list.

We found another geocoder that focuses on the Twin Cities metro area, which is where Cyclopath focuses too. So I was delegated the task of changing the code in order to use this new geocoder. After I finally started making some progress, while testing some code, I decided to try an address on the old geocoder that I knew would fail. To my surprise, it gave the correct location. Perplexed, I tried all other addresses that had been problematic in the past few weeks and to my surprise all of them worked. All of the sudden Microsoft's geocoder was working correctly. After all that brainstorming, sending emails, and looking for alternatives we were back to where we were before.

Well, not exactly. We have decided (although with a little less urgency) to finish implementing the new geocoder and leave it as a backup. That way, if Microsoft ever decides to confuse our users again, we'll be ready. Bring it on!

Comments

Microsoft sucks :-P

I feel very sorry you had to go through all that trouble, though.