I'm so confused. I'm finally getting around to needing to do a 'store
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
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!
Seattle WA 98119 47.6388 122.3700
Location: 47.637917 N, 122.364272 W
State Abbreviation WA
So I try the east coast:
Penfield NY 14526 43.1532 77.4485
Location: 43.139638 N, 77.456043 W
State Abbreviation NY
State New York
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,
For the Western longitude, use the negative value.
For instance the longitude and latitude of my zip code is -111.64338 and
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.