Re: Diference in km between two GPS cordinates.
- From: Jerry G. <jgrant1001@xxxxxxxxx>
- Date: Sat, 20 Oct 2007 10:13:08 -0600
Hello Will,
Thanks for the education. Your responses have been very informative.
What are your thoughts on using the UTM coordinate system?
My interest in maps and gps is strictly recreational. I use National
Geographic's Trails Illustrated maps with UTM grids for parts of
Colorado and Utah and find UTM much easier to use for finding my
location on a map.
Jerry
On Sat, 20 Oct 2007 10:28:32 -0400, WillR
<willrNo.Spam.pmccl.noSpam.com> wrote:
David Ninnes wrote:
Marcello Dias wrote:
Hi,Hi Marcello,
Thank you all that replied I write my own sql function (derivide from
a Clipper Function I found in Google)
CREATE FUNCTION DistanciaKM (@lat1 FLOAT, @lon1 FLOAT, @lat2 FLOAT,
@lon2 FLOAT)
RETURNS FLOAT
AS BEGIN Declare @Radians FLOAT
SET @Radians=180/3.14159265;
SET @lat1=@lat1/@Radians SET @lon1=@lon1/@Radians
SET @lat2=@lat2/@Radians
SET @lon2=@lon2/@Radians Return (6367
*ACOS(SIN(@lat1)*SIN(@lat2)+COS(@lat1)*COS(@lat2 )*COS(@lon2-@lon1))) END
Regards,
Marcello
This, I think, assumes a sphere, it looks like the haversine formula,
GPS co-ords are WGS84 usually afaik, this uses a flattened ellipsoid, as
mentioned by other ops, the vincenty formula will give you a more
accurate result, if you're only looking at 10km += 1 km it probably
doesn't matter, but if you want to calculate down to 10's or 100's of
meters then it does.
The different values of the flattening depend on the particular
co-ordinate system you use. Also the centre is a little bit off too, it
moves depending on the co-ordinate system you use.
Check which system you use and google "distance between two coordinates
wgs84" one of these should help, or your GPS manufacturer can probably
tell you.
cheers,
Dave
This link is interesting and makes some intelligent comments about the
ellipsoids. Hopefully the fellow will check back in and look at your
suggestion.
I think this one is a good first crack at it. Glad you found the link
for everyone.
http://www.movable-type.co.uk/scripts/latlong-vincenty.html
And yes, you do have to think about the usage of the number -- thank you
for reinforcing the idea. :-)
.
- Follow-Ups:
- Re: Diference in km between two GPS cordinates.
- From: WillR
- Re: Diference in km between two GPS cordinates.
- References:
- Diference in km between two GPS cordinates.
- From: Marcello Dias
- Re: Diference in km between two GPS cordinates.
- From: Uffe Kousgaard
- Re: Diference in km between two GPS cordinates.
- From: Marcello Dias
- Re: Diference in km between two GPS cordinates.
- From: David Ninnes
- Re: Diference in km between two GPS cordinates.
- From: WillR
- Diference in km between two GPS cordinates.
- Prev by Date: Re: How to kill these warnings?
- Next by Date: Re: To those who develop in VM's
- Previous by thread: Re: Diference in km between two GPS cordinates.
- Next by thread: Re: Diference in km between two GPS cordinates.
- Index(es):
Relevant Pages
|