List:General Discussion« Previous MessageNext Message »
From:Nicolas Verhaeghe Date:April 25 2006 4:17pm
Subject:RE: Calculate LONG/LAT from ZIP+4 (positve vs. negative longitude)
View as plain text  

I'm so confused. I'm finally getting around to needing to do a 'store
locator' thing.

I procured myself some zip/lat/long databases from various places. Then I
noticed that for the same zip code, I got different values in different
databases??!!!

So for a sanity check, I decided to look "online" and punch in some to see
what the "real" lat/long should be. Well, different sites give different
values, and not only are they "slightly" off, but sometimes they're
_positive_ or _negative_!? UGH!

http://www.zipinfo.com/cgi-local/zipsrch.exe?ll=ll&zip=98119&Go=Go
Seattle WA 98119 47.6388 122.3700 
http://www.census.gov/cgi-bin/gazetteer?city=&state=&zip=98119
Location: 47.637917 N, 122.364272 W

http://www.csgnetwork.com/cgi-bin/zipcodes.cgi?Zipcode=98119
http://www.myzipdb.com/mzdb_demo.php
http://www.nearby.org.uk/coord.cgi?p=98119
City Seattle 
State Abbreviation WA 
State Washington 
Latitude 47.638770 
Longitude -122.366941 

So I try the east coast: 

http://www.zipinfo.com/cgi-local/zipsrch.exe?ll=ll&zip=14526&Go=Go
Penfield NY 14526 43.1532 77.4485 
http://www.census.gov/cgi-bin/gazetteer?city=&state=&zip=14526
Location: 43.139638 N, 77.456043 W

http://www.csgnetwork.com/cgi-bin/zipcodes.cgi?Zipcode=14526
http://www.nearby.org.uk/coord.cgi?p=14526&f=full
City Penfield 
State Abbreviation NY 
State New York 
Latitude 43.145342 
Longitude -77.458499 

Please help me to understand WTF is going on? 
Which lat/long do I need? 
How does the negatives effect the magic formulas to calculate distances? 
(I'm no trig wiz). 

I assume that the more precise the numbers, the better the results will be. 
To what decimal point should I be concerned with?

---------------------

Use the value in degrees and decimals of degrees, not minutes, seconds,
etc...

For the Western longitude, use the negative value.

For instance the longitude and latitude of my zip code is -111.64338 and
33.436767.

There is already a PHP Class to do that job, never tested it, but I
programmed this already for SQL Server, I am sure that doing it for MySQL
would not be that complicated.

It does not matter if you are not 100% accurate, you are usually off by one
mile or two, but it gives an idea.

Thread
Calculate LONG/LAT from ZIP+4Jack Lauman27 Jun
  • Re: Calculate LONG/LAT from ZIP+4Scott Gifford27 Jun
    • Re: Calculate LONG/LAT from ZIP+4Brian Dunning27 Jun
      • Re: Calculate LONG/LAT from ZIP+4Scott Gifford27 Jun
        • Re: Calculate LONG/LAT from ZIP+4Brian Dunning27 Jun
          • Re: Calculate LONG/LAT from ZIP+4Scott Gifford27 Jun
            • Re: Calculate LONG/LAT from ZIP+4Brian Dunning27 Jun
  • Re: Calculate LONG/LAT from ZIP+4Kieran Kelleher28 Jun
  • Re: Calculate LONG/LAT from ZIP+4Mattias Håkansson28 Jun
    • Re: Calculate LONG/LAT from ZIP+4Kieran Kelleher28 Jun
      • Re: Calculate LONG/LAT from ZIP+4Brian Dunning28 Jun
        • Re: Calculate LONG/LAT from ZIP+4Kieran Kelleher28 Jun
    • Re: Calculate LONG/LAT from ZIP+4Brian Dunning28 Jun
      • RE: Calculate LONG/LAT from ZIP+4 (positve vs. negative longitude)Daevid Vincent25 Apr
RE: Calculate LONG/LAT from ZIP+4Dirk Bremer28 Jun
RE: Calculate LONG/LAT from ZIP+4 (positve vs. negative longitude)Gmail User25 Apr
  • RE: Calculate LONG/LAT from ZIP+4 (positve vs. negative longitude)Daevid Vincent25 Apr
RE: Calculate LONG/LAT from ZIP+4 (positve vs. negative longitude)Gmail User25 Apr
  • RE: Calculate LONG/LAT from ZIP+4 (positve vs. negative longitude)Tim Lucia25 Apr
RE: Calculate LONG/LAT from ZIP+4 (positve vs. negative longitude)Nicolas Verhaeghe25 Apr
RE: Calculate LONG/LAT from ZIP+4 (positve vs. negative longitude)Jay Blanchard25 Apr
  • Re: Calculate LONG/LAT from ZIP+4 (positve vs. negative longitude)Webmaster25 Apr
  • RE: Calculate LONG/LAT from ZIP+4 (positve vs. negative longitude)Daevid Vincent25 Apr
RE: Calculate LONG/LAT from ZIP+4 (positve vs. negative longitude)Jay Blanchard26 Apr
Re: Calculate LONG/LAT from ZIP+4 (positve vs. negative longitude)Peter Brawley26 Apr
  • RE: Calculate LONG/LAT from ZIP+4 (positve vs. negative longitude)SST - Adelaide)26 Apr
    • RE: Calculate LONG/LAT from ZIP+4 (positve vs. negative longitude)Nicolas Verhaeghe26 Apr
RE: Calculate LONG/LAT from ZIP+4 (positve vs. negative longitude)Nicolas Verhaeghe26 Apr
  • Re: Calculate LONG/LAT from ZIP+4 (positve vs. negative longitude) \"Adam i Agnieszka Gąsiorowski FNORD aka ALinkA aka symbol '( { .A. } )'' ||~> { A.A }\" 2 May
    • RE: Calculate LONG/LAT from ZIP+4 (positve vs. negative longitude)Gary M. Allen3 May