compare longitude and latitude values of two tables

meenu
03-29-2008, 11:53 PM
compare longitude and latitude values of two tables
advance thanks to all
i want to do one report based on long and lat values.can anybody help me the logic behind this????

one eg

i have one table in my sql db which contain lon and lat values of vehicle movement.
eg:
lon is 58.549315555555559 and lat is 23.619708888888891
this table does not contain any location name.
...........................
i have another table which contain location name and corres lang and lat values.
In this table exact value of vehicle long and lat is not there

but i have nearly 10 records that long and lat values are near to above values(first table)

from this how i will select one location?
using which formula i want to do this?
nearly 20 meters differ is there then i can select.
..........

Wilfried
03-31-2008, 06:29 AM
Hi,

to find the distance between 2 latitude / longitude positions is very easy. For Latitude 1 arc second is exact 1 sea mile. For Longitude you have to multiply with Cosine(Latitude).

Winwaed
03-31-2008, 08:25 AM
Wilfried: That would give you what I was calling a "corrected Pythagoras". It is quick, but not hugely accurate. Might be good enough for this query though.

iirc, the nautical mile is defined for a specific latitude - the Earth is not a sphere, so the length of an arc second of latitude varies between the Equator and the Poles.

On top of that you have to correct for the geoid, but this will be a smaller (and more difficult!) correction.


Richard

Wilfried
04-02-2008, 03:38 AM
Thanks Richard for clarify. I saw your reply in another thread after I replied to this one :)

 
Web mp2kmag.com
mapforums.com