Formulas for great circle distances aren't hard to derive using just basic trig. No calculus required!
That being said, the Math::Trig package comes standard with Perl distributions and has a function called great_circle_distance(). Try 'man Math::Trig'. If you search PDL::Index on CPAN, I believe you'll find even more sophisticated resources for longitude/latitude and distance calculations. As for tracking data, *of course* you want to use Perl with DBI. :-) Pick the database you like, for instance PostgreSQL. Maybe these questions should be posted on more general Perl lists until you can identify specific DBI problems. There are general textbooks out there on web programming, for instance _Programming the World Wide Web_ by Sebesta. -Will -----Original Message----- From: Scott Webster Wood [mailto:[EMAIL PROTECTED] Sent: Sunday 26 February 2006 11:23 To: dbi-users@perl.org Subject: Zip Codes, Long/Lat and LAMP? OK, I think I asked something along these lines before, but I am actually starting to code so I wanted to revise the question(s) a bit. I am looking for a good way to keep an up-to-date database (or perhaps use an XML-RPC/SOAP based service) to translate back-and-forth between information such as city/state/county, zip-code, and longitude/latitude. I am currently writing most of my administrative tools in PHP but will likely build most of my content delivery items in PERL. I am going to be dealing with geocaching on the initial project and thus the locations might be specified by the name of a nearby city, a zipcode, possibly even crossroads (I'll have to work that one out later) or more often by use of GPS or similar Longitude and Latitude coordinates. My desire is to be as thorough as possible with what is actually stored and 'fill in the blanks' for the user only requiring them to fill in an 'either/or' type scenario. (use of an address OR long/lat coordinates) Thus I am looking for some way to translate one to the other and back again. (address/zip/city to long/lat, or long/lat to zip/city/county/state/etc.) Ultimately I want to include at least canada and possibly international locations (although I will likely use different tools for handling those). I've started looking at some of the services available at USPS and zip-codes.com. I'll start looking at map-services next as I would also like to be able to generate maps for people as well as possibly have them select locations on a map rather than enter the specific data. (ugh - I have a feeling that might be a nightmare) Finally, I'm sure if I can get something to work for the above mentioned translations (so I can store at least an approximate long/lat for all locations) then I can find the math myself to calculate distances, but I would be curious to know if any packages for such already exist. I did a quick search of perl but only found one CPAN tool that appeared to do Long/Lat calculations and it's not one included in the standard CPAN supported downloads. All help is appreciated. SW __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - - - - - - - Appended by Scientific-Atlanta, Inc. - - - - - - - This e-mail and any attachments may contain information which is confidential, proprietary, privileged or otherwise protected by law. The information is solely intended for the named addressee (or a person responsible for delivering it to the addressee). If you are not the intended recipient of this message, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error, please notify the sender immediately by return e-mail and delete it from your computer.