使用GPS坐标计算最短距离 [英] Shortest distance calculation using GPS Co - ordinates

查看:177
本文介绍了使用GPS坐标计算最短距离的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想借助GPS坐标计算公式,计算最短距离,准确度> 5 mtr。大圆距公式。但它们适合长距离计算。如果我们在mtrs中谈论准确性应使用哪个公式? Vincenty的公式在WGS84逼近地球形状时精确至毫米级(这显然有点矫枉过正,地球与WGS84不一致)

几年前,我为在Javascript中计算距离。如果您对算法有任何疑问,请随时询问,因为代码缺少注释。

一个潜在的问题是这些算法在海平面上工作并且不考虑高度差异考虑在内。将转换为地球笛卡尔坐标代替并使用直线距离,而不是...



经度<$ c的直线距离 d 的直接表达式$ c>φ,纬度λ和高度 h


$ b $

  k =√(a²·cos²φ+b²·sin²φ)
r =(a²/ k + h)·cosφ
z =(b 2 / k + h)·sinφ
d =√((z-z')2 + r 2 + r'2 - 2·r·r'·cos(λ-λ'))

与paramteres的以下值

  a = 6378137m 
b =(a·297.257223563)/298.257223563


I want to know the calculation formula with the help of GPS Coordinates for shortest distance calculation with accuracy >= 5 mtr.

I have checked the Haversine Formula and the Great circle distance formula. But they are good for long distance calculations. If we talk about accuracy in mtrs which formula should be used?

解决方案

Vincenty's formulae are accurate up to millimeter scale on the WGS84 approximation of earth's shape (which will be overkill as obviously, earth does not agree with WGS84 to that degree).

A few years ago, I implemented some algorithms for distance calculation in Javascript. Feel free to ask if you have any questions about the algorithms as the code lacks comments.

One potential problem is that these algorithms work at sea-level and do not take height differences into account. It might be a better idea to convert to geocentrical cartesian coordinates instead and use the straight-line distance instead...

The direct expression for the straight-line distance d of points with longitude φ, latitude λ and height h is given by

k = √(a²·cos²φ + b²·sin²φ)
r = (a²/k + h)·cosφ
z = (b²/k + h)·sinφ
d = √((z - z')² + r² + r'² - 2·r·r'·cos(λ - λ'))

with the following values for the paramteres

a = 6378137m
b = (a·297.257223563)/298.257223563

这篇关于使用GPS坐标计算最短距离的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆