What are some best practices for creating an online office locator?
June 23, 2008 9:54 AM
Subscribe
What are some best practices for creating an online office locator?
We have multiple offices around our state, and I'm creating an office locator tool that will help people find the nearest office when they enter a zip code. I'm having a hard time wrapping my brain around the logic I need to use. Here is what I have come up with:
1-Calculate the Longitude and Latitude of all of our offices, and store it in a database.
2-Calculate the longitude and latitude of the center of the zip code entered.
3-Subtract the longitude of the zip from the longitude of the offices.
4-Subtract the difference between the latitude of the zip from the latitude of the offices.
5-Add the 2 differences together, an organize them in an ascending order.
6-Output the list of offices with the closest one to the top.
Is this the best logic for an office locator? Can I get the longitudes and latitudes from something online like the Google Maps API?
Any other suggestions would be very helpful.
posted by HC Foo to computers & internet (7 comments total)
5 users marked this as a favorite
One sevice that does free zip to position conversions is geocoder.us, although I haven't used it.
posted by le morte de bea arthur at 10:02 AM on June 23, 2008