I searched this forum but nothing came up. Anyone have an easy, or at least doable, way to convert a US street address to lat long coordinates, or at the very least, get a zip code for the street address. I have a database of zip code lat longs so if I can get the zip code, I can use the zip’s coordinates. Thanks
Thanks for the input.
Actually what I want to do is pass in the addresses to the businesses up front and get each of them geocoded to lat/long and then when I do map placement or relative position searches using distance from, I can use the lat/longs rather than just zip codes.
Would you recommend using Yahoo for all of that, including map display on a web page?
Shameless plug, I wrote a blog post on that topic in my blog the other week.
I feel terrible about that plug, so I’ll sum it up. There’s a link to an PHP wrapper for Yahoo’s Place Finder API on github.
I’d highly suggest going with yahoo(place finder), I use google at work and I find it lacking. We pass in the entire address string, and we store the lat and long as well as the city, state and zip code(Mainly US).
Google sometimes gets confused and will return just City State with no zip code, and sometimes just zip code and state with no city. We used to just pass in the zip code and state but thats given us even weirder results. I saw some high way in the middle east come up once when I put in a zipcode.
And since you only have zip codes i’d even more impress using place finder, you can specify that the data you’re passing in is exclusively the zip code.
Evidently I fancy book shopping much more so than book reading because I have the book already but have not read that section yet.
I’ll get right on it. Thanks.
If you fancy book shopping, I’m pretty sure that PHP 5 Advanced by Larry Ullman has a very detailed description of that functionality.
Thanks, that certainly helps. I was planning on using Google maps but didn’t see the XML option for returning the coordinates.