Hi. I want to find, for each US 5 digit zipcode, the distance to the nearest store run by one of our competitors. I can determine a list of competitor zips by using the store locator on their site. I also need a good source for the latitude and longitude of (the centroid, I guess) each zipcode, as well as a function to get the distance (great circle, I guess) between two points specified in latitude and longitude, as well as reasonable approach to find the closest zip to each zip (as there are 30 or 40K valid zipcodes).

This doesn't need to run in real time -- it is not a web app -- but I do need to refresh the whole process every few months.

Any suggestions from the Monks? Any useful CPAN modules I should be considering? Any good sources of zipcode data in the public domain?

In reply to Distance to nearest store by nop

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.