Geocoding is a bit of an art rather than an exact science. Consider these different outputs:
Good address - Found, OK. ---------------------------------- Q: 1200 Adams st., Chicago A: 1200 W Adams St, Chicago, IL 60607, USA Bad address - Changed to nearest street of the same name, in a different town, same state. ---------------------------------- Q: 1200 Adam st., Chicago A: Adam St, Morris, IL 60450, USA (no 1200) Bad address - Multiple choices in the same state. ---------------------------------- Q: 1200 Adam st., Sacramento A1: Adam Ct, El Dorado Hills, CA 95762, USA A2: Adam Ct, Granite Bay, CA 95746, USA A3: Adam Ct, Rocklin, CA 95677, USA Very bad address - 602, not found. ---------------------------------- Q: 1200 Dummy st., Chicago A: 602 - Not found My suggestion would be to try getting directions first, and - If success, all is good - If error, then -- Show error message "Something went wrong. Checking ..." -- Try geocoding the points one by one When geocoding, start by the highest hierarchy, meaning --- First try to send the correct country --- Then try to send the correct state --- Then try to send the correct zipcode --- Then try to send the correct city --- Then try to send the street --- Then try to send the number Or you can try to create your own artsy algorithm based on trial and error. ;-) -- Marcelo - http://maps.forum.nu -- On Apr 27, 4:59 pm, TheTXI <[email protected]> wrote: > First off, the overall aim of this project is to take customer > locations and string them together to get estimated drive time and > directions (as well as perform calculations on those returned values > to provide approximate costs). I have been using the GDirections and > the load from waypoints method. All of this is working fine, except in > instances where a faulty address is included in the list of waypoints. > > Since I have seen no method of figuring out which item in the > waypoints list was the one to cause the API to send back the error, I > have been trying to figure out other ways to verify addresses before I > ever bother sending out the request for directions. The newest method > I tried to do was to use the Geocoding service's getLatLng method, but > that was until I realized that it is sending it's best guess if no > exact match is found. This isn't exactly the functionality I was > hoping for or needing at this time. I did, however, like the way I > could specify the callback function on this method so that I could > immediately give an alert back stating the validity of the address. > > Is there some other method I should look into to verify that an > address is going to work in the directions object or am I just going > to have to use the directions object to send this new verification > request (with only one waypoint) and see if it sends me back the error > code again? > > It seems like verification of an address should be something fairly > straightforward, but perhaps I am mistaken. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
