The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Geo-Locate Solution?

My user gives me a cross streets, or maybe a business name, plus a city and state.  I want to find out how far that location is from locations in my database.  What service do I need to use to get that information?  Retail websites do this all the time in their "Store Locator" pages.  Am I comparing GPS coordinates, or relying on some web service to spit out answers for me.  Are there any free solutions that exist (i.e., the census bureau?

Thanks for your help,
Jenn Send private email
Sunday, May 15, 2005
I did something similar a long time ago; it was pretty simple. I found a Zip Code file on the Census web site that contained zip codes and their geographic coordinates. I had the user enter their zip code, I'd get the coordinates, and with some mostly simple calculation determined how far they were from another point. If you googled information for this I bet you'd find a lot... This is actually a bit crude; I'm sure you could find something out there that is a lot more efficient.
sili Send private email
Sunday, May 15, 2005
There are online services available for a reasonable subscription fee. That might be more cost effective than trying to build your own. The math to find the distance between two points isn't all that complicated once you have the coordinates, but getting the database of addresses and keeping it up to date seems like it would be a pain.
Tom H
Sunday, May 15, 2005
Thanks guys.  I saw the zip code data, but I really need a more specific proximity search.  That is, it is important that I pinpoint exactly where the user is, b/c my database of locations is useless at the zipcode level.  I need to be able to do a proximity search at the address / cross-roads level.

I'd appreciate it if anyone can provide links to affordable/free services that offer this feature.
Jenn Send private email
Sunday, May 15, 2005
You need to update your database to associate actual coords with your zipcodes (probably lat/long or something).

Do this offline and reference the table, or your system will run like a dog (with no legs).

Companies like MapInfo have this data, or you may strike lucky and find a free source.

Once you've got this, creating a point-point or radial search is quite straightfoward (I have sql for this, or you can find it online).

I built a system to do this about 3 years ago. Here in the UK we mainly use eastings/northings (an offset in metres from the south-western most part of the UK), rather than long/lat - but that's because we can.

You may also need to consider elevation and the curvature of the earth in your distance calculations.
Justin Send private email
Monday, May 16, 2005
With a little hacking, Google Maps will do what you want.
Colm O'Connor Send private email
Monday, May 16, 2005
O'Reilly Media is going to put out two text addressing your concerns:

* Mapping Hacks - Tips & Tools for Electronic Cartography

* Web Mapping Illustrated.
Li-fan Send private email
Monday, May 16, 2005
Issues like geocoding and  proximity search are handled by GIS communities. Most of GIS software provides such capabilities. One example is Arcweb services provided by ESRI. Please go to to find detailed information.
Xinnong Send private email
Monday, May 16, 2005

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz