Zipdy: Free Zip Code Distance Calculator: FAQ


[About] [CGI Demos] [Download] [FAQ] [Feedback]


Table of Contents

  1. Is Windows officially supported?
  2. Why isn't MySQL supported by zipdy?
  3. Will more databases that support subqueries be supported by zipdy soon?
  4. How do I compile the test program?
  5. How do I do calculate different proximity distances?
  6. How do I do arbitrary distance proximity searches?
  7. I think Zipdy be producing inaccurate results. Or, why don't zipdy calculations match up with US Postal Service calculations?
  8. I think one of the data files might be corrupt.
  9. How do I calculate an MD5 Checksum?
  10. Can Zipdy be used to draw maps of zip codes?

Is Windows officially supported?

Not at this time. Although, Tim McLaughlin [tim@iterationzero.com] has written a python script which runs on Windows. But please don't ask me for windows support, as I haven't used windows in about 8 years and therefor do not have the knowledge to assist you.

The answers to the following questions will assume that you're running the GNU/Linux OS.

Why isn't MySQL supported by zipdy?

I just haven't gotten around to it yet. Look for it in version 3.0.0.

Tarique Sani forked zipdy to support MySQL, but his version calculates distances for each zip code each time it runs. Therefor, it's unlikely to scale to a reasonably large web site. His forked code is available here: http://www.sanisoft.com/ziploc/

Will more databases that support subqueries be supported by zipdy soon?

Yes. I'll begin adding more database support soon. Currently postgresql and DB are supported. I will add IBM DB2 and MySQL support in the future. Code submissions to support other databases and welcome.

How do I compile the test program?

With the command:

gcc -lgdbm zipdy_test.c -o zipdy_test

How do I do calculate different proximity distances?

You can do this by modifying the zipdy_force.c source file which is located in the src/optional directory. Simply change the file name and the comparison in the code.

How do I do arbitrary distance proximity searches?

There are two ways that you can do arbitrary distance proximity searches. First, you can use the zipdy great circle code to calculate the distances in real time. This will likely be too slow to be very practical. Second, you can acquire enough disk space to store the distance between each set of zip codes with in a certain boundary distance. If you choose the second method, you can modify the zipdy_force.c source code file in the src/optional directory to write this data into a database table rather than writing it summarized into a text data file.

I think Zipdy be producing inaccurate results. Or, why don't zipdy calculations match up with US Postal Service calculations?

Zipdy uses GIS points associates with zip codes from data provided by the US Census. The zip code long/lat points provided by the census are at the population center of the zip code rather than the true center of the zip code polygon. In data provided by the US Postal Service, which is used by many other commercial applications, the long/lat zip code points are the geographical center of the zip code rather than the population center. This may result in varying degrees of geographic inaccuracy. However, for the use Zipdy was origionally intended for, the use of population zip code centers will produce more accurate results than the use of geographic zip code centers.

I think one of the data files might be corrupt.

Please check the MD5 checksum of the file against the MD5 checksums posted on the Zipdy page both before and after decompressing. If the MD5 checksums are the same and you still believe the file to be corrupt, please let me know. Please include a description of the corruption if possible or at least an explanation of how you discovered it.

On some Linux distributions, Netscape is configured to uncompress gzip'd files on the fly before saving them to disk. Netscape often corrupts data when doing this. You should save the files to disk and decompress them by hand if you are experiencing corruption (MD5 checksums which do not march). I'd strongly suggest using a web browser other than Netscape, such as Mozilla, lynx or konqueror. A web client such as wget would also work very well.

How do I calculate an MD5 Checksum?

Your Linux distribution should have included a program called md5sum. To calculate a MD5 checksum, run the md5sum program with the filename you want to calculate the sum on as an argument.

Can Zipdy be used to draw maps of zip codes?

No. Zipdy only contains a single GIS point (longitude and latitude of the population center) for each zip code. The TIGER/Line Product, which is cartographic files that can be used to create maps of the zip code can be downloaded from the US Census website. Several cartography programs are available which can draw maps from the data provided by the Census.



Last Updated: 2006.01.08