[thelist] Best Practices for building a zip/postal code based dealer locator

Joshua Olson joshua at alphashop.net
Wed Sep 26 18:47:04 CDT 2001


The absolute easiest way to do something like this is to make sure you have
the ZIP code for each dealership, then search against the ZIPS using
something similar to:

SELECT *
FROM db
WHERE zip LIKE '309%'

That will match the first 3 digits of the ZIP, which is usually what is
needed to get the surrounding areas.  For rural places, that will get you
pretty far away from the source zip, so try using the first 4 digits instead
of the first 3.

Another way, less easy, is to know the geographic center of each ZIP region
(longitude and latitude) and the coordinates of each dealership and go from
there... not recommended.  .jeff has coded something like this and probably
has a good idea how to do it if you want.  (Though I do not recommend it)

-joshua

----- Original Message -----
From: "Bryce" <bryce at popped.com>
Subject: [thelist] Best Practices for building a zip/postal code based
dealer locator


: I have been tasked with coming up with posible solutions for building a
: dealer locator that is to be searched by postal code.
:
: Can anyone who has built something like this share your experience on the
: best practices on how to go about building this and pitfalls to watch out
: for would also be greatly appreciated. If anyone has any boxed solutions
: they can recommend that would also be great.





More information about the thelist mailing list