VEMap.Find Returns Italian Location from US Addresses (Los Angeles)?

This one took me a couple of minutes to figure out, so I thought I’d pass it along. Recently I launched an update to an application (in beta) that used the VEMap.Find method to geocode addresses in Los Angeles, CA, but for some reason the results for a few of the addresses would show up somewhere in Italy. Eventually I noticed that this was only happening for avenues (as opposed to streets or boulevards). I realized that our street database used the abbreviation “AV” instead of “AVE” and deduced that there must be an Italian province (Avellino?) that used that abbreviation and the parsing engine behind VEMap.Find must pick that out before the zip code.

My solution was to replace the word “AV” with “AVE” in the address string before passing it to the VEMap.Find function with the following:

address.replace(/\bAV\b/,"AVE")

So far, so good. I wonder how may more calls to replace I’ll end up daisy chaining on to that before I’m through with this one…

Google+ Comments